Arc Forumnew | comments | leaders | submitlogin
4 points by sacado 6091 days ago | link | parent

"Possibly sacado's Psyco for Arc (http://arclanguage.org/item?id=5162), if sacado is willing to let someone else work on it." Sure, if you want to work on that, you're welcome ! ;)

In the same vein as your first idea, an Arc compiler to native code (C, asm, JVM, LLVM, ...) written in Arc would be a great idea... We would then have a bootstrapped interpreter/compiler...



2 points by eds 6090 days ago | link

An Arc native code compiler would be very nice, but unfortunately I don't really know anything about compiler implementation. So for me it would probably too long a haul for one summer.

Still thinking about Arc Psyco... or a CL implementation of Arc....

-----

1 point by sacado 6090 days ago | link

Then I vote for Psyco :) !

Seriously, I think a CL implementation would be a good thing to have, so as to have access to all the CL library and world, but that would also mean having a somewhat competing implementation, and I'm not abig fan of that. Mainly because time spent on maintaining this implementation is not time spent on the "canonical" one.

But that's just my opinion and the CL implementation could be very valuable to others around here... And maybe a fully compatible CL Arc is possible (I mean one where you run your "canonical" Arc code unmodified, what ever this arc code is, should it deal with hard things to port such as FFI or ccc...), I don't know...

-----

1 point by eds 6090 days ago | link

How would one go about dealing with ccc in a CL implementation of Arc? (Isn't this the biggest difficultly with writing a version of Arc in CL?)

-----

3 points by almkglor 6090 days ago | link

I think pg's On Lisp contains some samples on transforming code to continuation passing style, which would allow us to create ccc. It would also mean bashing the code quite a bit, and CL doesn't necessarily optimize functions that are passed around and called in tail position, unlike Scheme which requires such to be optimize.

-----

1 point by sacado 6090 days ago | link

Yes, it is not required by the norm, but as far as I know, ACL, SBCL, CMUCL and CLisp all implement tail call optimizations (for the latter, only on compiled functions though). Maybe that could be considered enough to rely on it.

-----

1 point by eds 6090 days ago | link

Perhaps I'll have to go back and read that part of On Lisp some time. (I stopped after mvdo because the macros were hurting my head. But perhaps I've developed a thicker skin since then.)

-----

2 points by kens1 6090 days ago | link

Peter Norvig has a simple Scheme interpreter (tail recursive, with call/cc) implemented in Common Lisp at http://norvig.com/paip/README.html - it would probably be a reasonable basis. One option would be to implement Scheme in Common Lisp, and then simply run the existing Arc ac.scm on top of that. But it would probably make more sense to cut out the middle layer and modify Norvig's code to run Arc instead of Scheme.

-----

2 points by almkglor 6090 days ago | link

Go Arc!Psyco !!

-----