Live data from Hacker News

Standard ML in 2020

notes.eatonphil.com

111–120 of 125 posts

Re: Standard ML in 2020

#111
post #91
post #88

Earlier quoted context omitted.

Why should I use SML over Rust or Lisp? Rust's performance is almost certainly much better, with a larger library ecosystem. (Common) Lisp has macros, which allow me to implement pattern-matching; an even simpler BNF (as short as one line, depending on how you define it); dynamic typing, which makes generics unnecessary, and for all the hate that it receives is regularly deployed to production systems on large scales…

SML over lisp: * Doesn't have macros, which in my 16 years of experience is a plus, macros pollute, should at most be an implementation detail * Has types * Doesn't have parantheses and the annoying prefix notation * Your knowledge of SML can be translated easily to OCaml, Java, Scala, which are more or less part of the same family SML over Rust: * I don't have to reason about lifetimes, I'm not in a constrained envi…

> * Doesn't have macros

> * Has types

Your words betray your ignorance. Common Lisp has a type system. Have you ever written it? Do you actually know anything about it? Moreover, macros are a plus - you clearly have not actually used Lisp macros, which are categorically different than macros in other languages.

> * Doesn't have parantheses and the annoying prefix notation

Spelling mistake. Additionally, the parenthesized syntax is a choice, and one that you get used to quickly. Subjective, and therefore not valid as one of the items you listed.

> * Your knowledge of SML can be translated easily to OCaml, Java, Scala, which are more or less part of the same family

Meanwhile, knowledge of Common Lisp transfers to almost every dynamically-typed language ever made, and a good many static ones - including Java and Scala - because Lisp influenced all of those languages. That is, Lisp knowledge transfers to far more languages than SML knowledge does.

Re: Standard ML in 2020

#112
post #95
post #88

Earlier quoted context omitted.

Why should I use SML over Rust or Lisp? Rust's performance is almost certainly much better, with a larger library ecosystem. (Common) Lisp has macros, which allow me to implement pattern-matching; an even simpler BNF (as short as one line, depending on how you define it); dynamic typing, which makes generics unnecessary, and for all the hate that it receives is regularly deployed to production systems on large scales…

Those are both great languages. Rust is very much a ml variant. It's all the things you claim and probably more. It's also at least an order of magnitude more complex. If you know rust, you'll probably find SML super easy to learn and refreshingly easy to code. People gravitating toward SML likely want a few things: easy to learn, simple infix syntax with functional support, compile time type static type checks, mult…

Thank you for your actually informed, well-reasoned, and thoughtful answer!

Re: Standard ML in 2020

#113
post #111
post #91

Earlier quoted context omitted.

SML over lisp: * Doesn't have macros, which in my 16 years of experience is a plus, macros pollute, should at most be an implementation detail * Has types * Doesn't have parantheses and the annoying prefix notation * Your knowledge of SML can be translated easily to OCaml, Java, Scala, which are more or less part of the same family SML over Rust: * I don't have to reason about lifetimes, I'm not in a constrained envi…

> * Doesn't have macros > * Has types Your words betray your ignorance. Common Lisp has a type system. Have you ever written it? Do you actually know anything about it? Moreover, macros are a plus - you clearly have not actually used Lisp macros, which are categorically different than macros in other languages. > * Doesn't have parantheses and the annoying prefix notation Spelling mistake. Additionally, the parenthes…

> Your words betray your ignorance. Common Lisp has a type system. Have you ever written it? Do you actually know anything about it? Moreover, macros are a plus - you clearly have not actually used Lisp macros, [...]

This isn't really okay. It's fine if you disagree, but I don't get why such aggression is needed.

Re: Standard ML in 2020

#114
post #107

Earlier quoted context omitted.

To be a bit pedantic (because this thing is interesting), it's more like a context. In Haskell you'll say "this code must run on the real world". Mercury literally pretends the world is a piece of state. You explicitly say "Here, run this code. The world before it runs is on variable `a`, place the world after it runs on variable `b`".

The classic paper Imperative Functional Programming https://www.microsoft.com/en-us/research/publication/imperat... introduced the IO monad and explained that its internals are based on passing around the state of the world. The monad hides the world and keeps it linear. The compiler (ghc) optimizes out the world so that it is implicit in the compiled program. I believe this is still the way that ghc works.

Oh, yes, the stdlib does pretend the world is a piece of data. But it does a very good job on keeping this hidden from any developer, so this is more of a compiler design that does not leak into the language.

Re: Standard ML in 2020

#115
post #15

I've recently picked it up, reading "ML for the working programmer". The language is fairly simple, everything just fits. However: 1. Both Vim and Emacs are horribly annoying with their automatic indentation for SML. There is a lot of fighting against the editor in this department. In Emacs e.g. you have to delete whitespace all the time, because otherwise you'd have top-level function definitions shifted 80 characte…

> ... don't support readline shortcuts.

Have you tried rlwrap(1)? I use it with the OCaml REPL and it works well enough.

Re: Standard ML in 2020

#116
post #111
post #91

Earlier quoted context omitted.

SML over lisp: * Doesn't have macros, which in my 16 years of experience is a plus, macros pollute, should at most be an implementation detail * Has types * Doesn't have parantheses and the annoying prefix notation * Your knowledge of SML can be translated easily to OCaml, Java, Scala, which are more or less part of the same family SML over Rust: * I don't have to reason about lifetimes, I'm not in a constrained envi…

> * Doesn't have macros > * Has types Your words betray your ignorance. Common Lisp has a type system. Have you ever written it? Do you actually know anything about it? Moreover, macros are a plus - you clearly have not actually used Lisp macros, which are categorically different than macros in other languages. > * Doesn't have parantheses and the annoying prefix notation Spelling mistake. Additionally, the parenthes…

Ok, I don't want to start a language war again, when I say types, I mean the modern reference to the word that it has a static type system. Indeed, Lisp languages are strongly typed but I'm sorry, in the real world it doesn't help me, I need types, statically checked types.

I don't know if Lisp, the language, influenced Java and Scala so much, it was more about its runtime, the garbage collector, etc. The only thing that I liked about Lisp is the composabiltiy, and coupled with objects from Simula created my favorite industrial languages, Java and TypeScript. I'm passionate about parsers, compilers and transformers and this is why I have a fost spot for SML, OCaml. I simply dislike Lisp, interesting language but not for me.

Re: Standard ML in 2020

#117
post #113
post #111

Earlier quoted context omitted.

> * Doesn't have macros > * Has types Your words betray your ignorance. Common Lisp has a type system. Have you ever written it? Do you actually know anything about it? Moreover, macros are a plus - you clearly have not actually used Lisp macros, which are categorically different than macros in other languages. > * Doesn't have parantheses and the annoying prefix notation Spelling mistake. Additionally, the parenthes…

> Your words betray your ignorance. Common Lisp has a type system. Have you ever written it? Do you actually know anything about it? Moreover, macros are a plus - you clearly have not actually used Lisp macros, [...] This isn't really okay. It's fine if you disagree, but I don't get why such aggression is needed.

[deleted]

Re: Standard ML in 2020

#118
post #116
post #111

Earlier quoted context omitted.

> * Doesn't have macros > * Has types Your words betray your ignorance. Common Lisp has a type system. Have you ever written it? Do you actually know anything about it? Moreover, macros are a plus - you clearly have not actually used Lisp macros, which are categorically different than macros in other languages. > * Doesn't have parantheses and the annoying prefix notation Spelling mistake. Additionally, the parenthes…

Ok, I don't want to start a language war again, when I say types, I mean the modern reference to the word that it has a static type system. Indeed, Lisp languages are strongly typed but I'm sorry, in the real world it doesn't help me, I need types, statically checked types. I don't know if Lisp, the language, influenced Java and Scala so much, it was more about its runtime, the garbage collector, etc. The only thing…

[deleted]

Re: Standard ML in 2020

#119
post #116
post #111

Earlier quoted context omitted.

> * Doesn't have macros > * Has types Your words betray your ignorance. Common Lisp has a type system. Have you ever written it? Do you actually know anything about it? Moreover, macros are a plus - you clearly have not actually used Lisp macros, which are categorically different than macros in other languages. > * Doesn't have parantheses and the annoying prefix notation Spelling mistake. Additionally, the parenthes…

Ok, I don't want to start a language war again, when I say types, I mean the modern reference to the word that it has a static type system. Indeed, Lisp languages are strongly typed but I'm sorry, in the real world it doesn't help me, I need types, statically checked types. I don't know if Lisp, the language, influenced Java and Scala so much, it was more about its runtime, the garbage collector, etc. The only thing…

> when I say types, I mean the modern reference to the word that it has a static type system

Can you show me a significant body of literature or a whole community that uses "types" to mean "a strong type system"? Because I've never heard that aliasing done before.

> I don't know if Lisp, the language, influenced Java and Scala so much, it was more about its runtime, the garbage collector, etc.

Lisp pioneered lambdas and first-class functions, in addition to garbage collection, all of which were adopted by Scala and Java later.

> I simply dislike Lisp, interesting language but not for me.

I understand! I have things that I like and dislike, too. However, it's extremely frustrating when you ask for an analytical comparison between several languages, and some random person lacking knowledge on at least one of the languages (I suspect you don't know Rust either) comes in and, instead of actually providing relevant information, gives fallacies and opinions.

Re: Standard ML in 2020

#120
post #113
post #111

Earlier quoted context omitted.

> * Doesn't have macros > * Has types Your words betray your ignorance. Common Lisp has a type system. Have you ever written it? Do you actually know anything about it? Moreover, macros are a plus - you clearly have not actually used Lisp macros, which are categorically different than macros in other languages. > * Doesn't have parantheses and the annoying prefix notation Spelling mistake. Additionally, the parenthes…

> Your words betray your ignorance. Common Lisp has a type system. Have you ever written it? Do you actually know anything about it? Moreover, macros are a plus - you clearly have not actually used Lisp macros, [...] This isn't really okay. It's fine if you disagree, but I don't get why such aggression is needed.

I specifically avoided insulting them. "Ignorance" is not an insult; it's a description of your knowledge on a topic, and if it isn't the right word to describe telling such a blatant and fundamental misunderstanding, then what is?
Post reply on HN