arcanemachine

arcanemachine

Jose Valim: "Elixir is, officially, a gradually typed language"

https://nitter.net/josevalim/status/1744395345872683471

https://twitter.com/josevalim/status/1744395345872683471

Most Liked

josevalim

josevalim

Creator of Elixir

You misread his reply but keep in mind this is not a good way to approach the discussion. We will definitely make mistakes as we implement the type system and I hope the feedback will be more constructive than the above.

Engage constructively. If you think it is bad, just don’t say it, argue your case with examples. Provide context and propose alternatives if possible.

josevalim

josevalim

Creator of Elixir

We have been considering these aspects for sure, but it is too early to focus on them in general, given we are still working on the semantics of the type system.

We have discussed this a couple times, so I am not going to rehash all points again, but there is already too much that can happen in function clauses and we don’t want to add more. I bet no one want to see this code:

def foo({_, _} = bar \\ {:foo, :bar} :: {atom(), atom()}) :: integer()

Furthermore, a function specification and its implementation are two separate things. In Typescript, you can’t have multiple clauses (afaik). In Elixir, if we tie the specification to the clauses, there is a chance you will accidentally change the specification when moving clauses around and when refactoring code, and by doing so you will get in the way of the type system.

At this moment, I’d say we should put signatures after the docs and grouped immediately before the first clause, since they help both with the documentation and code. And I want them grouped because I want a unified view of how my function behaves and not scattered across multiple lines.

But maybe I will change my mind in 6 months or in 2 years. In order to figure out the best approach, we will need to try and explore things. It hasn’t been a week since the compiler got a rudimentary understanding of types and type signatures certainly won’t happen this year.

Now it is definitely too early. All we are asking for is patience, patience with our work, and patience between yourselves. Let’s not rush this. The worst we can do is to standardize into something sub-optimal because we were too quick to settle.

josevalim

josevalim

Creator of Elixir

Thank you @Fl4m3Ph03n1x!

To align everyone’s expectations, our goal is to perform inference of all patterns and guards by Elixir v1.17, as outlined here: Type system updates: moving from research into development - The Elixir programming language

There are still no typing syntax or changes to the language. :slight_smile: And there is still a chance we won’t go forward with this. But this is a very exciting step for sure.

Where Next?

Popular in Discussions Top

thojanssens1
It would be nice to be able to define a redirect from one route to another from the router.ex file. E.g.: redirect "/", UserController, ...
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
Ankhers
Just a little information upfront. Generally speaking, if I feel like I need to either break a pipe chain or use an anonymous function in...
New
rower687
Hi all, I’ve been reading a lot about the “let it crash” term and how supervising processes and the whole messaging passing make an elixi...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
PragTob
Hey everyone, this has been on my mind for some time and I’d love your input on it! TLDR: I feel like maps are superioer for storing and...
New
eteeselink
Hi all, In the last days, two things happened: A blog post titled “They might never tell you it’s broken” made the rounds. It’s about ...
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
axelson
Decided against including more info in the title, but the gist is that Plataformatec sponsored projects will continue with the assets bei...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29603 241
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement