5 ms·
Standard ML is almost the perfect language—functional-first without all the heavyweight and seemingly endlessly proliferating categorical abstractions which kee
by voidhorse 7y ago
Standard ML is almost the perfect language—functional-first without all the heavyweight and seemingly endlessly proliferating categorical abstractions which keeps the level of knowledege one needs to be productive low. Plus it’s easy to drop into old school imperative code when needed.
The only thing holdong sml back in my eyes is somewhat clunky syntax and the module system—which is great at first but quickly becomes tricky once you start having to use functors.
A modern, reimagined sml that keeps its core while adopting some of the nicer syntactic improvements from other langs in the family and improving the module system would be a god send
- mhd 7y agoIsn't the simplicity of SML one of its strengths, even Ocaml being more complex? If you're going for more sugar, F# might fit the bill. Can handle shebangs, too.
- brudgers 7y agoIf you like SML, it might be worth trying Erlang. It comes out of a telecom company, too. The mechanical sympathy I love in SML, I find in Erlang. The ideas that seeded SML, seem to have have found more fertile ground at Ericsson where they still thrive. YMMV.
- akavel 7y agoErlang has dynamic typing, no? Static typing is especially what interests me in SML, and it's a such core thing, I'm kinda honestly confused what's similar between SML and Erlang?? (I don't know either of them well, so I'd be really interested to learn about some deep similarities from experienced people.)
- lliamander 7y agoErlang supports gradual typing with type specs and dialyzer. It's not as strong of a type system as ML, but it's pretty handy and not particularly cumbersome.
- dvlsg 7y agoI think it's still fairly young, but Gleam is an ML family language that works with the BEAM. Specifically, it compiles to erlang.
- brudgers 7y agoBoth languages were designed with a similar audience in mind. Engineers who write programs incidental to engineering in another discipline. Telcom engineers in both cases.
- the_af 7y agoOut of curiosity, what did you find clunky about the syntax? I think languages in the ML family have quite simple and minimal syntax.
- saityi 7y agoThe only thing I find clunky about SML syntax are infix operators, since fixity specifications aren't exported. http://mlton.org/InfixingOperators http://mlton.org/InfixingOperators Otherwise, I love SML syntax, and would be curious to see the answer to this, too. I find it refreshingly simple and consistent. Is it that it uses 'let ... in ... end' and such rather than whitespace or brackets?
- oconnor0 7y agoWhat's the problem with the module system and functors?
- chriswarbo 7y agoSML modules are a classic example of a "shadow language" ( https://gbracha.blogspot.com/2014/09/a-domain-of-shadows.html https://gbracha.blogspot.com/2014/09/a-domain-of-shadows.htm... ). I'd like to see an ML-like language where modules/interfaces are normal values, functors are just normal functions, etc. Modeling such a system at the value level is easy enough, but having it run at compile-time introduces some tricky issues (especially around IO).
- cannam 7y agoAndreas Rossberg's 1ML is (was?) an effort to unify the module syntax with that of functions and values (https://people.mpi-sws.org/~rossberg/papers/Rossberg%20-%201ML%20--%20Core%20and%20modules%20united%20[JFP].pdf https://people.mpi-sws.org/~rossberg/papers/Rossberg%20-%201..., https://github.com/rossberg/1ml https://github.com/rossberg/1ml) The module syntax is certainly clumsy in comparison to the rest of the language, and it's not just the syntax - everything about functor arguments is a bit murky.
- wuschel 7y agoIs ML used in industry? If so, what would be the scenarios/use cases?
- Gene_Parmesan 7y agoThe wiki page for SML claims it's used by chip manufacturers like ARM, but no citation. However, languages like Ocaml and F# are direct descendants of ML, and those languages see wider modern adoption. In this sense ML is kind of equivalent to C, and something like Ocaml is kind of equivalent to C++. Haskell is also in the ML family but its laziness and emphasis on purity keeps it a bit separate from its cousins. In general, FP sees adoption where correctness is of overriding importance -- e.g., Jane Street's use of Ocaml.
- Koshkin 7y agoML is a general-purpose programming language, and as such its use case cannot be narrowly specified. (They say it's good for writing compilers, but I wouldn't latch on that.)
- mumblemumble 7y ago> The only thing holdong sml back in my eyes is somewhat clunky syntax and the module system Those are both tricky, but I think the much bigger deal is that the package ecosystem is about as lush as the parts of Antarctica that are above sea level. I suspect that the standard getting whacked together before the language really had a chance to mature had the unfortunate effect of stunting its growth.
- int_19h 7y agoCompared to OCaml, SML pattern matching syntax can be frustrating, mainly because there's no guards. It's not needed that often - but when it's needed, the code with guards is much simpler than multiple branches with nested conditionals.