Hacker News new | ask | show | jobs
by hajile 1549 days ago
StandardML vs go is a great illustration.

StandardML is just as fast, is more simple to learn with more simple syntax and basically zero gotchas, has more powerful syntax, has an actually sound type system (which has better generics than the ones proposed in go), does a better job at defining public functionality (via modules), has a better CST model, and many other great features.

The only area where it loses is standard libraries and marketing. Google invested millions into these two things, so people use their decidedly inferior language.

You'll find that pretty much every big language has a big company behind it that threw tons of money at its development.

3 comments

I am learning SML currently (with the book "Elements of ML Programming" by Jeffrey D. Ullman) and I have to say it is quite elegant. I like the pattern matching for functions. Often it is surprising how much shorter functions become, when you pattern match in the signature of the function. Makes me think, that maybe I should think about using pattern matching more in Scheme as well. And that I don't want to miss it in any new language I learn. Of course also the type safety is great. I could imagine writing critical parts of a system using SML.
Do you know how good SML's concurrency story is these days?

I tried http://mlton.org/ConcurrentML but gave up due to lack of time and the state of the documentation.

SML is great as a language, but has terrible tooling and a balkanized ecosystem of incompatible implementations, many of which only support REPL workflows (and these tend to be the implementations used for teaching). These are a far cry from the typical "point a compiler at a build file and go" that developers are used to. Go may be a strictly worse language as a language but still be better for building and distributing applications. SML is also very poorly documented, and it is rarely clear which implementation's documentation you're even reading when you find something on the web, which can often lead to quite a bit of frustration. Go, on the other hand, is extremely well-documented.
SML doesn't have "incompatible" implementations per-se. If you stick with what the standardized language and basis libraries specify, your code will compile everywhere (I don't know of any popular implementation that doesn't support the spec). If you use their proprietary extra features, then portability will naturally go down.

The primary means of developing uses SML/NJ for development and MLton for the final, optimized build. Both use the same Compilation Manager[0] and generally share the same ecosystem so using them together pretty much just works.

[0] https://www.smlnj.org/doc/CM/new.pdf

Your parent acknowledged everything you said in his comment.