Live data from Hacker News

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

elixir-lang.org

31–40 of 170 posts

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

#31

Earlier quoted context omitted.

Different type system with different goals. Gleam uses a modified version of the Hindley-Milner Type system. (Which is a rock solid tested type system.) A Set theoretical type system is more expressive(which suits the dynamic nature or Elixir better.) You can do Union and Intersection Types, and Negation Types, among other things, that you can't do with a HM type system. but it comes at the cost of how fast the progr…

Does Gleam check types at compile-time? And Elixir check types at run-time? (If at run-time, would that mean it would slow down your entire app as a result?)

Elixir checks at compile time.

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

#32

Earlier quoted context omitted.

Different type system with different goals. Gleam uses a modified version of the Hindley-Milner Type system. (Which is a rock solid tested type system.) A Set theoretical type system is more expressive(which suits the dynamic nature or Elixir better.) You can do Union and Intersection Types, and Negation Types, among other things, that you can't do with a HM type system. but it comes at the cost of how fast the progr…

Does Gleam check types at compile-time? And Elixir check types at run-time? (If at run-time, would that mean it would slow down your entire app as a result?)

My understanding is that the BEAM vm already has some (optional) runtime typechecks in the form of guards, which this new typesystem will also add for you automatically. And that these guards are actually used to speed things up, for example by JITing more optimized code.

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

#33

Earlier quoted context omitted.

Different type system with different goals. Gleam uses a modified version of the Hindley-Milner Type system. (Which is a rock solid tested type system.) A Set theoretical type system is more expressive(which suits the dynamic nature or Elixir better.) You can do Union and Intersection Types, and Negation Types, among other things, that you can't do with a HM type system. but it comes at the cost of how fast the progr…

Does Gleam check types at compile-time? And Elixir check types at run-time? (If at run-time, would that mean it would slow down your entire app as a result?)

Both the Elixir and Gleam type systems run at compile time (and whenever you recompile during development)

There are no plans for runtime checking AFAIK

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

#34
post #8

Earlier quoted context omitted.

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

Correct, a gradual type system is a form of type system and not the method for rolling it out.

It's a gradual type system that they're rolling out gradually.

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

#35
For 10 years I’ve been reading about cool Elixir stuff here. Love the language. I gave up on finding a job in Elixir many years ago though after seeing salaries consistently lower than more mainstream languages. It may be the language I’d want to use most, but salary and cool product are more important to me than tech stack so it may never happen. Still fun to follow from afar.

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

#37

Earlier quoted context omitted.

For more information about what that means, see this playground [0] from the TypeScript docs. PL people often make a big deal about TypeScript's lack of soundness as though it was some kind of mistake, but it was very much an intentional choice given the trade-offs they were making at the time. If Elixir can pull off soundness without compromising expressivity that will be a huge feat, and I'm excited to see it! [0]…

Yea I never bought this assertion from the TS team, saying “given the trade-offs at the time” is the same as saying “we’re already backed into a corner by previous decisions” - the decision(s) may have been intentional at each step but the design itself probably was not. Given the choice of sound or unsound, considering that the purpose of a type system is to give certain guarantees, a type system design must always…

Is the TypeScript team correct in explaining that soundness would exclude functions accepting subtypes as laid out there? If so, it seems like any type system that was meant to be able to type common JavaScript idioms would have to be unsound.

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

#38

For 10 years I’ve been reading about cool Elixir stuff here. Love the language. I gave up on finding a job in Elixir many years ago though after seeing salaries consistently lower than more mainstream languages. It may be the language I’d want to use most, but salary and cool product are more important to me than tech stack so it may never happen. Still fun to follow from afar.

> seeing salaries consistently lower than more mainstream languages

That seems surprising to me as an Elixir developer. Are you looking in the US, or elsewhere?

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

#39

For 10 years I’ve been reading about cool Elixir stuff here. Love the language. I gave up on finding a job in Elixir many years ago though after seeing salaries consistently lower than more mainstream languages. It may be the language I’d want to use most, but salary and cool product are more important to me than tech stack so it may never happen. Still fun to follow from afar.

Salaries are consistently above other mainstream stacks, partly because most Elixir jobs look for senior engineers.

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

#40

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

It's the definition of types as set of values. Then you have set operations on these types that are lade available. That translates into subtyping considerations.

Cf. Castagna's et.al. For semantic subtyping.

Post reply on HN