Programming in Standard ML (2011) [pdf]
cs.cmu.edu
cs.cmu.edu
For those interested in parallel, functional programming, I recommend taking a look at Futhark, which leverages data parallelism to make very fast parallel programs. It is based on SML, and has similar syntax, but can automatically build programs that (among other targets) run on the GPU using CUDA or OpenCL. It is also worth checking out MPL, which extends the (already awesome) whole-program optimizing compiler MLton to add support for nested, fork-join parallelism.
There’s also https://smlhelp.github.io/book/ which is mostly put together by current/past CMU students.
Note: I made Millet.
For something truly mind bending, try understanding this implementation of printf in SML: http://mlton.org/Printf
Compared to other functional langauges, it doesn't seem as popular.
is a very strange English sentence to write. It actually sounds like the very famous opening line of Julius Caesar's "Commentary on the Gallic War" (which is prescribed as a model of Latin composition)
"All Gaul is divided into three parts..."
[1] https://en.wikisource.org/wiki/Commentaries_on_the_Gallic_Wa...
Which one you learn should depend on what you plan to use it for! I'm partial to SML. Then again, I've only written a handful of real-world programs with it.
Strangely I think SML focus on being well defined and tidy is why it never really took off. A language success is linked to its community and your features define who will want to join you. It seems to me that at the beginning it’s better to attract tinkerers than perfectionists.
That statement needs some evidence.
> a lot more functionalities
Past a certain minimal threshold of needed functionality, I prefer a language not to have a couple good features than to have a really bad one, like implementation inheritance, particularly multiple inheritance.
Back when I was more into looking at this kind of thing (uh, 20 years ago?) I wrote a few simple programs in SML/NJ and far preferred its syntax to OCaml. But even back then, OCaml had more dev community momentum. (Actually Haskell seemed to have even more momentum but I never ever found it readable or comprehensible as a mere mortal.)
At the time for what I was doing, I really wanted... SML but without a garbage collector, operating for systems level programming. And so I was excited when Graydon Hoare started what became Rust. Which is what I prefer to work in these days.
Still, if I wanted a language for higher level development, I really would prefer to reach for something in the ML family of languages, they are just very expressive. But I wouldn't do this for paid employment work, too esoteric. Maybe that will change a bit now that Rust has brought some concepts and syntax from ML to the mainstream.
Can anyone say which implementation specifically?
SML has multiple, mostly independent implementations with different characteristics. Poly/ML had multi-processor support well before OCaml. But OCaml development is certainly much more active.
Ahh why?! Scala is FP larping as OOP. Great type system, poor syntax.
$ sudo apt install smlnj
$ sml
Standard ML of New Jersey v110.79 [built: Sat Oct 26 12:27:04 2019]
-
and you can hit the ground running.$ file /usr/lib/smlnj/bin/.run/run.x86-linux /usr/lib/smlnj/bin/.run/run.x86-linux: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=b5e686ed7f390da7dfe58f0227cec46fd0e4fb95, for GNU/Linux 3.2.0, stripped
Debian hasn't packaged the 64-bit port of smlnj yet (in 110.94 and later). Both polyml and mlton have amd64 support, though.
Instead I looked for a book for beginners in Standard ML and found "Elements of ML Programming" to be quite good.
I use OCaml over SML these days although I've always thought that SML had slightly nicer syntax.