Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

sml, specifically the MLTon dialect. It's good for all the same reasons ocaml is good, it's just a much better version of the ML-language in my opinion.

I think the only thing that ocaml has that I miss in sml is applicative functors, but in the end that just translates to slightly different module styles.



I remember working through Appel's compiler textbook in school, in SML and Java editions side by side, and the SML version was of course laughably more concise. It felt like cheating, because it practically was.


Nowadays you could make the Java version quite similar to the SML one, if there would be a new edition.

I have been looking forward to ML like capabilities on mainstream since using Caml Light.

Regarding those books, while we used the Java version, alongside JavaCC, when time came to actually buy the book, I also got the SML edition.


Heh... I got the C version first, which was a mess, only to immediately order the ML one.

> have been looking forward to ML like capabilities on mainstream since using Caml Light.

Modern Java is not built around ADTs and pattern matching, these things feel a bit bolted on. SML feels almost like a compiler writing DSL.


The difference is that I get to use Java at work, and never will be able to use SML, perfection usually fails in mainstream adoption, as proven by the whole worse is better mindset languages.

I rather have Java, C#, C++, Kotlin, Rust,.... with their imperfections to ML, Smalltalk, and Lisp ideas, than hoping for getting the right languages at the workplace.

Fully agree on the C edition.


And then there's:

"How we prevent conflicts in authoritative DNS configuration using formal verification"

https://blog.cloudflare.com/topaz-policy-engine-design/


True.

Good enough wins. Worse is better rules. Release early... and so on.

I am old enough to remember the full drama behind adding lambda to python, and resistance to bits of functional goodies coming from lisps.

But here we are. Java is an aaaalmost acceptable language!

While scheme, standardml and numerous other perfect little languages are mostly just Wikipedia pages now.


> Good enough wins. Worse is better rules. Release early... and so on.

None of that applies to this case, where ML is not only a fair bit older than Java, but abides the principle of "worse is better" far more.

> While scheme, standardml and numerous other perfect little languages are mostly just Wikipedia pages now.

Frankly, I'm thankful I work in an environment with creative autonomy and can choose (and create) my own tools, rather than being forced to work with ones I don't particularly care for because they had a large marketing push.


Why do you think ml is on the worse side of the principle when compared to java?

Sml is a superpolished language, very well-defined formally, being a culmination of years of design effort and uniting a family of academia-born languages. It took 40 years of research to release the final version in 1997.

Java is on the industry side of thing: semi-formalized, numerous omissions when created, a bunch of ad hoc ideas, released in 1995. Not sure it took more than 3-4 years to get the first official version out.


"Worse is better" is an extremely misleading phrase. It's supposed to be ironic, not sarcastic. Unfortunately, the authors of "Unix Haters Handbook" exercised terrible judgement used it as a sarcastic pejorative. Now nobody understands what anybody is actually saying when they use it. I mean it in the original sense, where it's basically another way to express "Less is more."

SML is borderline minimalist, it's "worse" because it doesn't try to solve everybody's problems with a bunch of ad hoc language features and a stdlib and formalization larger than the entire legal code of the United States. It's "worse" because it comes with "less". You can't just import solution and start writing AbstractFactoryManager2 garbage. It's not actually worse to anybody but beancounters.


Also, lucky you:-) the logic of software development usually means that beginning with mid-size companies it doesn't make sense to have more than 2 major languages, usually on the boring side.

But... I feel that this will not matter all that much soon


Can you expand on what makes SML better, in your eyes, than OCaml?

IMO: it's certainly "simpler" and "cleaner" (although it's been a while but IIRC the treatment of things like equality and arithmetic is hacky in its own way), which I think causes some people to prefer SML over aesthetics, but TBH I feel like many of OCaml's features missing in SML are quite useful. You mentioned applicative functors, but there's also things like labelled arguments, polymorphic variants, GADTs, even the much-maligned object system that have their place. Is there anything SML really brings to the table besides the omission of features like this?


> the treatment of things like equality and arithmetic is hacky in its own way

mlton allows you to use a keyword to get the same facility for function overloading that is used for addition and equality. it's disabled by default for hygienic reasons, function overloading shouldn't be abused.

https://baturin.org/code/mlton-overload/

> labelled arguments

generally speaking if my functions are large enough for this to matter, i'd rather be passing around refs to structures so refactoring is easier.

> polymorphic variants

haven't really missed them.

> GADTs

afaik being able to store functors inside of modules would fix this (and I think sml/nj supports this), but SML's type system is more than capable of expressing virtual machines in a comfortable way with normal ADTs. if i wanted to get that cute with the type system, i'd probably go the whole country mile and reach for idris.

> even the much-maligned object system that have their place

never used it.

> Is there anything SML really brings to the table besides the omission of features like this?

mlton is whole-program optimizing (and very good at it)[1], has a much better FFI[2][3], is much less opinionated as a language, and the parallelism is about 30 years ahead[4]. the most important feature to me is that sml is more comfortable to use over ocaml. being nicer syntactically matters, and that increases in proportion with the amount of code you have to read and write. you dont go hiking in flip flops. as a knock-on effect, that simplicitly in sml ends up with a language that allows for a lot more mechanical sympathy.

all of these things combine for me, as an engineer, to what's fundamentally a more pragmatic language. the french have peculiar taste in programming languages, marseille prolog is also kind of weird. ocaml feels quirky in the same way as a french car, and i don't necessarily want that from a tool.

[1] - http://www.mlton.org/Performance

[2] - http://www.mlton.org/ForeignFunctionInterface

[3] - http://www.mlton.org/MLNLFFIGen

[4] - https://sss.cs.purdue.edu/projects/multiMLton/mML/Documentat...


I love, love, love StandardML.

I respect the sheer power of what mlton does. The language itself is clean, easy to understand, reads better than anything else out there, and is also well-formalised. I read (enjoyed!) the tiger book before I knew anything about SML.

Sadly, this purism (not as in Haskell but as a vision) is what probably killed it. MLTon or not, the language needed to evolve, expand, rework the stdlib, etc.

But authors were just not interested in the boring part of language maintenance.


What are your thoughts on basis[1] and successorml[2]?

[1] - http://www.mlton.org/MLBasis

[2] - https://smlfamily.github.io/successor-ml/


I don't think these change anything for the language. Too little, too late.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: