DMD 1.005 release

Andreas Kochenburger akk at nospam.org
Wed Feb 7 11:39:34 PST 2007


janderson wrote:
> I'm not familiar with forth.  Can you provide some examples?  Does it 
> allow partial macro definitions.  Can you apply string operations on 
> them at compile time?

Forth is not a traditional compiler that generates executables from 
source files. A Forth system includes a built-in interpreter and 
compiler (and most systems have an assembler too).

Source definitions are compiled and linked to the internal dictionary 
i.e. you extend the system itself. You can not only create application 
programms, but you can also easily add new features to the compiler e.g. 
new compiler commands.

Macro functions at compile-time are only a small exercise for a Forth 
programmer. You mark the last defined function IMMEDIATE, and the next 
time the function is used it is executed _at_compile-time_ !

Please note, Forth and D are playing in different leagues. But you don't 
always have large object-oriented applications. For the more "bare 
metal" stuff Forth is flexibler than D. If you never had contact with 
Forth you will probably find it rather strange: it is a stack-based 
language and uses post-fix annotation like HP calculators.

Andreas



More information about the Digitalmars-d-announce mailing list