Hacker News new | ask | show | jobs
by plinkplonk 2294 days ago
From the Gleam FAQ

"How is message passing typed?

Gleam doesn't currently have first class support for the BEAM's concurrency primitives such as receive, send, and spawn. This is because research is still ongoing as to the best way to apply a strong type system to them while still enabling established OTP patterns. For now these primitives should be used via the Erlang FFI, making them dynamically typed.

Many OTP patterns such as gen_server are functional in nature and don't require direct use of these primitives so these behaviours can be implemented in Gleam today."

I suspect the FB language might solve this.

2 comments

Hi! I'm the author of Gleam. We have type safe actor libraries now :)

I'm interested in what the WhatsApp team come up with here too! I'm not sure it's possible to "solve" this entirely though, message passing in Erlang is extremely dynamic and some of the problems are not possible to solve (i.e. distributed message passing) and will always require some unsafe type casting.

akka typed is now a thing and it works reasonable well. Though, imo, the actor pattern will always be at odds with statically typed functional programming.