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
Will Deakin <···········@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.
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'.
In article <···············@octagon.mrl.nyu.edu>,
Marco Antoniotti <·······@cs.nyu.edu> wrote:
>
>Will Deakin <···········@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.
····@goldshoe.gte.com (Dorai Sitaram) writes:
> In article <···············@octagon.mrl.nyu.edu>,
> Marco Antoniotti <·······@cs.nyu.edu> wrote:
> >
> >Will Deakin <···········@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.
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.
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'.
In article <···············@octagon.mrl.nyu.edu>,
Marco Antoniotti <·······@cs.nyu.edu> wrote:
>
>····@goldshoe.gte.com (Dorai Sitaram) writes:
>
>> In article <···············@octagon.mrl.nyu.edu>,
>> Marco Antoniotti <·······@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.
"Will Deakin" <···········@hotmail.com> wrote in message
·················@newsreaderg1.core.theplanet.net...
> 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
>
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