You should check out OCaml. You can find it at http://caml.inria.fr/
views:
137answers:
3Poly/ML seems to be a little faster than SML/NJ. For example, compiling HaMLet (approx. 25850 lines of commented SML) with Poly/ML, SML/NJ, and MLton, I get the following:
[mtf@fenrir hamlet-1.3.1.polyml]$ /usr/bin/time make with-poly
...
2.92 real 2.31 user 0.55 sys
[mtf@fenrir hamlet-1.3.1.smlnj]$ /usr/bin/time make with-smlnj
...
11.98 real 11.08 user 0.78 sys
[mtf@fenrir hamlet-1.3.1.mlton]$ /usr/bin/time make with-mlton
...
24.51 real 21.04 user 3.05 sys
The difference between Poly/ML and SML/NJ isn't quite as pronounced when compiling MLton (approx. 175779 lines of commented SML):
[mtf@fenrir mlton.polyml]$ /usr/bin/time make polyml-mlton
...
117.67 real 112.12 user 4.87 sys
[mtf@fenrir mlton.smlnj]$ /usr/bin/time make smlnj-mlton
...
123.31 real 116.24 user 6.38 sys
[mtf@fenrir mlton.mlton]$ /usr/bin/time make mlton-compile
...
238.44 real 232.01 user 5.49 sys
As REPLs, Poly/ML and SML/NJ are nearly equivalent. I find the error messages from SML/NJ to be a little bit better; they tend to have more specific source locations. Of course, when used as a REPL, SML/NJ's source locations are in terms of stdIn
, for which line numbers aren't terribly helpful.
If your students are only ever going to use the REPL or compile single-file programs, then I would imagine that either Poly/ML or SML/NJ would serve your purposes. Both provide the SML use
function. Multi-file programs are probably best served by SML/NJ's Compilation Manager or MLton's ML Basis System; Poly/ML provides yet another compilation system (PolyML.make
), but I've never used it.
What difficulties do you have with compiling Poly/ML? Since version 5.0, Poly/ML has supported a simple ./configure ; make ; make install
build. Using Poly/ML 5.X to compile a standalone executable requires using PolyML.export
and invoking a C compiler, but is fairly well described in the version 5.0 release notes.
There's an LLVM port of Moscow ML. I don't know if it's usable for all purposes yet, but with regard to speed it should be better than the old camlrunm.
Maybe it's worth the time for you to port the feature which you think is differs from the code in the documentation. I'm sure the Moscow ML maintainers will appreciate it.
I didn't find a difference in the documentation which comes with Moscow ML and the actual implementation, but I didn't do any big projects in Standard ML. I think it would be helpful if you could give an example where the Moscow ML documentation differs from the implementation. This would also interest me.