sundi

sundi

Podcast: Elixir Wizards Podcast - Interview with José, Guillaume, & Giuseppe - [S10E12]

It’s the Season 10 finale of the Elixir Wizards podcast! José Valim, Guillaume Duboc, and Giuseppe Castagna join Wizards Owen Bickford and Dan Ivovich to dive into the prospect of types in the Elixir programming language! They break down their research on set-theoretical typing and highlight their goal of creating a type system that supports as many Elixir idioms as possible while balancing simplicity and pragmatism.

José Valim, Guillaume Duboc, and Giuseppe Castagna on the Future of Types in Elixir

Most Liked

josevalim

josevalim

Creator of Elixir

Great link. Let’s break it down.

First of all, what is a gradual type system? A gradual type system is achieved by getting a static type system and adding the “dynamic” type to it. In other words, in a gradual type system, if you don’t use the dynamic type, you should be able to reap all benefits of a static type system.

So are gradual type systems more complex? Not in theory. But in practice, as they are applied to dynamic programming languages, type systems end-up being more complex because dynamic programming languages are more expressive. A static language, without gradual types, that wishes to incorporate all expressive power found in dynamic languages would end-up equally complex!

This is one of the points I mentioned in my keynote: often type systems are used to restrict the power of a programming language. However, do we really want to restrict the power of Elixir and Erlang? No, we don’t. Therefore I don’t agree with the implied causation from Richard’s talk. Even if Elixir was statically typed from day one, it would have a complex type system because we want all of the expressive power it offers.

The complexity of a type system therefore depends on the expressiveness and the guarantees it wants to provide. It is likely that the Rust type system is more complex than the one we are working on for Elixir, but it does provide a different set of guarantees and expressiveness.

Another point from the discussion is that gradually typed languages have reduced runtime performance but that doesn’t have to be the case. Remember, if you use a gradual type system, but not the dynamic type, it should behave as a static one. This could be an optimization path to be explored. The Static Python paper offer some explorations in this front. Our work on gradual type systems also introduces a novel approach to reduce the overhead between dynamic ↔ static while remaining sound. It is a pity though that the leading language for gradual types, which is TypeScript, cannot explore those routes as it transpiles to JS (otherwise we would likely have seen more advancements in this front).

Finally, it is worth remembering that gradual typing is a relative young discipline. For example, Richard mentions dynamic programming languages have features that were not meant to be statically typed. However, that’s a static (no pun intended) observation of the current status quo. There were features which were seen as dynamic or objected oriented in the past, until we were able to develop the theory necessary for them to become part of functional or statically typed languages. In fact, our work on the type system so far was exactly in researching and developing new theory to support all of existing Elixir features. It is not that Elixir is too dynamic, rather it takes on-going and exciting new work to type it. And it wouldn’t be surprising to see characteristics which are currently common to gradually typed languages (such as structural typing) to become more common on statically typed ones.

So overall: why dynamic languages? Because they are more expressive. Gradual type systems help formalize many of their features and provide red squiggly lines without affecting our expressive power. They are an argument in favor of dynamic languages, not against them.

11
Post #5
josevalim

josevalim

Creator of Elixir

Thank you for sharing @sundi and thank you for having us!

I have been live-streaming on Twitch and today livestream will be a Q&A session about types with myself and Guillaume Duboc (the PhD student working on a type system for Elixir). Join us today 22:00 CET / 16:00 ET / 13:00 PT at Twitch.

Bonus points if you listen to the episode and come back with additional questions! The stream will be recorded and available for 7 days. :slight_smile:

type1fool

type1fool

Who knew a discussion about typing could be so fun? Thank you for joining us and for all of the hard work!

Where Next?

Popular in Podcasts Top

brainlid
In episode 55 of Thinking Elixir, Philipp Schmieder shares his experience of creating a LiveView application for a political party’s conv...
New
brainlid
Episode 125 of Thinking Elixir. While hearing how Elixir is being used in the Royal Bank of Canada’s Capital Markets, we learned a lot of...
New
brainlid
In episode 76 of Thinking Elixir, we talk with host David Bernheisel about his recently released Safe Ecto Migrations guide. Intended as ...
New
wolf4earth
Brian Underwood joins the mix to discuss his recent project where he created a game that would push more and more load onto a GenServer t...
New
brainlid
In episode 87 of Thinking Elixir, José Valim returns to continue with part 2 of our 5 part series as we count down to the 10 year anniver...
New
brainlid
In episode 98 of Thinking Elixir, Dominic Letz did something I thought was impossible. He got an Elixir application packaged up, approved...
New
brainlid
In episode 95 of Thinking Elixir, we talk with Philip Sampaio to understand the Rustler Precompiled project he created and what problem i...
New
brainlid
Some people excitedly talk about the “end of localhost development” when developer machines move to the cloud. Presumably this is better ...
New
brainlid
Episode 162 of Thinking Elixir. WebAssembly is an interesting technology that feels completely separate from Elixir. Patrick Smith create...
New
ancatrusca
Task.async(fn → Rust.performant() end) Elixir :handshake: Rust What actually happens when BEAM resilience meets Rust performance? Flor...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30840 112
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
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
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 47849 226
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement