7 ms·
Standard ML Family
- eatonphil 4y agoIt would be great to see Julian Hyde's Morel [0, 1] on this list as well. And also WebML [2], SOSML [3], Bright-ML [4] (had to refresh my memory from my 2020 post on the topic [5]). [0] http://blog.hydromatic.net/2020/02/25/morel-a-functional-language-for-data.html http://blog.hydromatic.net/2020/02/25/morel-a-functional-lan... [1] https://github.com/hydromatic/morel https://github.com/hydromatic/morel [2] https://github.com/KeenS/webml https://github.com/KeenS/webml [3] https://github.com/SOSML/SOSML https://github.com/SOSML/SOSML [4] https://github.com/elpinal/bright-ml https://github.com/elpinal/bright-ml [5] https://notes.eatonphil.com/standard-ml-in-2020.html https://notes.eatonphil.com/standard-ml-in-2020.html
- plumeria 4y agoReasonML isn't listed as well [0], but I see that the list was last updated on Mon Sep 7 17:22:16 PDT 2015 [0] https://reasonml.github.io/ https://reasonml.github.io/
- chrischen 4y agoTechnically ReasonML is Ocaml.
- agumonkey 4y agoI saw your mention of SOSML on a subreddit; for someone who has never actually wrote an ml compiler, reading the js codebase was very interesting.
- eatonphil 4y agoYeah I am not a huge fan of the compiler code in SML for the ones I've looked at (though I haven't looked at them all). Often it's just one author so they often omit types on nested functions (since they're optional for the compiler) so they're nearly impossible for me to read without spending a huge amount of time on it. Going off on a tangent, I think every language should require function parameters and return types to be explicitly typed. If that gets rid of the bulk of HM type inference that's cool. The only value to me of type inference is at the local variable level. Function type inference makes code impossible to read.
- yakubin 4y ago> Function type inference makes code impossible to read. And the type errors very non-local and therefore hard to understand. The reason is that HM type inference infers types not only in the leaves->roots direction, but also roots->leaves. An expression gets assigned a type based on the context it appears in. It works wonderfully when the program type checks, because e.g. it allows one to write something like "let x = None" in Rust instead of "let x: Option<very long type name> = Option<very long type name>::None;" as long as further uses of x (such as returning it as the value of the enclosing function) clarify its type. However, when a program is during development, you change things here and there, when one variable binding (such as a function definition), which wasn't explicitly typed, appears in at least two places which require this variable to have conflicting types, then almost certainly the error is going to be generated for a line that you as a human see completely disconnected from where the error actually is. Maybe it's in the function definition, maybe it's in one of its uses. And those things can be further obscured by several indirections of intermediate functions with successfully inferred types.
- eatonphil 4y agoYup, the number one rule for debugging ML is to add types until the error line becomes clear.
- seanstrom 4y agoAs a fan of ML family languages I have a question for SML lovers. What do you typically build with SML? For context, I’m web programmer and I’m also learning game dev, can I use SML productively? Or are there other tasks that I could use SML for?
- csb6 4y agoIt is good at parsing/other compiler-related tasks. Basically anything where you are working with tree structures I think can be a good fit. It is also good as a way to learn about functional programming.
- nextos 4y agoSML has an insanely good optimizing compiler, MLton. With some backing SML could be the language of choice for safe and efficient applications.
- sshine 4y agoSML for web and game dev? Why not! There is the Rails-inspired web framework SML on Stilts: — https://github.com/j4cbo/stilts https://github.com/j4cbo/stilts — presumably named after its great ergonomics. And there is the SDL-powered MosGame, specifically for the Moscow ML compiler — https://github.com/Eckankar/MosGame https://github.com/Eckankar/MosGame — it comes with these examples: https://github.com/Eckankar/MosGame/tree/master/examples https://github.com/Eckankar/MosGame/tree/master/examples But really, SML is primarily good for writing compilers.
- 4y ago
- sgeisenh 4y agoStandard ML is incredibly usable but also very small (syntactically and semantically) especially compared with modern algol-family languages. There are a couple of quality of life features missing (most notably is record update syntax), but I really enjoy that the core language has not changed in 25 years.
- qiskit 4y agoIt's great functional language to learn pattern matching, type inference, polymorphism, etc in an academic setting. Great language to compare and contrast to other languages ( dynamic, OOP, imperative, etc ), but I'm not sure how useful it is as I've never seen it used in the business world. When all you knew was C/C++/Java, standard ml throws you for a loop - in a good way.
- chriswarbo 4y agoAt my current job we use Scala extensively. I didn't have much experience with it, but found it pretty easy to pick up, mostly due to its similarity to StandardML (much moreso than e.g. Java, Haskell or Python; which are also clearly influences) In fact, my only previous experience with Scala was from hacking on Isabelle/HOL, which is mostly StandardML, but happens to use Scala in the periphery (scripting, UI, etc.)!
- dbmacqueen 4y agoThere is also ongoing discussion and other work on something called "successor ML" (sML). See smlfamily.org for further information. Functional record update is one of the features contemplated.
- jjice 4y agoI used SML in my compiler course in college. Our professors loved SML and maintains a pretty popular compiler for it, so he was a wealth of knowledge and helped us along the way, which made it a much more approachable language than if I were to embark on learning it myself. Really shows the power for statically typed functional languages, and especially the power of sum types. Representing trees with sum types is so extremely powerful and makes writing compiler oriented code feel very natural. I haven't used it since graduation, but if I had to write a compiler, I'd probably opt for an SML like language, like F#.
- technocratius 4y agoFor those (like me) who had to look it up: ML stands for meta language
- Athas 4y agoThis is the historic origin of the name, but I'm not sure it's still supposed to be an acronym. Modern ML may just be named with two arbitrary letters, as often happens when things named by acronyms grow beyond their original domain. The "meta language" part refers to MLs original domain of writing tactics for proof assistants, where the "object language" was the language of the programs you were manipulating, and the "meta language" is the language in which you manipulate the programs. This also sort of makes sense when using ML to write a compiler (the "object language" is whatever you're compiling), but of course modern ML goes far beyond just language processing, even if it's still pretty good at it.
- kristianp 4y agoIs there a history of the original ML dialect out there somewhere? It's surprisingly old, having first appeared in 1973 according to Wikipedia.[1] [1] https://en.m.wikipedia.org/wiki/ML_(programming_language) https://en.m.wikipedia.org/wiki/ML_(programming_language)
- frou_dh 4y agoThat's talked about in this recent article, "The History of Standard ML" https://dl.acm.org/doi/pdf/10.1145/3386336 https://dl.acm.org/doi/pdf/10.1145/3386336 There's also this video presentation, "The History of Standard ML: Ideas, Principles, Culture": https://www.youtube.com/watch?v=NVEgyJCTee4 https://www.youtube.com/watch?v=NVEgyJCTee4
- 5- 4y agosince i grew up with ocaml, i have found this page on its differences to sml rather informative: http://adam.chlipala.net/mlcomp/ http://adam.chlipala.net/mlcomp/
- frou_dh 4y agoAndreas Rossberg has a similar page: https://people.mpi-sws.org/~rossberg/sml-vs-ocaml.html https://people.mpi-sws.org/~rossberg/sml-vs-ocaml.html ...and also a nice display of SML's grammar: https://people.mpi-sws.org/~rossberg/sml.html https://people.mpi-sws.org/~rossberg/sml.html