AstonJ

AstonJ

In an age of AI, is static typing even necessary?

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)

Most Liked

dimitarvp

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.

11
Post #2
avi-turetsky

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

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:

garrison

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 :slight_smile: 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

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.

Where Next?

Popular in Discussions Top

New
fklement
This is a thread to gather some information about the efforts of using elixir in combination with cars or vehicular systems in general. ...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
AstonJ
Have you changed the way you learn? Maybe you started off using docs and tutorials and are now an avid book reader or course watcher? Or ...
New
AstonJ
@Garrison’s comment in another thread reminded me of this post by Joe: With the big five exerting more control than ever, new (AI) play...
New
tcoopman
Yesterday I watched OpenTelemetry: From Desire to Dashboard and it triggered me to take a new look at telemetry in Elixir. But I don’t k...
New
sym_num
I created a Forth processor in Elixir. This is my hobby project. https://github.com/sasagawa888/Forth
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
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
sergio
Laravel just announced their Series A round for $57 million. If Laravel wasn’t already the defacto PHP stack, it now most certainly is. T...
New

Other popular topics Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New

We're in Beta

About us Mission Statement