FORTH, PASCAL, and C--- which one would you choose (it depends ?)

P Wei wei at princeton.UUCP
Mon Dec 30 14:54:26 AEST 1985


I compared the Eratosthenes sieve benchmark for Lattice C, Microsoft C,
TURBO Pascal and HS/Forth for IBMPC. For 10 iterations, the execution looks
like :
Microsoft C : 13.2 sec   (from pc-tech Jan 1986, p91)
	       8.1 sec   (using register)
Lattice C   : 10.5 sec   (from the same place as above)
TURBO Pascal: 14.1 sec   (from an ad for ZBASIC)
HS/Forth    : 47.0 sec   in interpreter (data from ad)
	       7.0 sec   using code optimizer and improved program
Assembler   :  5.0 sec

Now, the question is :
It seems that Forth is as extensible and structured as C and Pascal (to my
understanding), and generates more compact and faster execution program.
Its interpreter being far more faster than BASIC's makes developement time of a
project much less than when using 'edit-compile-link-test' type of language.
I wonder why Forth is still less popular (to my impression) than C and Pascal.

Is it because :
--its somewhat 'awkward' syntax ? (Pascal is closer to human language)
--its lack of predefined data structure ?
--its putting great responsibilty on the programmer ? (the kernel is so compact
  and simple that you must first extend the system and create many things which
  in C and Pascal are taken care of by the compiler-writer.) In this sense,
  if I compare the simplicity and primitiveness I get:
  Assembly > Forth > C > Pascal (where > means simpler than).
  We know power comes from simplicity, however we must pay price for it.

For C-lovers, do you think UNIX-like (or operating system in the general sense)
can be written in FORTH and possibly has better performance?
For Pascal-lovers, is the 'visually' readability and strongly type the primary
advantage ? and a must ?
For Forth-lovers, do you think Forth is suitable for being used as a
general purpose language instead of the one 'exclusively' designed
for use in the lab and industry to control the machine...

Note: I am not a dedicated C, Pascal or Forth programmer.
HP Wei   (wei at princeton)



More information about the Comp.lang.c mailing list