josevalim
What are your concerns about a future type system for Elixir?
Hi everyone, as you may be aware, we are researching a type system for Elixir.
As preparation for my upcoming ElixirConf US talk, I would like to hear what are your concerns about Elixir adopting a type system in the future, hence this thread.
The goal of this thread is not to provide answers but simply have a general understanding of potential concerns and conflicts. Even if your concern turns out to not apply, it is important for us to know as it can be helpful material to include our guides and documentation.
I will establish some ground rules for this thread as an experiment:
-
Keep your concerns short, one to three sentences maximum. For example: “I worry the type system will make the compiler slower”.
-
Be precise if you can, avoid being too vague. For example, “I worry it will make Elixir bad” is too vague and therefore not helpful.
-
You may list at most your top three concerns.
-
Do not reply or comment on other concerns in this thread. If you agree with a concern someone else posted, feel free to “Like it” by clicking the heart button.
Let’s see how this goes, thanks. ![]()
Edit1: for those who say “what about those who prefer dynamic”, I suggest to dig a bit deeper. Why would you prefer to be dynamic? Assuming that types provide values, what worries you about static types that you would rather avoid them?
Edit2: for those wondering why types and how they would impact Elixir, I have talked about this during my ElixirConf EU keynote 2022.
Trending in Proposals
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #elixirconf-us
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #performance
- #security











First 10 of 87 Posts!
josevalim
rlopzc
Hello! Excited to hear about the type system. My main concern would be the adoption and gradual migration to this new type system. A big downside would be that you either migrate fully to types or can’t use them.
sodapopcan
Fragmentation and Rust-style drama (the “unsafe” Rust drama, not the political Rust drama… oh, Rust). IE, “How dare you write your library without types!” incidents. I worry it will bring in an influx of people to the community with a different mindset who will make a lot of noise and apply massive pressure to make major changes to the language. I’m not overly concerned about the second as I trust the core team there, but thought I’d voice it (sorry for the extra sentence).
keep_zen
I like the dynamic type,I worry the type system will lost the dynamic type style. Like typescript for JavaScript.
aayushmau5
I’m concerned about the syntax for defining types. It should be friendly to new/existing elixir devs while not being too verbose or too vague.
Eiji
How well type system would be integrated in future?
Would we be able to write a macros with a new dollar (
$) syntax just like we are doing now for@spec?Would we be able to read information about it from
beamfiles?For reference: Dynamically generate typespecs from module attribute list
Would we be able to write multiple
$spec like we did for@spec?This is supported by
ex_docand not supported bydialyzer?For reference: What is the idiomatic way to use @spec?
What would happen with
@specand what withex_doc?Would
ex_docprefer$over@specor maybe it would just present both of them?Would
@specbe deprecated in long term or it would be only recommended to use one over another?derpycoder
Verbosity in pattern matching is scary. (People are already asking me to break my non typed / non verbose pipelines!)
Hope we don’t have to include typedefs for libraries, like it happens with TypeScript projects.
If type system comes, it should be integral to the language, otherwise if it’s optional like @spec or proptypes in React, then my code base will be a mess. (I will become lazy about adding types, just like I leave out tests!)
polypush135
The biggest annoyance with strong typed languages from my past experiences has always been around inheritance vs composition and the way interfaces abstract the types for encapsulation and polymorphism.
Often times it has more to do with the choice of things people lump into the interfaces calling them abstractions because they don’t have a better place to put said thing.
None of this is a concern of accessibility of said feature but rather use and abuse of the feature.
I think it would be wise to educate as much as possible around good uses cases and anti patterns.
Thank you to all the devs who keep pushing this awesome language.
I’m sure what ever you choose its going to be great,
just let necessity drive innovation and the path will show itself.
muelthe
I don’t have any concerns.
In support of my comment, I am relatively new to programming and Elixir is the first language I worked with.
Edit: for clarification i.e. I do not fully understand the ramifications.
Fl4m3Ph03n1x
I worry that:
Last Post!
josevalim
Thank you everyone for sharing your concerns/worries.
If folks want to continue the conversation in a new thread, you are more than welcome! Meanwhile this is more than enough to cover the most common concerns during my presentation, thank you! 