Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] lisp to ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: brogoff <brogoff@s...>
Subject: Re: [Caml-list] lisp to ocaml
On Sun, 18 Sep 2005, Thomas Fischbacher wrote:
> On Sun, 18 Sep 2005, Jon Harrop wrote:
>
> > > You cannot directly compile LISP code to ML code in the sense that
> > > (...)
> > > for a ton of reasons.
>
> > In this case, what else is needed beyond replacing operators with those
> > suitable for a generalised numeric type and constructing numeric literals?
>
> I have to correct my statement:
>
> You cannot compile Common Lisp code to ML code that expresses the same
> idea short of piping it through an intelligent human who is proficient
> with both languages, and can use intelligent judgment to make decisions
> about what "the same idea" is supposed to mean.

That's not surprising, considering that if you substitute SML for Common Lisp
and OCaml for ML, the statement remains true, even though the differences
between languages is far less.

I can't claim to be intelligent, but I'm at least human, and I've done the
experiment.

I translated some small (about 5_000 LOC) programs from SML to OCaml a few
years ago, and while at first I wanted to use CamlP4, in the end I just rolled
up my sleeves and used Andreas Rossberg's side by side table of differences
to refresh my rusty SML. I imagine any nontrivial Lisp code would be harder.
Some Schemes may be easier than Lisp, since there are dialects of Scheme that
are very ML influenced with modules, exceptions, and pattern matching.

-- Brian