Re:Elixir v1.20 released: now a gradually typed language
by nine_k on Thursday June 04, 2026 @02:29PM
(#48402694)
Why, consider: mailbox → pattern matching → fully statically typed code.
It's not unlike the standard HTTP-based API → routing and parsing → fully statically typed code.
Re:Elixir v1.20 released: now a gradually typed language
by janderland on Thursday June 04, 2026 @03:33PM
(#48403543)
Maybe you’re implying that message passing makes compile-time validation of messages difficult? The types themselves are a solved problem, as long as you allow actors to fail when they receive a message they can’t handle.
Re:Elixir v1.20 released: now a gradually typed language
by true_religion on Thursday June 04, 2026 @11:40PM
(#48407657)
It's really not a problem to have actors fail like that so long as you're using structural types.
It in fact mimics what a lot of people are already doing with pattern matching.
So I don't think there is any real good reason to not allow enforcing static types, at least across your own part of the codebase anyways.
In contrast, Go's message passing model works on typed channels. A channel has a type, and only accepts messages of the given type. The `receive` operator then acts as the merging data flow which solves the problem of receiving messages of different types. This is a design which amends itself far better to static typing.
Pattern matching isn't a substitute for static typing at all. The two features are entirely orthogonal indeed, and you definitely want static typing and pattern matching at the same time.