Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Diego Olivier Fernandez Pons <Diego.FERNANDEZ_PONS@etu.upmc.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Graphmanipulation in Ocaml
Date: Wed, 17 Sep 2003 11:53:05 +0200 (DST)	[thread overview]
Message-ID: <Pine.A41.4.44.0309171053020.1368288-100000@ibm1.cicrp.jussieu.fr> (raw)
In-Reply-To: <Pine.A41.4.44.0309170957500.1368288-100000@ibm1.cicrp.jussieu.fr>

    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


  parent reply	other threads:[~2003-09-17  9:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-01 18:46 Arne Koewing
2003-09-01 20:15 ` Matt Gushee
2003-09-01 20:27   ` [Caml-list] " Arne Koewing
2003-09-01 21:53     ` Matt Gushee
2003-09-02  9:09     ` Martin Jambon
2003-09-03 11:37 ` [Caml-list] " Francisco J. Valverde Albacete
2003-09-16 20:05 ` Gleb N. Semenov
2003-09-16 22:35   ` henridf
2003-09-17 10:52     ` Gleb N. Semenov
2003-09-17  8:29   ` Diego Olivier Fernandez Pons
2003-09-17  8:59     ` Eray Ozkural
2003-09-17  9:53     ` Diego Olivier Fernandez Pons [this message]
2003-09-17 12:18       ` Andreas Rossberg
2003-09-17 18:11     ` Gleb N. Semenov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.A41.4.44.0309171053020.1368288-100000@ibm1.cicrp.jussieu.fr \
    --to=diego.fernandez_pons@etu.upmc.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox