1. Re: euForth
Noah Smith wondered:
> what is Forth, and why is there so much porting of it?
Forth is a TIL - Threaded Interpreted Language. The Forth version of:
function foo( integer x )
bar()
grill()
return x + 1
end function
would look something like this (stuff in parenthesis are comments):
: foo ( n - n ) bar grill +1 ;
and compile to something like this:
[ call bar ] [ call grill ] [ call +1 ] [ return ]
Forth is an RPN (reverse polish notation) stack-based language (HP
calculators are always mentioned at this point). The selling points of Forth
are:
- small footprint
- fast
- interpreted
- extensible
- talks to hardware well
- easy to mix Forth and assembly
- relatively easy to port to new hardware
- forth is the language, os and editor
- can do real clever stuff
In addition to being able to extend the language with new routines, you can
also extend the language by writing your own constructs, like
CASE..OFCASE..ENDCASE.
The disadvantages of Forth include:
- extensible = nonstandard
- rpn not humanly readable
- doesn't hide hardware from you
- easy to blow the stack
- text-only
- 64K memory model
- scaling is difficult
- stacks are inefficient
- threading is inefficient
- forth is the language, os and editor
- can do real clever stuff
- standards groups
- forward declarations are a pain (like Euphoria)
- not mainstream language
- crummy memory management
There are a lot of parallels between Forth and Euphoria, and a Euphoria to
Forth converter might be a good match.
-- David Cuny