I’ve found it really interesting to watch a static type system be added to an existing language. Many others have done it (Python, TS, etc) so it’s always cool to see how approaches are structured with the benefit of that hindsight.
I’m quite pleased that unless is on the way out. It’s an unnecessary duplication of if ! in the language grammar and I found it invariably harder to comprehend than an if. Not only that, it also creates an additional complication for code analysis tools like Credo.
I’m guessing it was something that was originally borrowed from Ruby which has a very idiosyncratic (and in my view misguided) notion of readability and programmer convenience.
CPL and BCPL have eccentric conditional statements because Strachey had a fierce objection to the way “else” is used in Algol (et seq.), being “bad English” — which is true, it was an unidiomatic translation from German suggested by the European (mostly German) half of the Algol committee.
Very exciting stuff. I really love how, as an Elixir user, I’m going to benefit from the changes made here in a concrete way without any changes to my existing programs.
Elixir is in a unique spot when it comes to adopting stricter typing paradigms.Erlang and its descendants have a fundamentally stricter type system than OO dynamic language by default, as the set of built-in types is both all-encompassing and more concrete. Structural matching is widespread in the ecosystem and Elixir uses that as the basis for type-system features like structs and protocols, which is how you get the compile-time type-checking for “free” now. :)
For more info about Elixir’s type project, check out: https://elixir-lang.org/blog/2023/06/22/type-system-updates-research-dev/
I’ve found it really interesting to watch a static type system be added to an existing language. Many others have done it (Python, TS, etc) so it’s always cool to see how approaches are structured with the benefit of that hindsight.
I’m quite pleased that
unlessis on the way out. It’s an unnecessary duplication ofif !in the language grammar and I found it invariably harder to comprehend than anif. Not only that, it also creates an additional complication for code analysis tools like Credo.I’m guessing it was something that was originally borrowed from Ruby which has a very idiosyncratic (and in my view misguided) notion of readability and programmer convenience.
unlesscomes from CPL -> BCPL -> Perl -> RubyCPL and BCPL have eccentric conditional statements because Strachey had a fierce objection to the way “else” is used in Algol (et seq.), being “bad English” — which is true, it was an unidiomatic translation from German suggested by the European (mostly German) half of the Algol committee.
What a good decision.
unlessmight be one of my least favorite things in Ruby.Very exciting stuff. I really love how, as an Elixir user, I’m going to benefit from the changes made here in a concrete way without any changes to my existing programs.
Elixir is in a unique spot when it comes to adopting stricter typing paradigms.Erlang and its descendants have a fundamentally stricter type system than OO dynamic language by default, as the set of built-in types is both all-encompassing and more concrete. Structural matching is widespread in the ecosystem and Elixir uses that as the basis for type-system features like structs and protocols, which is how you get the compile-time type-checking for “free” now. :)
Could you expand on what these two properties mean?