Project list

Paul Prescod papresco@calum.csclub.uwaterloo.ca
Sat, 03 May 1997 15:00:12 -0400


Jordan Henderson wrote:
> One other project that might be started would be a C->Lisp compiler
> project.  Here are a few goals I think might be beneficial for this
> project.

Ugh. My gut feeling is that this code is going to be slow. C's execution
model is very different from Lisp's, and constructs that run quickly on
C will run slowly on Lisp and vice versa. If you radically change the
code so that it is optimized for Lisp compilation then it will become
unmaintable. Even if you DON'T change the code it will probably be a
pain to maintain because it will not be idiomatic C code.

It seems much easier to me to just implement a C++ compiler on LispOS.
On any modern processor the C/C++ program can be firewalled from the
Java stuff and the operating system can be emulated through a set of
exported APIs. Those APIs must be exported regardless of whether you
convert to Lisp or compile directly from C++ to binary.

>         * Produce maintainable Lisp from the compiler.
> 
>           The idea will be to compile the C code once and throw it
>           away.  It will translate all comments into Lisp comments
>           (perhaps even keeping the original C as comments).  My
>           hope is that this will allow increased focus to the
>           project as a whole.  I'm sympathetic to the guy who wants
>           to be able to use his TeX docs in the new OS, but I don't
>           want to spend a lot of resources supporting C programming
>           tools.

Supporting C programming tools is trivial. They are already implemented:
GNU has a compiler for most interesting processors. The difficult thing
is implenting support for the Unix API. That's what the Cygnus Win32
project is all about. That must be done whether you convert the code to
Lisp or not. If a C++ program executes a fork() and that gets translated
into a Lisp (fork), there still has to be an emulation of fork lying
around so that the function call DOES something.
 
 Paul Prescod