5 ms·
Regardless, I would prioritize learning OCaml. The only thing SML has going for it is nicer syntax, and less stapled-on OOP stuff. OCaml's better in almost ever
by smasher164 3y ago
Regardless, I would prioritize learning OCaml. The only thing SML has going for it is nicer syntax, and less stapled-on OOP stuff. OCaml's better in almost every way for day-to-day programming.
- jstrieb 3y agoThough I know far more about SML than OCaml, I would approximate that the former is to C as the latter is to C++. Which one you learn should depend on what you plan to use it for! I'm partial to SML. Then again, I've only written a handful of real-world programs with it.
- cmrdporcupine 3y agoI feel like ... SML is the better language but OCaml is the better runtime/community. Sad.
- WastingMyTime89 3y agoSML definitely has a nicer formal definition but OCaml has better performance and a lot more functionalities. I wouldn’t say SML is the better language but the syntax definitely is cleaner. Strangely I think SML focus on being well defined and tidy is why it never really took off. A language success is linked to its community and your features define who will want to join you. It seems to me that at the beginning it’s better to attract tinkerers than perfectionists.
- yakubin 3y ago> OCaml has better performance That statement needs some evidence. > a lot more functionalities Past a certain minimal threshold of needed functionality, I prefer a language not to have a couple good features than to have a really bad one, like implementation inheritance, particularly multiple inheritance.
- deleted 3y ago[deleted]
- yakubin 3y agoNot necessarily. E.g. SML has had multicore since forever. In OCaml it’s the hot new thing now, which probably needs some time in the wild before everything is ironed out.
- cmrdporcupine 3y agoOk that's interesting, I hadn't realized the multicore story there was better. Back when I was more into looking at this kind of thing (uh, 20 years ago?) I wrote a few simple programs in SML/NJ and far preferred its syntax to OCaml. But even back then, OCaml had more dev community momentum. (Actually Haskell seemed to have even more momentum but I never ever found it readable or comprehensible as a mere mortal.) At the time for what I was doing, I really wanted... SML but without a garbage collector, operating for systems level programming. And so I was excited when Graydon Hoare started what became Rust. Which is what I prefer to work in these days. Still, if I wanted a language for higher level development, I really would prefer to reach for something in the ML family of languages, they are just very expressive. But I wouldn't do this for paid employment work, too esoteric. Maybe that will change a bit now that Rust has brought some concepts and syntax from ML to the mainstream.
- le-mark 3y ago> Not necessarily. E.g. SML has had multicore since forever. Can anyone say which implementation specifically?
- cyberbanjo 3y agoPolyMl is one https://polyml.org/ https://polyml.org/
- fweimer 3y agoOCaml is a much larger language than SML. SML feels cleaner in some ways. For example, it has overflow checks (or infinite precision) for integer arithmetic. (Although OCaml no longer has writable string literals …) SML has multiple, mostly independent implementations with different characteristics. Poly/ML had multi-processor support well before OCaml. But OCaml development is certainly much more active.