Re: Is Forth suitable for writing compilers?



In article <20090330003505.136e6ad3.jethomas5@xxxxxxxxx>,
Jonah Thomas <jethomas5@xxxxxxxxx> wrote:
<SNIP>

Forth-like languages are designed to make it easier to do one-pass
compilation without backtracking etc. By accepting some limitations on
syntax you make the compiler design much simpler, and the people who get
used to your syntax won't mind at all.

I have made a classical two pass assembler with labels from my
Forth assembler. This requires carnal knowledge of a Forth and
some creativity. Then it can be done with dozen definitions
and two dozen lines of comment.


If you want complexities of syntax that Forth doesn't provide, then you
need extra complexities in your compiler design too.

Of course. But it is limited, Forth is surprisingly flexible.

Groetjes Albert.

--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

.



Relevant Pages

  • Re: Handling error/status messages by interface to C++ programs
    ... about how to design a compiler, please tell me where I can find ... exceptions for managing the error detection is rather a bad idea. ... I have to say I have seen a simple example of an object-oriented parser design in some book (unfortunately I forgot ... It would trigger user notification and do recover housekeeping like reseting the current syntax row's token stack because one wants to continue parsing and detect any other errors w/o aborting. ...
    (comp.object)
  • Re: CASE...ENCASE Query...
    ... Once you've got one compiler and semantic checker, ... A 'syntax and semantic checker' designed ... for use at the 'compilation' stage will have very different design ...
    (comp.sys.acorn.programmer)
  • Re: How to test if an enum is inside a set
    ... > not how it is designed to be easy for the compiler ... compiler design. ... that delphi doesn't allow you to write something like this ... Perfectly valid syntax in C/C++. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Equals Operator
    ... Much of the syntax is taken from C/C++ design. ... compiler. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: why still use C?
    ... OOP in general tends to be slower. ... As if the compiler didn't know... ... > their associated method functions from a design perspective. ... as a language design I feel it has failed. ...
    (comp.lang.c)