LispOS compiler.

Arthur A. Gleckler arthur@martigny.ai.mit.edu
Tue, 18 Nov 1997 14:19:17 -0800 (Pacific Standard Time)


|At 18:44 17/11/97 -0500, mlrilee@erols.com (Mike Rilee) wrote:
|
|>Would it be reasonable to use ANS Forth as a portable
|>back end for a lisp system? What would the advantages
|>and disadvantages be?

Seventeen years ago, a friend and I became enthralled by Forth after reading a series of articles in BYTE magazine (I should say "the old BYTE magazine").  We spent several weeks writing a Forth interpreter together in Z80 assembly language, since we didn't have access to an existing implementation.  After writing several programs using our system, and despite our enthusiasm and excitement, we quickly came to the conclusion that it would be nearly impossible to write readable and maintainable programs in Forth.  The effort required to think in the stack-centric manner Forth required simply wasn't worth the benefits.

Furthermore, writing a compiler to generate code for Forth might have the unfortunate effect of biasing the compiler toward a stack-oriented implementation, which is often not the right approach for a conventional architecture.  It might make it harder to switch to an assembler back end later.

The best results will be achieved by writing everything in Lisp from the beginning.  Cross-language boundaries are nothing but trouble and should be avoided whenever possible.  There are certainly good examples of operating systems written entirely in Lisp.  See, for example, Joe Marshall's paper:

  http://www.eval-apply.com/LispOS/kmachine.htm