I want to do a Interpreter C, in Squeak

Lex Spoon lex at cc.gatech.edu
Wed Jun 19 18:30:35 UTC 2002


"Jose HG" <josehg1979 at hotmail.com> wrote:
> <html><div style='background-color:'><DIV>
> <P>I want&nbsp; to do a Interpreter of C in squeak. I would like get information about the classes in the categories System-Compiler, VMConstruction-Interpreter or VMConstruction-Translation to C or another that you know, which I could use to implemmenting a Interpreter of C in Squeak.</P>=


The best way to start would be to write an interpreter from scratch. 
Leave the above classes for later, when you become interested in
speeding things up.

Incidentally, the fastest way of all to get started would probably be to
write a MIPS emulator and then to use gcc as your compiler.  You could
even compile gcc itself and then run gcc under your interpreter to
compile more C programs.  MIPS is a pretty simple architecture....

One big warning: there are two flavors of C.  There is ANSI C, which
only guarantees behavior for programs that behave very properly.  Then
there is the C that most programmers are used to, which is much looser. 
An advantage of simulating a typical CPU and then using an existing C
compiler is that the loose programs will just work.  If you follow the
spec literally, on the other hand, then you will be doing a very nice
thing for the world but you will probably have little problems running
most programs.


-Lex



More information about the Squeak-dev mailing list