guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Planning work


From: Rob Browning
Subject: Re: Planning work
Date: 12 May 2001 16:23:43 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Keisuke Nishida <address@hidden> writes:

> Right, but we could translate any intermediate representation into
> Scheme code at the codegen phase.

But I want to write the compiler itself in scheme.  I.e. I *want* to
use "car" and "cdr" to traverse my parse tree.

> I, in practice, add some extra slots, like source properties, in this
> structure.  I realized that this representation is easier to work
> with than the ordinary list representation when I was writing a
> Scheme->GHIL translator.

Right, but you can get the same effect by using an annotated parse
tree, or, if you really need something other than lists, goops for
your compilation structures, which should probably still just be
collections of vectors, lists, strings, numbers, etc.

> There is another advantage.  Since structures have distinct data
> types, a compiler may detect type errors at compilation time.  I
> think this is the real advantage, since it eliminates trivial
> errors.

But in some sense, it seems like you can make that same argument to
push for dropping Scheme in favor of a strongly typed language
altogether, and the disadvantage to using a bunch of special-purpose
data types is that you then have to write a bunch of special-purpose
code to manipulate them.  You can't just whip out SRFI-1, or whatever
to mangle your parse tree.

-- 
Rob Browning <address@hidden> PGP=E80E0D04F521A094 532B97F5D64E3930



reply via email to

[Prev in Thread] Current Thread [Next in Thread]