lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tuesday 01 February 2005 02.23, skaller wrote:
> On Tue, 2005-02-01 at 05:15, David Olofson wrote:
> > On Monday 31 January 2005 17.15, Mark Hamburg wrote:
> > > Not applicable to Lua without whacking pretty much everything, 
but
> > > Forth is very interesting 
> 
> > That means operations and operands are inherently lists, rather 
than 
> > trees? 
> 
> Forth is Lisp backwards. It uses reverse polish 
> (postfix) notation:
> 
>  1 2 add   -- forth
>  1 + 2     -- C
>  (add 1 2) -- Lisp
> 
> This means the grammar of Forth, like Lisp, is very simple:
> 
>  word = word *
> 
> is the whole of it. This has the property that for any
> sequence of words  you can define a subroutine, 
> and replace the sequence by the subroutine.
> 
> Note Forth is heavily used today..  Postscript IS forth.

So I noticed. (A text editor is of course the obvious tool of choice 
if you want to change the colors of some postscript 
illustrations. ;-)


> The forth execution model is also very simple:
> 
> (a) if it is a number, push it onto the stack
> (b) otherwise execute it

...and here we are, hacking pages and pages of hairy parser code to 
handle our "nice" C-like, Pascal-like and similar languages... :-D


//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---