Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: What's righ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 25 of 43 Topic 4028 of 4053
Post > Topic >>

Re: What's right with FORTH and wrong with c.l.f.

by Aleksej Saushev <asau@[EMAIL PROTECTED] > May 4, 2008 at 11:59 PM

Marc Olschok <nobody@[EMAIL PROTECTED]
> writes:

> Aleksej Saushev <asau@[EMAIL PROTECTED]
> wrote:
>> Marc Olschok <nobody@[EMAIL PROTECTED]
> writes:
>> 
>> > Aleksej Saushev <asau@[EMAIL PROTECTED]
> wrote:
>> >> Bruce McFarling <agila61@[EMAIL PROTECTED]
> writes:
>> >> 
>> >> > On Apr 30, 5:14 pm, Richard Owlett <rowl...@[EMAIL PROTECTED]
> wrote:
>> >> >> What do they have in common?
>> >> >> Someone else has compiled raw data. It's available in ASCII
format.
>> >> >> That requires me to parse it.
>> >> >> I doubt anyone would claim string handling as a Forth forte.
>> >> >
>> >> > However, parsing data in ASCII format *is* a Forth forte.
>> >> 
>> >> But the world is not ASCII, and this brings Forth to failure.
>> >
>> > Perhaps the word "контексте" might be worth noting.
>> 
>> I doubt it, even in the context of ASCII Forth isn't good at parsing,
>> regular language isn't a problem, but even for that language you have
>> to hardcode your parser, instead of reusing regular expressions.
>> (Even Delphi programmers do it!)
>
> Most likely a Forth programmer will happily hardcode a special purpose
> parser adapted to the structure of the data, in the same way as he
> would build a special solution adapted to some other problem.

In Forth land programmer does the job of lexer and parser.

How does your statement align with "1x" and other Forth buzzwords?
Hardcoding is called so, because it is _hard_ to code (among others,
it is hard to maintain too, if possible at all, which suits more
"write-only" attribute of Forth).

> I cannot speak from experience here because I do not have any serious
> parsing problems where code size is an issue (usually sed and awk are
> good enough for me).

And when your awk/sed scripts with sh glue code become too slow?
What will you do?

JFYI, one of Google Summer of Code projects this year is
rewriting a set of such sh+awk+sed in C.

>> When it comes to more complex grammars, I start being afraid,
>> that Forth BNF parsers are too unusable even for hardcore
>> Forth hacker. The famous one-screener is purely conceptual ("toy"),
>> I don't remember, if I have ever seen any example of its usage,
>> as for others, I don't remember sample code for it either.
>> To be successful in any field there should be documentation and
>> sample code, or at least the very little sing of code usage.
>> I don't observe any. I may be wrong here, since it's been quite
>> a long time since I checked, but I'm not optimistic.
>> 
>> Maybe, if anyone could point to documentation and sample code
>> for BNF parser, I could try using it again, though I'm not that
>> optimistic.
>> 
>> >> > Then add on top the lack of a de facto library management
standard,
>> >> > and on top of that the fact that for those who only need to do a
>> >> > specific, people with a distinct set of concrete string tasks can
>> >> > solve it from scratch with tools like those in TOOL2002. If that
is
>> >> > auxiliary to their main task, then once its solved, they may
rarely
>> >> > need to revisit it. So instead of investing the time and effort
into
>> >> > learning and importing a general purpose string handling toolkit
and
>> >> > than using 5% of it, they build a much simpler special purpose
string
>> >> > handling toolkit and use 100% of it.
>> >> 
>> >> And thus reinventing the same wheel 100 times, instead of reusing
>> >> the library written once years ago.
>> >
>> > Well, what if it is another wheel each time?
>> 
>> It is even worse. Dealing with a dozen of non-standard kinds of
>> screws is a nightmare, it causes only one and the single wish:
>> to cram all these screws up those engineers' asses.
>
> Who surely will be glad that it is only software.
>
> But I was actually thinking not just of different implementations
> of the same task (along different ways) but instead of implementation
> of different (but specialized) tasks. For this, using some already
> written general library might involve adapting it to the specific
> requirements. The programmer will then try to guess, if this is more
> work than writing a new implementation from scratch.

Have you ever tried to support a collection of the code?
Like that, that comes from various GNU and near-GNU sources.
Many sloppy programmers don't use libraries, they prefer shipping
their own versions. I.e. there're dozens of MD5 implementations,
hundreds of base-64 and UU encoding-decoding routines around.
Sometimes those developers just cut and paste the code.

Now what happens, if one innocent soul finds a bug in the
library of one project, especially if it is design bug.
This bug gets fixed in one or another projects, but stays in
others. Just like broken gene. From now on you can't be sure,
that that bug will never manifest itself.

Maybe the word "anti-pattern" is known to you. Once you find
anti-pattern in your code, and fix several its incarnations,
you become unsure, that you really have found and fixed all of
them, especially when you use archives and import others' code.


-- 
BECHA...
   CKOPO CE3OH...




 43 Posts in Topic:
What's right with FORTH and wrong with c.l.f.
Richard Owlett <rowlet  2008-04-30 16:14:51 
Re: What's right with FORTH and wrong with c.l.f.
mhx@[EMAIL PROTECTED] (M  2008-05-01 00:00:16 
Re: What's right with FORTH and wrong with c.l.f.
mhx@[EMAIL PROTECTED] (M  2008-05-01 10:54:15 
Re: What's right with FORTH and wrong with c.l.f.
Albert van der Horst <  2008-05-01 14:39:26 
Re: What's right with FORTH and wrong with c.l.f.
mhx@[EMAIL PROTECTED] (M  2008-05-01 10:59:29 
Re: What's right with FORTH and wrong with c.l.f.
Albert van der Horst <  2008-05-01 14:31:31 
Re: What's right with FORTH and wrong with c.l.f.
brian.fox@[EMAIL PROTECTE  2008-04-30 18:14:16 
Re: What's right with FORTH and wrong with c.l.f.
Jonah Thomas <jethomas  2008-05-01 02:58:08 
Re: What's right with FORTH and wrong with c.l.f.
"The Beez'" <  2008-05-01 03:51:29 
Re: What's right with FORTH and wrong with c.l.f.
Jonah Thomas <jethomas  2008-05-01 09:57:10 
string concatenation (was: What's right with FORTH ...)
anton@[EMAIL PROTECTED]   2008-05-01 15:28:43 
Re: string concatenation (was: What's right with FORTH ...)
stephenXXX@[EMAIL PROTECT  2008-05-01 22:53:25 
Re: string concatenation (was: What's right with FORTH ...)
anton@[EMAIL PROTECTED]   2008-05-02 19:02:14 
Re: What's right with FORTH and wrong with c.l.f.
John Passaniti <nntp@[  2008-05-01 22:17:22 
Re: What's right with FORTH and wrong with c.l.f.
Albert van der Horst <  2008-05-01 14:57:46 
Re: What's right with FORTH and wrong with c.l.f.
Bruce McFarling <agila  2008-05-01 13:04:35 
Re: What's right with FORTH and wrong with c.l.f.
Jonah Thomas <jethomas  2008-05-01 18:34:31 
Re: What's right with FORTH and wrong with c.l.f.
Dick van Oudheusden <d  2008-05-02 03:07:49 
Re: What's right with FORTH and wrong with c.l.f.
Richard Owlett <rowlet  2008-05-02 15:58:00 
Re: What's right with FORTH and wrong with c.l.f.
Bruce McFarling <agila  2008-05-02 04:51:55 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-02 22:02:30 
Re: What's right with FORTH and wrong with c.l.f.
Marc Olschok <nobody@[  2008-05-02 18:20:38 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-03 09:56:47 
Re: What's right with FORTH and wrong with c.l.f.
Marc Olschok <nobody@[  2008-05-03 20:16:22 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-04 23:59:26 
Re: What's right with FORTH and wrong with c.l.f.
Marc Olschok <nobody@[  2008-05-05 21:45:18 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-07 21:46:15 
Re: What's right with FORTH and wrong with c.l.f.
Marc Olschok <nobody@[  2008-05-12 18:20:59 
Re: What's right with FORTH and wrong with c.l.f.
stephenXXX@[EMAIL PROTECT  2008-05-04 18:46:53 
Re: What's right with FORTH and wrong with c.l.f.
Richard Owlett <rowlet  2008-05-02 16:04:39 
Re: What's right with FORTH and wrong with c.l.f.
Bruce McFarling <agila  2008-05-02 11:45:25 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-03 11:44:38 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-03 11:57:11 
Re: What's right with FORTH and wrong with c.l.f.
Elizabeth D Rather <er  2008-05-03 07:27:16 
Re: What's right with FORTH and wrong with c.l.f.
Aleksej Saushev <asau@  2008-05-04 23:26:57 
Re: What's right with FORTH and wrong with c.l.f.
John Passaniti <nntp@[  2008-05-05 21:41:12 
Re: What's right with FORTH and wrong with c.l.f.
stephenXXX@[EMAIL PROTECT  2008-05-07 10:16:30 
Re: What's right with FORTH and wrong with c.l.f.
Dick van Oudheusden <d  2008-05-04 03:04:44 
Re: What's right with FORTH and wrong with c.l.f.
Bruce McFarling <agila  2008-05-05 16:35:43 
Re: What's right with FORTH and wrong with c.l.f.
astrobe <fdubois76@[EM  2008-05-07 05:08:02 
Re: What's right with FORTH and wrong with c.l.f.
Alex McDonald <blog@[E  2008-05-07 05:56:35 
Re: What's right with FORTH and wrong with c.l.f.
pml540114@[EMAIL PROTECTE  2008-05-15 06:21:25 
Re: What's right with FORTH and wrong with c.l.f.
Jonah Thomas <jethomas  2008-05-15 21:31:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 5:58:57 CDT 2008.