News for hackers. Stuff that matters.
Re:The History of Standard ML [audio] by c-cube on Tuesday July 13, 2021 @01:39PM (#27823783)
The future is effect systems, not monads. The next ML will be more similar to Koka than Haskell, and yes, it'll be strict.

Maybe it'll even be named OCaml if the efforts to bring effect typing into it are eventually merged :-).

Re:The History of Standard ML [audio] by networked on Tuesday July 13, 2021 @02:38PM (#27824515)
Flix might be this next ML. It is a new programming language with a Hindley-Milner type system notable for having effect polymorphism. It has an otherwise well-rounded design inspired by OCaml (among others).

https://flix.dev/

(I am not affiliated with Flix. I started following its development recently because it looked interesting.)

Re:The History of Standard ML [audio] by Zababa on Tuesday July 13, 2021 @03:25PM (#27825116)
Flix looks interesting, the Java interop seem to be a great feature too, but I'm wondering if they'll have traction. The JVM already has Scala, and while it's not exactly the same thing it will be "good enough" for most people. Considering Scala has usually lots of churn and already a split ecosystem, plus the upcoming transition to 3, it's going to be hard to find a place. Especially since Java itself is gaining pattern matching, records and the like.
Re:The History of Standard ML [audio] by Zababa on Tuesday July 13, 2021 @01:46PM (#27823863)
So if I understand everything correctly effect systems are another way of encoding side effects into the type system? If so, why are they preferable to monads? That's the part I don't understand. For the strictness, I think now most people agree that a bit of lazyness is great when you need it (iterators, streams) but the vast majority of the language should be indeed strict.

> Maybe it'll even be named OCaml if the efforts to bring effect typing into it are eventually merged :-).

From what I read recently that's the plan, although they'll focus first on domains for 5.0, and merge the effects later.

Re:The History of Standard ML [audio] by c-cube on Tuesday July 13, 2021 @02:49PM (#27824664)
Effect systems are both a runtime thing (similar to exceptions or lisp's conditions, in some sense), and a type-level thing (have a set of effects attached to an arrow, with type inference that is able to infer the effects and compose them nicely). Both are necessary for the future ML™, I think: the runtime part gives semantics to effects and composes super well (better than monad transformers, afaict: no need to `lift` everything); the typing part keeps the code honest. The effects also have to compose nicely with higher-order functions (so that `map` carries over the effects of its functional parameter).

> From what I read recently that's the plan, although they'll focus first on domains for 5.0, and merge the effects later.

Yes indeed! The timeline for typed effects is not clear to me, it might take a long time, especially with the stringent constraints of backward compatibility.

That said I'm not an expert, I'm just very hyped :-)

Re:The History of Standard ML [audio] by Zababa on Tuesday July 13, 2021 @03:19PM (#27825053)
Thank you for the explanation! I feel like I understand this better now.

> The timeline for typed effects is not clear to me, it might take a long time, especially with the stringent constraints of backward compatibility.

From what I understand, the "long time" will be probably less than modular implicits, which are estimated at at least a few years away. There are a few informations here https://discuss.ocaml.org/t/multicore-ocaml-may-2021/7990 and here https://discuss.ocaml.org/t/multicore-ocaml-june-2021/8134, where at least we can see that the effect branch is up to date with 4.12. The performance seems really good, I can't find it anymore but they had the same performance as Go's net/http with http/af. It's a very exciting space!

Re:The History of Standard ML [audio] by JoelMcCracken on Tuesday July 13, 2021 @02:57PM (#27824778)
monadic IO is basically a type of effect system.

the big issue is that you have to do a LOT of complex shuffling of types and values in order to deal with effects.

You can actually avoid a ton of this by thinking about purity in a less expression-level way, like how Koka does it. And, I think I'd probably try implementikng something like it (or eff) in my language.

You can always replicate laziness by making your own thunks. But this just isn't as convenient.

Re:The History of Standard ML [audio] by Zababa on Tuesday July 13, 2021 @03:21PM (#27825064)
Thanks for the explanation.