Charles Steinkuehler schrieb:
> 
> > some remarks about using forth:
> > - certainly forth is missing all that nice pattern matching
> >   like awk or perl, all this has to be coded.
> 
> Well, "C" is missing these as well, until you load a massive standard
> library :)
> 
> > - I assume that even arrays are not available in forth
> 
> Not as part of the "core" language you'll get with the 10-20K
> interpreter, but you can easily add words to manipulate arrays.

That is correct, but you have to take these points in acoount,
when comparing sizes. You can get a basic interpreter, that
fits in 2k of memory. It has less features than forth but it is
even smaller.

> 
> > - because forth uses very unusual semantics (reverse
> >   polish notation) it is not easy to understand and to
> >   maintain (you have always to keep in mind, what is in
> >   this moment at which position on the stack).
> 
> Like perl makes sense?  I can't read most perl code becuase of all the
> implicit file-handles and data sources...I see the code that modifies
> stuff, but I don't know what it's working on.  Too many $.@/ things for
> me to keep straight.
> 
> Each language has it's idosyncracies...

The most important difficulty with forth is RPN. An example:

func(y/(5+3*x+z), y/6, y*y)

is in RPN

y 5 3 x * + z + / y 6 / y y * func

How long do you need to verify, if the two lines are the same?

y z 5 x 3 * + + / 6 y / y y * func

Is this the same? How long do you need?

Some years ago I have done a lot of postscript programming for
high quality typesetters. Postscript also uses RPN. I think 
I would not have big problems reading forth.

Readability is a question of coding style. In any language you can 
write code that is not easy to understand.

while(<>) print

is the same as

while ($line = <STDIN>)
{
        print $line
}

but the latter is more easily to understand.
It is also a question of experience with the language.
My boss is a experienced C programmer on DOS and embedded systems.
But when he sees a script line like this

[ "$DEBUG" ] && echo `basename "$file"`

he asks me: What the hell are you doing here?

BTW, the most of this $%@... are an implicit type declararion
like in fortran, where all variables starting with [i-n] are
implicit integers.

> 
> > mawk is 49K compressed
> > perl4 is 136k compressed
> 
> AFAIK, neither can do direct linux system calls, and both require
> another apx. 500K (compressed) C library to function.

Both need only libc, which is needed anyway and libm, which is 
38k compressed.
AFAIK web configuration is only manipulation of script and config files.
So I can see no necessity for any system calls, but I may be wrong.

At the moment I have not the time to get involved in this project,
so this is only my opinion and to share available information and
experience.

If someone wants to play around with perl4, I can make the lrp
publicly available. It passes the tests in the makefile and I
tested the server example of the manpage on a bering system.

> 
> Charles Steinkuehler
> [EMAIL PROTECTED]

-- 
Manfred Schuler
E_Mail: mailto:[EMAIL PROTECTED]


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to