From comp.lang.scheme [Re: C to Scheme]

Dave Mason dmason@scs.Ryerson.CA
Sat, 31 May 1997 02:14:42 -0400


Scott L. Burson writes:
> I think this is a little optimistic.  ZETA-C, my C implementation for Lisp
> Machines, took closer to 2 years, full time.  Granted, some of that was spent
> on performance, and on features that go a little outside the normal definition
> of a C implementation (like a C mode for Zmacs and incremental compilation),
> but still, I can tell you it's more than 6 months' work.
> 
> I presume Dave Hanson was starting not from original C source but from a list
> structure representation with C semantics.  That indeed is not very hard.  (He
> also said he skipped structures, which are nontrivial to implement
> compatibly.)  Add a parser with ANSI-compatible preprocessor, etc. etc. and
> the time starts to add up.

It's Dave Mason, not Hanson.

No, I gave them a scanner, it read directly from their C programs (but
with no preprocessor commands).  They didn't have to handle struct,
typedef, union, enum, full-generality l-exps, or precedence, and all
non-function declarations were treated as dynamically typed, and they
only had to handle correct programs.  Getting all those working isn't
too hard in a standalone program - a couple weeks full time.

Getting serious performance, or making it so you could use fread to
read in arrays of structs and have it do the right thing sounds very
hard to me.  Especially to get all the things in this paragraph at
once!  A related problem is that much real-world software doesn't
treat pointers by the book, so if you want to support it all, you need
C-like memory layouts.  If this is the level of compatibility you
want, 2 years sounds a little high, but more realistic.

../Dave