7 ms·
The History of Standard ML [audio]
- eatonphil 5y agoAs always, there's a good group of folks on reddit.com/r/sml and StackOverflow is surprisingly active as well (maybe due to the number of students still using Standard ML). There may be some good IRC channels but I'm not as familiar with them. For a recap of the current state of Standard ML (also surprisingly active), here's a roundup from last year: https://notes.eatonphil.com/standard-ml-in-2020.html https://notes.eatonphil.com/standard-ml-in-2020.html.
- hajile 5y agoStandardML 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.
- Athas 5y ago> 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).
- c-cube 5y agoI 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.
- wirrbel 5y agoI'd say we'll see a Rust-with-GC language fairly soon which will be gravitating towards SML/OCAML with today's syntactic expectations.
- juanramos 5y agoWhat are your thoughts about Gleam lang? Don't you think it covers those conditions?
- wirrbel 5y agoIt 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).
- pjmlp 5y agoYou can already pick up Haskell, Swift, OCaml or F# for that purpose, no need for yet another language.
- hajile 5y agoSuccessorML 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.
- erk__ 5y agoUniversity 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 https://github.com/diku-dk/smlpkg
- wbl 5y agoThere is no parallel CML runtime last I checked, with ongoing research at Chicago into one not having produced yet.
- deleted 5y ago[deleted]
- Zababa 5y ago> 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.
- skohan 5y agoWhat advantages does the approach to threading have over Go channels?
- shpongled 5y agoI'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!
- Syzygies 5y agoNew functional languages emphasize current research, such as dependent types or algebraic effects, as if the best of the past has naturally been saved. Sometimes the best of the past gets forgotten. I loved SML; a language designer would do well to internalize its module signature design. One wants to do at least this well, while incorporating current ideas.
- JoelMcCracken 5y agoI personally want to use SML as a base to develop a new language, one which eschew's side effects. Personally I think such a thing would be 100x more approachable than Haskell for newcomers, and could provide a basis for pure functional programming to make a significant impact on the industry. The main thing that SML brings to the table IMO is its definition. This specifically forces things to be well-defined, and hence well-thought-out, and thus prevents the adding of a bunch of bad features that later need to be maintained for the lifetime of the language. There are many areas in which I think formal methods are overkill, but PLs are one of the exceptions. Any mistakes early on in the language are usually VERY hard to resolve.
- Zababa 5y agoI'm curious about how your new language would work. From my (limited) understanding, the big differences between Haskell and SML are the type system and stictness/lazyness. I think a Haskell-like type system would be necessary if you want to eschew side effects (although I may be wrong), so the big difference would be that it's strict?
- Athas 5y agoIf you took SML and removed reference cells and the parts of the standard library that involve IO, then you'd have a pure language (depending on whether you consider exceptions to be effects). It would not be useful for application programming, but would be fine for teaching functional programming.
- Zababa 5y agoThat's true. I think it also ties into best practices such as hexagonal architecture, DDD, and the "functional core, imperative shell" idea. You design the core of your program as data and pure functions, and then call that part from parts of the program that use IO. Maybe something like when scheme is used for teaching could work, with different "language levels", where some part disallow IO and reference cells. Or maybe a different file extension that's checked by the compiler to be pure. This could be a great way to teach functional programming but also software engineering.