Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Scheme -> Common Lisp

3 views
Skip to first unread message

Will Deakin

unread,
Sep 16, 2002, 9:20:16 AM9/16/02
to
I have come accross a quantity of scheme code that I would like to
port to common lisp. Given that it has no major issues (such as the
use of call/cc) are there any mechanical or automatic ways to do this?

:)w

J L Russell

unread,
Sep 16, 2002, 9:32:40 AM9/16/02
to
"Will Deakin" <aniso...@hotmail.com> wrote in message
news:am4lhg$dpg$1...@newsreaderg1.core.theplanet.net...

If you don't need the end product to be particularly readable,
then try Dorai Sitaram's scm2cl:

http://www.ccs.neu.edu/home/dorai/scmxlate/scm2cl.html

-James Russell


Marco Antoniotti

unread,
Sep 16, 2002, 10:38:54 AM9/16/02
to

Will Deakin <aniso...@hotmail.com> writes:

AFAIK there is an untility that translates Scheme into CL. However it
is IMHO sub-par. E.g. the code I saw does a very bad job in translating
things like

(let loop (...) ...)

into CL. It'd be interesting to produce something nicer.

Cheers

--
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488
715 Broadway 10th Floor fax +1 - 212 - 995 4122
New York, NY 10003, USA http://bioinformatics.cat.nyu.edu
"Hello New York! We'll do what we can!"
Bill Murray in `Ghostbusters'.

Dorai Sitaram

unread,
Sep 16, 2002, 11:22:38 AM9/16/02
to
In article <y6cvg56...@octagon.mrl.nyu.edu>,

Marco Antoniotti <mar...@cs.nyu.edu> wrote:
>
>Will Deakin <aniso...@hotmail.com> writes:
>
>> I have come accross a quantity of scheme code that I would like to
>> port to common lisp. Given that it has no major issues (such as the
>> use of call/cc) are there any mechanical or automatic ways to do
>> this?
>
>AFAIK there is an untility that translates Scheme into CL. However it
>is IMHO sub-par. E.g. the code I saw does a very bad job in translating
>things like
>
> (let loop (...) ...)
>
>into CL. It'd be interesting to produce something nicer.

Hopefully, the "nicer" thing is not LABELS, which you
suggested the last time.

Marco Antoniotti

unread,
Sep 16, 2002, 12:02:11 PM9/16/02
to

ds...@goldshoe.gte.com (Dorai Sitaram) writes:

Well. Just adding a NAMED-LET to the supporting CL code would allow
you to rewrite all the

(let loop (...) ...)

to

(named-let loop-%% (...) ...) ; `loop-%%' is an appropriate GENSYM.

This would make the translation far more readable and probably
friendlier to CL compilers.

Of course, NAMED-LET expands into a LABELS.

Dorai Sitaram

unread,
Sep 16, 2002, 2:40:59 PM9/16/02
to
In article <y6c7khl...@octagon.mrl.nyu.edu>,

Marco Antoniotti <mar...@cs.nyu.edu> wrote:
>
>ds...@goldshoe.gte.com (Dorai Sitaram) writes:
>
>> In article <y6cvg56...@octagon.mrl.nyu.edu>,
>> Marco Antoniotti <mar...@cs.nyu.edu> wrote:
>> >
>> >AFAIK there is an untility that translates Scheme into CL. However it
>> >is IMHO sub-par. E.g. the code I saw does a very bad job in translating
>> >things like
>> >
>> > (let loop (...) ...)
>> >
>> >into CL. It'd be interesting to produce something nicer.
>>
>> Hopefully, the "nicer" thing is not LABELS, which you
>> suggested the last time.
>
>Well. Just adding a NAMED-LET to the supporting CL code would allow
>you to rewrite all the
>
> (let loop (...) ...)
>
>to
>
> (named-let loop-%% (...) ...) ; `loop-%%' is an appropriate GENSYM.
>
>This would make the translation far more readable and probably
>friendlier to CL compilers.
>
>Of course, NAMED-LET expands into a LABELS.

I do translate Scheme named LET into an open-coded form
of a (fictitious) Common Lisp NAMED-LET. Since
readability was a non-goal, I used the option of
open-coding whenever convenient.

Unfortunately, from your point of view, my open-coding
of NAMED-LET doesn't always become a LABELS. It does
sometimes, but not for those Scheme named-LETs that I
deem to be pure iterations. Unless the CL standard
suddenly changes, I am not about to negotiate
this aspect of scm2cl away.

If someone wants readable CL output, I believe they
have a choice of Scheme->CL translators, written by
folks who are CL programmers. Understandably, I am
somewhat strongly invested in having scm2cl provide
extremely accurate translations of my own collection of
Scheme packages. It stands to reason that the
Scheme->CL translation genre has a lot of factors one
can optimize on, such as readability, feature coverage,
correctness, robustness, black-box-ness, &c. I can't
hope to solve them all.

0 new messages