Live data from Hacker News

Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

elixir-lang.org

11–20 of 170 posts

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#11
post #3

I'm excited about the type system so far, but I'm especially excited to hear about what else the type system is going to enable in the future. I remember José describing this as a "gradual gradual type system," where the gradual type system is going to be gradually added in stages, with this being the first stage. Any cool new type-system-related stuff coming up in the next few stages? I'm especially hoping for newly…

Doesn't gradual type system mean something else here? As in developers being able to iteratively add types while leaving untyped parts for later? At least this is how Ruby's Sorbet describes it

Yes, but the discussion here was about it being a gradual, gradual type system, as in, the gradual type system being added gradually

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#12

Does anyone know what they mean by "set-theoretic types"? I'm a PL nerd, but I've never heard this term before.

The original post Jose wrote announcing the gradual typing project has a good summary of the goal specific to Elixir (2022)

https://elixir-lang.org/blog/2022/10/05/my-future-with-elixi...

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#14

Does anyone know what they mean by "set-theoretic types"? I'm a PL nerd, but I've never heard this term before.

From the original paper[0]:

> We present a gradual type system for Elixir, based on the framework of semantic subtyping ... [which] provides a type system centered on the use of set-theoretic types (unions, intersections, negations) that satisfy the commutativity and distributivity properties of the corresponding set-theoretic operations. The system is a polymorphic type system with local type inference, that is, functions are explicitly annotated with types that may contain type variables, but their applications do not require explicit instantiations: the system deduces the right instantiations of every type variable. It also features precise typing of pattern matching combined with type narrowing: the types of the capture variables of the pattern and of some variables of the matched expression are refined in the branches to take into account the results of pattern matching.

[0]: https://www.irif.fr/_media/users/gduboc/elixir-types.pdf

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#16

Does anyone know what they mean by "set-theoretic types"? I'm a PL nerd, but I've never heard this term before.

If you're into watching talks, this will be well worth your time.

ElixirConf 2023 - José Valim - The foundations of the Elixir type system

https://www.youtube.com/watch?v=giYbq4HmfGA

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#17
Elixir and Erlang teams are absolutely killing it over the last few years, not to mention all the work done by the library and book authors out there.

I've never been more excited about a release. I've been watching commits to both Elixir and OTP for awhile now and I feel Elixir/Erlang has really picked up steam.

Thanks to everyone involved for making my life easier!

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#18

Does anyone know what they mean by "set-theoretic types"? I'm a PL nerd, but I've never heard this term before.

From the original paper[0]: > We present a gradual type system for Elixir, based on the framework of semantic subtyping ... [which] provides a type system centered on the use of set-theoretic types (unions, intersections, negations) that satisfy the commutativity and distributivity properties of the corresponding set-theoretic operations. The system is a polymorphic type system with local type inference, that is, fun…

sounds like what typescript does, I'm not clear if the Elixir approach is different from "structural typing" (as TS calls it) or if they're rediscovering the same thing. Either way, I'm happy it's the way they're going
Post reply on HN