>>The zeitgeist works in mysterious ways...
> Ain't it the truth, Robin!? For instance, it's pretty obvious that
> Forth and C were invented primarily to solve one and the same problem,
> which was to transform the archaic, lugubrious human-oriented syntax of
> the then-extant languages into a more machine-oriented, low-level
> compromise syntax
True for Forth. But the syntax of C is not simple, just succinct. "{" and
"}" happen to be -shorter- then "BEGIN" and "END" but they play the same kind
of syntactic role. Actually the syntax of C is, from the point of view of the
compiler-writer (and this point of view has some claim to being -objective-)
is unpleasantly -more- complex than that of Pascal, namely that in the
declaration of a variable, there is no connected bit of text which is the
-type- of the variable. E.g. in
int A[6];
A is a vector of 6 integers, but the type information straddles the
identifier. In this respect, C makes the -wrong- extension of the syntax of
Algol 60/CPL and Pascal makes the right one.
Despite this, I happen, as a user, to -like- the syntax of C, so much so that
I have considered doing a version of POP with a C flavour.
What C and Forth do is in fact provide a suitably low-level -semantic-
view of the machine. As such they provide useful -target languages- for
higher level languages, as does the Poplog Virtual Machine, but at a higher
level (that is you are discouraged from seeing raw store). I have made a
little table comparing these:
GC = built-in garbage collector (this may or may not be a bonus - e.g. the
Glasgow Haskell compiler has its own ideas about tags and garbage which can
be matched by Poplog at a modest cost). INC = Incremental
definition/redefinition of program.
Code Speed Availability Price Size GC INC
-----------------------------------------------------------------------------
C excellent near-universal cheap Modest no no
Poplog VM good but Unix&VMS - most expensive Big yes yes
poor floats major architectures
Forth poor? cheap? Modest? no yes
Now, there are various gaps to close. How good can Forth code be made? Is
a built in garbage collector desirable?
Robin Popplestone.
|