Thursday 11 June 2009

How To Install Standard ML On OS X

If you are an OS X user, the most convenient way to install Standard ML is to install MacPorts. Once you have MacPorts up and running, you have the choice of installing Moscow ML, Poly/ML or Standard ML of New Jersey.

I really don't know which one is "better", not because "they all have their own strengths and weaknesses", but because I am a clueless newbie.

But as a clueless newbie here is one of the first differences between these three implementations that I ran into.



Using Pi.


Yes, you could
  1. type it in by hand
  2. have your ML system calculate it for you
  3. or use the default value that comes with your ML.

Here's how you'd access Pi on Moscow ML:
Oh:~ noes$ mosml
Moscow ML version 2.01 (January 2004)
Enter `quit();' to quit.
- Math.pi;
! Toplevel input:
! Math.pi;
! ^^^^^^^
! Cannot access unit Math before it has been loaded.
- load "Math";
> val it = () : unit
- Math.pi;
> val it = 3.14159265359 : real
Next up, Poly/ML!
Om:~ nomnom$ poly
Poly/ML 5.2 Release
> Math.pi;
val it = 3.141592654 : Real.Math.real
… and Poly soundly trounces Moscow*! What a high bar for SML/NJ! Let's see what she can do:
Pinku:~ bentobox$ sml
Standard ML of New Jersey v110.68 [built: Mon Feb 23 23:22:21 2009]
- Math.pi;
[autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[autoloading done]
val it = 3.14159265359 : real
My conservative opinion is that in the long run we are all dead this "comparison" will mean nothing. Caveat emptor: do your own research, choose your system based upon this "comparison" upon your mortal peril. <insert ominous music here />

*in terms of convenience

No comments: