From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 174BFBB9C for ; Sun, 18 Sep 2005 19:10:26 +0200 (CEST) Received: from mail23.sea5.speakeasy.net (mail23.sea5.speakeasy.net [69.17.117.25]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j8IHAN8Q010500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 18 Sep 2005 19:10:25 +0200 Received: (qmail 2938 invoked from network); 18 Sep 2005 17:10:22 -0000 Received: from shell2.sea5.speakeasy.net ([69.17.116.3]) (envelope-sender ) by mail23.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 18 Sep 2005 17:10:22 -0000 Date: Sun, 18 Sep 2005 10:10:22 -0700 (PDT) From: brogoff To: Thomas Fischbacher Cc: Jon Harrop , caml-list@yquem.inria.fr Subject: Re: [Caml-list] lisp to ocaml In-Reply-To: Message-ID: References: <200509181644.58661.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 432D9F7F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 replacing:01 literals:01 surprising:01 sml:01 ocaml:01 translated:01 sml:01 2005,:98 2005,:98 ...:98 wrote:01 wrote:01 compile:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=SPF_SOFTFAIL autolearn=disabled version=3.0.3 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