News for hackers. Stuff that matters.
Re:The History of Standard ML [audio] by hajile on Tuesday July 13, 2021 @09:53AM (#27820978)
StandardML is a very underrated language that was decades ahead of its time.

It's the pragmatic ML. Unlike Haskell, it believes in side effects, optional mutation, and eager evaluation, but within a type system that is much more sound than the ones used in any of the most common languages.

It was designed with students and student implementors in mind, so is quite easy to learn (and implement). Despite this, it has the potential to be very fast with MLton compiling fast code (I'd say about as fast as golang).

It's also interesting in being pretty much the only unpopular language with very good threading support. Perhaps this is due to academic use, but CML (or PolyML's version) are very powerful, but decently easy to use (and I'd consider them a straight upgrade from golang's version of channels).

If a major company invested in the SML ecosystem, it would take over the programming world.

Re:The History of Standard ML [audio] by Athas on Tuesday July 13, 2021 @10:03AM (#27821102)
> If a major company invested in the SML ecosystem, it would take over the programming world.

I like SML both out of nostalgia and for its actual merits, but I don't think that's true. SML was far ahead of its time, but it's showing its age now. Its simplicity is also correlated with an absence of handy features (e.g. ad-hoc polymorphism). Many companies invest in OCaml, which is slightly more crufty but with a (much) more healthy ecosystem, yet it hasn't taken over the world.

I do wonder what would have happened if SML had "won". In many ways it was pragmatically engineered in the early 90s, at a time where no other functional language was comparable (except maybe Caml). Its much-vaunted formal specification does leave a few pragmatics-shaped holes, however. For example, SML has no standardised way of splitting programs into multiple files. Each compiler does their own thing (although at least MLton and MLKit both support MLB files).

Re:The History of Standard ML [audio] by c-cube on Tuesday July 13, 2021 @10:31AM (#27821435)
I think it's a pity that SML didn't take over the world, but these days, as an OCaml user, I'd rather see OCaml gain popularity. OCaml now is a lot more advanced and "modern", I think — GADTs, first class modules, etc. and there's a good LSP server, build system, and package manager.
Re:The History of Standard ML [audio] by hajile on Tuesday July 13, 2021 @04:37PM (#27825998)
SuccessorML is an ongoing work in progress. It looks to add (among other things) misc syntactic niceties (beginning | in matches, string interpolation, do notation, etc), builtin unicode support, and modular type classes for ad-hoc polymorphism (hopefully somewhat discouraging Haskell's typeclass soup).

We haven't hit the limits of what the language is capable of and a major investment would drastically speed up the process.

Re:The History of Standard ML [audio] by wirrbel on Tuesday July 13, 2021 @02:29PM (#27824413)
I'd say we'll see a Rust-with-GC language fairly soon which will be gravitating towards SML/OCAML with today's syntactic expectations.
Re:The History of Standard ML [audio] by pjmlp on Wednesday July 14, 2021 @01:36AM (#27830024)
You can already pick up Haskell, Swift, OCaml or F# for that purpose, no need for yet another language.
Re:The History of Standard ML [audio] by juanramos on Tuesday July 13, 2021 @02:41PM (#27824558)
What are your thoughts about Gleam lang? Don't you think it covers those conditions?
Re:The History of Standard ML [audio] by wirrbel on Tuesday July 13, 2021 @04:16PM (#27825750)
It runs on top of Erlang if I see this right which isn't quite what I personally would be looking for (rust or MLTon, OCAML compile to native code).
Re:The History of Standard ML [audio] by erk__ on Wednesday July 14, 2021 @06:31AM (#27831533)
University Of Copenhagen who previously used SML for introductory programming courses (Now uses F#) have made a package manager for SML modules with MLB files: https://github.com/diku-dk/smlpkg
Re:The History of Standard ML [audio] by Zababa on Tuesday July 13, 2021 @11:08AM (#27821920)
> If a major company invested in the SML ecosystem, it would take over the programming world.

I agree. I think about this a lot, and the hard part is that you need to either have an already existing ecosystem, or to have the resources to build one. If you want to leverage an existing ecosystem, the best bet would be Go I think, as .Net already has F#, Java has Scala (they are not the same but too close and would eat each other), JS has TS, some OCaml, Purescript. The other option could be to have an easy interop with Rust, as it's becoming quite big too, and perhaps fits SML more.

Re:The History of Standard ML [audio] by shpongled on Tuesday July 13, 2021 @02:26PM (#27824368)
I'm a big fan of SML as well (I worked on a hobby compiler for SML, and I've written some programs in it).

Investing in the ecosystem (tooling, VSCode support, packages) would vastly improve it, but it still has some warts compared to Haskell - no ability to auto derive implementations (like debugging/printing structures!), and lack of typeclasses can be painful at times.

I really like Rust because of how similar it is to what I believe SML could be - just take away ownership and change the syntax, and bam!

Re:The History of Standard ML [audio] by wbl on Tuesday July 13, 2021 @10:34AM (#27821462)
There is no parallel CML runtime last I checked, with ongoing research at Chicago into one not having produced yet.
Re:The History of Standard ML [audio] by skohan on Tuesday July 13, 2021 @12:52PM (#27823251)
What advantages does the approach to threading have over Go channels?