AstonJ
Inspired by Andrew’s post in another thread about types:
If the main benefit of static typing is to catch errors, and most people think it’s only a matter of time before AI will be so advanced they’d consider it a necessity, are types then even necessary? Could it be argued types may help in the short term but it’s only a matter of time when they will become superfluous and redundant?
- I think static-typing will always be useful
- I think static-typing will be useful for the short term
- I’m not a fan of static types/have no intention of (or don’t think I’ll be) using them/don’t think they are worth it now or will be in the foreseeable future (feel free to elaborate in thread)
- Other (please say in thread)
0
voters
(Please note this is a general discussion, not necessarily about Elixir)
Trending in Polls
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
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
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex











Showing Posts 1 to 10- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
dimitarvp
Static typing will be always useful because it reduces the problem search surface for any computer, be it a strict algorithm or an LLM. Less assumptions + more certainty = better solutions.
avi-turetsky
I voted other. 1) I think we’re a long ways away from LLMs/AI getting to the point where where types are superfluous. 2) As an engineer I’ve simultaneously enjoyed the wild west of Ruby and and more “locked down” languages with modern type systems. I could honestly go either way (right tool for the job, etc.). But I do think types will be invaluable for the next ~5 years. LLMs perform best when they have access to quick self correcting feedback loops. Right now types and tests serve that role.
jdiago
Here’s a screenshot from the Matz keynote at RubyKaigi 2025 where he talks about this very topic. My only wish is for better subtitles since the ones there are from the live translation during the talk so it’s a bit hard to understand the context.
Whole video here:
gtcode
Perhaps this should be in the related thread, but someone mentioned Scala as having a ‘next level’ type system. I asked G2.5P about this in ref to Elixir’s plans:
https://github.com/nshkrdotcom/notes/blob/main/A_TECHNICAL_DEEP_DIVE_INTO_SCALAS_NEXT_LEVEL_TYPE_SYSTEM.md
sodapopcan
LOL to be clear this was a joke
But ya, I actually didn’t even really consider if there was any truth to it. I think it will always be useful since vibe coding doesn’t sound fun (and I don’t really think it’ll take off like some think it will).
garrison
The main benefit of a type system is providing a clear format for documentation. After that, the main benefit of a type checker is ensuring the documentation is correct
After that, you get the additional benefit of quickly catching small mistakes as you write code, which is convenient for a tighter feedback loop.
Of course if the model is writing code for you then the documentation is for it rather than you, so the question is really “is documentation useful for LLMs?”, and thus far it seems like the answer is “yes, critically”.
Type systems and even unit tests are wholly inadequate for proper correctness testing, you need fuzz/property-based tests and, for distributed systems and things which touch the disk or network, you need a deterministic simulator as well. This requires putting at least as much creative effort into designing tests as you do into designing the program itself, if not more. I doubt current models are as yet capable of that, but who knows where the goalposts will end up!
cevado
One other that I like on the topic is this rant from Rich Hickey
the video excerpt from the rant(in the description has a link for the full talk
I have an impression that people that really like static typing are the ones that are attached to the editor. While people that prefers dynamic typing is more driven by the repl. whenever i’m working the first thing I do is start iex and then I start doing my changes and call recompile on the repl.
cevado
I guess the reason of my pet peeve with static typing is that very few typing systems that I had experience with had a good feedback loop(I guess only Elm was a pleasant experience). Most of the time I was trying to please the type system just to try and test some changes. But I really like the idea of types as first and foremost documentation.
garrison
If I don’t typespec my functions I eventually forget what shape of data they accept. Elixir is better than most in that we can pattern match/guard the signatures, but there are still glaring blind spots (you can’t pattern match
[{non_neg_integer, %MyStruct{}}]). For that reason, I look forward to the type system!Obviously you can also write docstrings but those are even harder to keep in sync with the functions; I find I often leave them out of date by accident in practice. That’s what I mean when I say the type checker is useful for ensuring the documentation is correct
cevado
I also write typespecs as documentation for the functions. One thing that I’d like to see in the new type system is the possibility to define types with literals other then atoms. it would be really good to explicitly work with functions that transforms external data. But althought the type system allows it, doesn’t seems that they’re going in that directon