caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Norman Scaife <Norman.Scaife@imag.fr>
To: "Andreas Rossberg" <AndreasRossberg@web.de>
Cc: <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] SML->OCaml
Date: Fri, 11 Mar 2005 09:31:45 +0100	[thread overview]
Message-ID: <16945.22385.991680.667020@imag.fr> (raw)
In-Reply-To: <006101c52431$cc45efa0$14b2a8c0@wiko>

Hi,

    >> Can you recommend any SML frontend that I could, more or less trivially,
    >> use to systematically munge uppercase identifier names and spit out the
    >> program again?

    Andreas> Nothing I'd dare to call trivial. If you don't mind the plug, I
    Andreas> wrote a model interpreter for SML (http://www.ps.uni-sb.de/hamlet)
    Andreas> that has been tuned for readability and modularity and ripping off
    Andreas> binding analysis should be easier than with any other compiler. It
    Andreas> still won't be one hour's task to make such a tool from it,
    Andreas> particularly if you want to maintain the layout of the original
    Andreas> program. But I don't know anything simpler either.

I'm not sure if this is of any help but about 9 (sic) years ago I
wrote a translator for SML to OCaml based on the MK Kit (Version
2). It was intended to provide smaller binaries for SML programs on
(then limited-memory) parallel machines. It is not source-to-source,
in fact it generates Core SML in OCaml form with some minor cosmetic
transformations on the output (eg. ((op ::) (1,((op ::) (2,nil)))) ==>
[1,2]). I've sort of thought about converting it into Hamlet (which I
believe was originally based on the ML Kit) but that's too
daunting. However, If anybody wants to tackle the problem I could send
the AST traversal code (about 2000 lines SML for decs, 700 lines for
topdecs). This is old code, however, and is not too clever with some
aspects of the translation, for instance records are not properly
converted. Alternatively, I can generate a binary for just the
translator (it's part of a transformational compiler) but this adds a
whole load of extra "junk" to the output, for instance it bootstraps
the SML prelude on the OCaml side. It also needs a whole load of
support files such as the type signatures of SML Basis functions.

Regards,
Norman Scaife.


  reply	other threads:[~2005-03-11  8:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-08 18:17 Harrison, John R
2005-03-08 22:54 ` Andreas Rossberg
2005-03-11  8:31   ` Norman Scaife [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-03-07  2:14 Harrison, John R
2005-03-07 21:39 ` Martin Jambon
2005-03-08  9:11   ` Andreas Rossberg
2005-03-06 20:03 SML->OCaml Konstantine Arkoudas
2005-03-06 22:15 ` [Caml-list] SML->OCaml Martin Jambon

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=16945.22385.991680.667020@imag.fr \
    --to=norman.scaife@imag.fr \
    --cc=AndreasRossberg@web.de \
    --cc=caml-list@yquem.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;
as well as URLs for NNTP newsgroup(s).