From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA20830; Wed, 17 Sep 2003 11:53:59 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA19049 for ; Wed, 17 Sep 2003 11:53:57 +0200 (MET DST) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h8H9rvf21130 for ; Wed, 17 Sep 2003 11:53:57 +0200 (MET DST) Received: from ibm3.cicrp.jussieu.fr (ibm3.cicrp.jussieu.fr [134.157.15.3]) by shiva.jussieu.fr (8.12.9/jtpda-5.4) with ESMTP id h8H9rtgR042347 for ; Wed, 17 Sep 2003 11:53:55 +0200 (CEST) Received: from ibm1.cicrp.jussieu.fr (ibm1.cicrp.jussieu.fr [134.157.15.1]) by ibm3.cicrp.jussieu.fr (8.8.8/jtpda/mob-V8) with ESMTP id LAA21760 for ; Wed, 17 Sep 2003 11:53:06 +0200 Received: from localhost (fernande@localhost) by ibm1.cicrp.jussieu.fr (8.8.8/jtpda/mob-v8) with ESMTP id LAA2130130 for ; Wed, 17 Sep 2003 11:53:05 +0200 Date: Wed, 17 Sep 2003 11:53:05 +0200 (DST) From: Diego Olivier Fernandez Pons To: caml-list@inria.fr Subject: Re: [Caml-list] Graphmanipulation in Ocaml In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Antivirus: scanned by sophie at shiva.jussieu.fr X-Loop: caml-list@inria.fr X-Spam: no; 0.00; pons:01 pons:01 etu:99 caml-list:01 non-trivial:01 haskell:01 mlkit:01 erwig:01 bjorner:01 prover:01 type-checked:01 functors:01 generic:01 functors:01 generic:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Bonjour, > Does anyone have experience porting Sml code to Caml ? I would > expect everything is fairly mechanic, or can there be differences > which require non-trivial effort to resolve ? I have some experience porting from Haskell (Edison, Parsec), SML (parts of SML/NJ standard library, parts of MLKit standard library, some code from Erwig FGL and some code from Nikolaj Bjorner which seems to have been used in the stanford temporal prover). Porting is easy and fast. Redesigning is hard and slow. example : SML has (or had) two kind of polymorphic variables 'a and ''a because of the polymorphic comparison problem. The first time you port SML code you just don't care since the resulting Caml code seems to be working fine (the first time I didn't even notice it since I never type-checked the SML code). The problem is that not having a correct polymorphic comparison will lead to several work around according to who wrote the SML code : functors, functions with a comparison function argument, records saving a generic comparison function, etc. And this will give to the whole library a specific 'style' (even if the original problem - whatever it may be - was solved in a next version of the language) There is a very old discussion on the Caml list when the first Set module was released by Xavier Leroy (http://caml.inria.fr/caml-list-ar/0096.html) which gives you an idea of the problems one can face : - 'a ->'a -> int comparison or Smaller | Equal | Greater - functors, polymorphic data structures, objects or records ? - generic or specific ? - public or private constructors ? - dirty imperative but fast tricks or pure and beautiful functional ? And since you are working in Caml you will want your library to have more caracteristic Caml style. There begins the hard part. Conclusion : no really difficult points from SML to Caml (most of the time you just guess what is happening and what to do). You may look at SML vs. Caml (http://www.ps.uni-sb.de/~rossberg/SMLvsOcaml.html) which is a bit out of date with respect to the Caml part (I have asked Andreas Rossberg several times to update it but he does not seem to want to). Diego Olivier ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners