Live data from Hacker News

Effective Concurrency with Algebraic Effects in Multicore OCaml

kcsrk.info

11–20 of 63 posts

Re: Effective Concurrency with Algebraic Effects in Multicore OCaml

#12
Isn't Java capable of the same thing now that it has algebraic data types with records + sealed classes + pattern matching? Given that Java already has a fine concurrency story, isn't OCaml a hard sell to someone that's not into compiler development to depend on its rich ecosystem?

Re: Effective Concurrency with Algebraic Effects in Multicore OCaml

#13

Effectful concurrency feels so different from the async/await model I'm used to, but I'm really looking forward to playing around with it when OCaml 5 drops. Does anybody here have a more "ELI5" tier guide to it?

Thomas Leonard did a great talk on our experiences with effects at the OCaml Workshop this year: https://watch.ocaml.org/videos/watch/74ece0a8-380f-4e2a-bef5...

Also you can start playing with effects today using the 4.12+domains branch on https://github.com/ocaml-multicore/ocaml-multicore

Re: Effective Concurrency with Algebraic Effects in Multicore OCaml

#14

Isn't Java capable of the same thing now that it has algebraic data types with records + sealed classes + pattern matching? Given that Java already has a fine concurrency story, isn't OCaml a hard sell to someone that's not into compiler development to depend on its rich ecosystem?

Algebraic data types are not the same as an algebraic effects system.

Re: Effective Concurrency with Algebraic Effects in Multicore OCaml

#15

Isn't Java capable of the same thing now that it has algebraic data types with records + sealed classes + pattern matching? Given that Java already has a fine concurrency story, isn't OCaml a hard sell to someone that's not into compiler development to depend on its rich ecosystem?

Though they share the word "algebraic", algebraic data types != algebraic effects. And while Java has good support for concurrency primitives and concurrent data structures, it does suffer from the problem highlighted in the article:

> Over time, the runtime system itself tends to become a complex, monolithic piece of software, with extensive use of locks, condition variables, timers, thread pools, and other arcana.

I'm not an expert on this, but my understanding is that the problem that algebraic effects tries to solve is to improve language semantics to make it easier to separate different levels of abstraction (e.g. separating the what from the how), while also encoding the performed effects into the type system.

Re: Effective Concurrency with Algebraic Effects in Multicore OCaml

#16

Isn't Java capable of the same thing now that it has algebraic data types with records + sealed classes + pattern matching? Given that Java already has a fine concurrency story, isn't OCaml a hard sell to someone that's not into compiler development to depend on its rich ecosystem?

Compared to Erlang, Haskell, an other FP languages, Java's concurrency story leaves a lot to be desired.

https://medium.com/traveloka-engineering/cooperative-vs-pree...

Re: Effective Concurrency with Algebraic Effects in Multicore OCaml

#17
post #13

Effectful concurrency feels so different from the async/await model I'm used to, but I'm really looking forward to playing around with it when OCaml 5 drops. Does anybody here have a more "ELI5" tier guide to it?

Thomas Leonard did a great talk on our experiences with effects at the OCaml Workshop this year: https://watch.ocaml.org/videos/watch/74ece0a8-380f-4e2a-bef5... Also you can start playing with effects today using the 4.12+domains branch on https://github.com/ocaml-multicore/ocaml-multicore

Thanks for the links, that was a very succinct talk and made me excited to try it out. Just one follow-up question: the 4.12+domains branch doesn't include support for the try syntax for handling effects, correct?

Re: Effective Concurrency with Algebraic Effects in Multicore OCaml

#18

Isn't Java capable of the same thing now that it has algebraic data types with records + sealed classes + pattern matching? Given that Java already has a fine concurrency story, isn't OCaml a hard sell to someone that's not into compiler development to depend on its rich ecosystem?

Compared to Erlang, Haskell, an other FP languages, Java's concurrency story leaves a lot to be desired. https://medium.com/traveloka-engineering/cooperative-vs-pree...

In fairness to the JVM, the work on Project Loom would bring the JVM inline with what that document describes as the Erlang/Haskell "Hybrid threading" model.

Re: Effective Concurrency with Algebraic Effects in Multicore OCaml

#19

Isn't Java capable of the same thing now that it has algebraic data types with records + sealed classes + pattern matching? Given that Java already has a fine concurrency story, isn't OCaml a hard sell to someone that's not into compiler development to depend on its rich ecosystem?

Algebraic data types are not the same as an algebraic effects system.

Java's checked exceptions can be considered an effect system and coupled with ADTs I suppose we can call it an algebraic effects system. I mean the domino effect in which the exception has to be handled in each method that calls that is what seems to me the effect/handler counterpart that is present in Java. In the end an algebraic effect is just an extension of a type system that supports ADT, or is my memory from university failing me now.

Re: Effective Concurrency with Algebraic Effects in Multicore OCaml

#20
post #17
post #13

Earlier quoted context omitted.

Thomas Leonard did a great talk on our experiences with effects at the OCaml Workshop this year: https://watch.ocaml.org/videos/watch/74ece0a8-380f-4e2a-bef5... Also you can start playing with effects today using the 4.12+domains branch on https://github.com/ocaml-multicore/ocaml-multicore

Thanks for the links, that was a very succinct talk and made me excited to try it out. Just one follow-up question: the 4.12+domains branch doesn't include support for the try syntax for handling effects, correct?

Correct. The 4.12+domains branch has effect handlers without syntactic support (which is what will be in 5.0), the 4.12+domains+effects has the syntax.
Post reply on HN