Is there a Scheme implementation in CL

Discussion of Common Lisp
Post Reply
schoppenhauer
Posts: 99
Joined: Sat Jul 26, 2008 2:30 pm
Location: Germany
Contact:

Is there a Scheme implementation in CL

Post by schoppenhauer » Sat Apr 16, 2011 6:18 pm

Hello.

Is there any Scheme implementation in CL? I am looking for one since quite a lot of time now, since I have some code that must be written in r5rs-scheme, but would like to use it under CL too. Writing an r5rs-compatible scheme to integrate it in common lisp should not be that hard, since as far as I see the main differences appear to be continuations and lisp-1 vs. lisp-2 (and actually, I do not even need continuations), so as far as I see this should be mostly possible by a simple macro taking s-expressions and converting them to common lisp.

I could start writing on such a thing, but to avoid the lisp curse, Is there anything like this yet?
Sorry for my bad english.
Visit my blog http://blog.uxul.de/

nuntius
Posts: 538
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA

Re: Is there a Scheme implementation in CL

Post by nuntius » Sat Apr 16, 2011 6:47 pm

Don't let the "lisp curse" spook you. The same thing happens in any language. Racket, and to an extent the Scheme standardization group, have been largely immune to it. Even in Common Lisp, the main thing keeping us from forming large successful projects is the relatively small community with relatively wide interests. Look at Forth and Ada and Fortran and ... When "the fad" passes a language, it can be hard to build momentum.

Back to your main question: I have seen people work on such a thing, and almost remember a fairly complete implementation, but the general consensus seems to be that its not really beneficial. Ostensibly you would want a Scheme in CL for code interop; but the two languages are sufficiently different that it is not really practical. CL doesn't have guaranteed tail-call recursion and a couple related features. Scheme doesn't have VALUES and has the single namespace for functions and values. ...

vsedach
Posts: 8
Joined: Wed Dec 17, 2008 1:59 pm
Location: Montreal, QC, CA
Contact:

Re: Is there a Scheme implementation in CL

Post by vsedach » Wed Apr 20, 2011 11:08 am

There are two R4RS implementations in Common Lisp:

http://mumble.net/~jar/pseudoscheme/

http://www.cs.cmu.edu/afs/cs/project/ai ... e88/0.html

(Found at http://www.cliki.net/Scheme - if you know of any others, add them to the Scheme topic on CLiki)

You can get a Scheme implementation running in CL fairly easily, but as nuntius mentioned there will still be interoperability problems between the two languages. And they're not even anything complicated like tail recursion - just the fact that Scheme distinguishes #f from nil means that in practice you will have to write an FFI layer for all your functions that understands how they use data types, much like you would do for calling in/out to C.

Post Reply