Arc Forumnew | comments | leaders | submitlogin
2 points by cchooper 5895 days ago | link | parent

The Stalin Scheme compiler is 33000 lines long. That's an aggressively optimising compiler, so nothing will be much more complicated than that.

To translate something like that 'easily', you'd have to use automatic translation to Arc for most of it. Looking at the code, I think that'll be quite easy, and you'll get say 90% of the code converted that way. That leaves about 3300 lines. So I'm guessing this is of moderate difficulty.



1 point by eds 5894 days ago | link

Do you think this would be a realistic amount of work for one summer?

What about part two (converting the compiler to compile Arc instead)? I suppose I would gain something on an understanding of the operation of the compiler while doing part one, but this seems rather intimidating to me.

And I'm not really sure Stalin is the right compiler to base an Arc in Arc on. (Although I suppose that wasn't really the point of your post.)

Can you suggest any other Scheme compilers I might try to port?

-----

1 point by cchooper 5894 days ago | link

I don't know much about Scheme compilers (or Scheme for that matter, I'm a Lisp guy), so I can't really say.

For the conversion to an Arc compiler, it's similar enough to Scheme that I don't think it'll be a big issue, especially as it's implemented on MzScheme. Quite a few tricky Arc functions are just MzScheme functions under a different name (e.g. threading, I/O stuff). That brings up a point: you really want a compiler for the subset of MzScheme that Arc uses, not Scheme itself (although a Scheme->Arc compiler would be cool too).

Is it too much work for a summer? Depends on what you want to achieve. A completely non-optimising Arc compiler, based on code ripped from other projects, would probably be really easy to implement. Writing a Scheme compiler in one semester is standard coursework on some CS courses. So I guess the important questions are:

1. What good Scheme compilers written in Scheme already exist?

2. How much actually needs to be converted? (Most of the runtime will probably be implemented in C anyway, so no conversion necessary).

3. Given the spread of possible compilers you could convert, do any of them look like a summer's worth of work?

So I'm basically saying: maybe.

-----

1 point by almkglor 5894 days ago | link

I like how Chicken implements Scheme ^^;

-----