6 ms·
Unix System Programming with Standard ML (2001) [pdf]
- mhd 7y agoNote that despite the origin of the link the book seems to use SML/NJ, not MLTon.
- brudgers 7y agoNothing against MLTon, but SML/NJ seems to be in more common use based on my experience with the [SML] tag on StackOverflow.
- mhd 7y agoDefinitely. That's why I got excited and thought that there's something specific about MLTon that's used for systems programming here (the capabilities of the "Standard" MLs vary a bit).
- saityi 7y agoI like to use SML/NJ for development and experimentation, and MLton for final compilation. SML/NJ is a really nice development environment, and using a different compiler like MLton or Poly/ML for the final compilation forces you to use the more common, standard subset of ML rather than implementation-specific features.
- voidhorse 7y agoStandard 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.
- gmfawcett 7y agoA similar, nicely written book for Ocaml: https://ocaml.github.io/ocamlunix/ https://ocaml.github.io/ocamlunix/
- jerry40 7y agoFew years ago I took a course by prof. Dan Grossman on Coursera, there was a part about SML and I so liked it (the language and the course). Now I want to read Okasaki's "Purely Functional Data Structures" book and try to reproduce the code examples in SML.
- the_af 7y agoProgramming Languages by Dan Grossman, I took it too. Pretty good course, and a nice intro to static typing and FP with SML. Also nice: the DrRacket part, I wasn't familiar with lisp/scheme-like languages. Also also nice: how you can tell he doesn't really like Ruby ;)
- jerry40 7y agoOh yes, and I can remember the episode when he jumped while explaining some idea in order to make this moment unforgettable. Shame on me, I forgot what idea it was but still remember his jumps :)
- yawaramin 7y agoAs far as I remember PFDS is actually written with SML code.
- jerry40 7y agoSomehow I have an impression that I tried something and could not repeat it in SML/NJ. I can recall it was about streams and lazy evaluations, but now I think that I just misused Lazy lib since I haven't used SML for a while. So this is getting easier, great, thanks! :)
- lwb 7y agoAs someone with absolutely zero experience with ML languages of any kind, would this be the best intro for me to get into it? Or would I be better off with OCaml?
- wbl 7y agoThe Little Mler if you like elephants and food.
- Koshkin 7y agoThe focus on food was very distracting, I remember.
- nextos 7y agoTry https://www.cs.tufts.edu/comp/105-2019s/readings/tofte-tips.pdf https://www.cs.tufts.edu/comp/105-2019s/readings/tofte-tips.... and then https://www.cl.cam.ac.uk/~lp15/MLbook/ https://www.cl.cam.ac.uk/~lp15/MLbook/
- gmfawcett 7y agoEventually I would learn Ocaml, as it's the more sensible language for most production code (community, tooling, ecosystem, etc.). But there's nothing wrong with learning SML first. 90% of what you learn will be transferable to Ocaml. Starting with SML might help you focus on the "essence" of ML languages rather than getting overwhelmed by the impressive range of options that Ocaml opens up. The MLton implementation of SML -- while not necessarily the best ML to practice on -- is particularly interesting because it's a whole-program optimizing compiler. It has a reputation for producing very compact, efficient machine code. Having said that, Ocaml is still a comparatively simple language -- compared to say, Haskell or C++ -- and its native compiler is well known for turning out decent and very predictable code (predictable in the sense that you can read some source code and have a decent understanding of what kind of machine code it will get compiled into). If you decide to learn Ocaml first, but want to stick to "essential ML", I would recommend Jason Hickey's "Introduction to Ocaml" [1] over the more modern "Real World Ocaml" [2], as the latter book introduces every bell and whistle that Ocaml offers, and has a much more ecosystem-dependent focus (third party libraries, third party tooling, etc.). Still a fine book, but I think it emphasizes advanced Ocaml features a bit too much for an introductory text. [1] http://courses.cms.caltech.edu/cs134/cs134b/book.pdf http://courses.cms.caltech.edu/cs134/cs134b/book.pdf [2] https://realworldocaml.org/ https://realworldocaml.org/
- deleted 7y ago[deleted]
- _sbrk 7y agoAh, Standard ML. That brings back great memories of my compiler class at University. This was the first functional language that I was truly comfortable with, and a great tool to write our toy compiler.