Wanted: platform-independent Standard ML

I'm currently taking a PL design class which uses Norman Ramsey's draft textbook, which involves a lot of interpreters written in Standard ML. I can get ML implementations for my desktop machines, but I'd like to find one I could compile for my Zaurus (Linux-based handheld). The catch is that the existing compilers I can find either (a) generate machine code (and don't support ARM) or (b) at build time, require smlnj (which doesn't support ARM).

Moscow ML might be an exception, but camlrun keeps segving during the build process. So, I was hoping that there might be something more portable out there; and I figured this was a good place to ask. Anybody know?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

MLs on Zaurus

The closest thing I've seen that's already built is OCaml, e.g. there's a version here, and I think it's also in the Debian ARM repositories.

Are you building Moscow ML on the Zaurus itself? If so, it might work better if you cross-compile it for ARM, on an ordinary workstation.

Another possibility is to use sml2c, which is supposed to be pretty portable, and SML/NJ compatible. Although it's primarily a compiler of SML to C, there's also an interpreter for it, e.g. here (see 75.sml2c.interp.tar.Z, which includes a manual). BTW, I don't know whether either of the locations I linked to are the latest version. Again, you may have better luck building this by cross-compiling than on the Zaurus itself.

Thanks!

Thanks, I'll look at those. Yes, I am building on the Zaurus, because I've had trouble with cross-compiling interpreters before: when the bootstrap process tries to run the code it's just compiled, it fails, because what it's compiled is for a different CPU. I'll give it a shot, though; since I've got Moscow ML on my desktop, I might be able to tweak the build process to invoke the local version of camlrun.

Swap space

BTW, dumb question, but how much swap space do you have configured on your Zaurus? I would think the most likely reason for failure to build would simply be running out of memory. Still, I'd try cross-compiling first.

Swap space

Let's see...none. It's got about 32M of RAM free, though.

It's not gcc that crashes during the build process, it's camlrunm. I just finished cross-compiling, and now I get segvs when trying to run mosml[c]. I'll keep trying.

In addition...

In addition, you may want to look at the camlp4 syntax extension for OCaml, pa_sml, which may allow you to keep much of the SML syntax from the book. It's part of the standard distribution.

I've never used it myself, so I don't know how complete it is, but it might be worth an investigation on your part...

-30-

Worth a shot

Thanks! Having something close to SML would let me get some work done on my commute (2 hours a day on the train), and then iron out the bugs when I get to a desktop machine.