Arc Forumnew | comments | leaders | submitlogin
1 point by eds 5873 days ago | link | parent

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 5873 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 5873 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 5873 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 5873 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.

-----