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

sashaafm
Piggy backing a bit on @dvcrn topic BEAM optimization for functions with static return type?, I’ve been trying to understand in a deeper ...
New
kostonstyle
Hi all How can I compare haskell with elixir, included tools, webservices, ect. Thanks
New
Qqwy
I would like to spark a discussion about the static access operator: .. For whom does not know: it is used in Elixir to access fields of...
New
griffinbyatt
Sobelow Sobelow is a security-focused static analysis tool for the Phoenix framework. For security researchers, it is a useful tool for g...
New
restack_oslo
Hello, Please pardon me for any faux paux. I am 46 and this is my first time on a forum of any kind. I wanted to to get answers from tho...
New
sergio
There’s a new TIOBE index report that came out that shows Elixir is still not in the top 50 used languages. It also goes on to call Elix...
New
pillaiindu
In django there is a cache framework backed by memcached. Rails also puts a lot of emphasis on caching, and even the idea of russian-doll...
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
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
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
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement