clojure-norway 2026-10-14

Is the Elixir compiler a sort or add on linter? I thought Elixir didn't need compilation

Elixir compiles to BEAM bytecode. Same as Erlang.

And Elixir has also had “gradual typing” for ages.

Ages? A few years right

🤔 1

Wasn't it since the start? Hmmm. Checking…

No they made it a whole academic project a few years ago

👀 2

I came to Clojure from Elixir, and ran the Erlang/Elixir Meetup group in Oslo. But I forgot a lot since I haven't used it since 2020, which is when @gaute led me to Clojure ☺️

Yeah, I think you're right. I must be getting it twisted with something else in my brain.

Ah. My bad! I was thinking of @spec and @type annotations, i.e., what is called https://elixir.hexdocs.pm/1.20.4/typespecs.html (the same that Erlang has). That has been around since July 2013 (v0.11.0) August 2012 (v0.6.0). Sorry for adding confusion.

Which is also similar to what Erlang has.

Jeg kjenner mange som kommer til å like talken fra @neumann når den slippes! For meg satte den et par ting på plass om hvordan Rich og Clojure-teamet tenker. Solid nr 2 for meg på Func Prog Conf var fra Giuseppe Castagna og Guillaume Duboc om hvordan Elixir har adoptert set theoretic types. Laget for å funke med gradual typing, og siste 3 Elixir-versjoner har hatt det innebygd. Men uten å kunne skrive typeannotasjoner! Så alt som skjer i dag er at kompilatoren gir warnings når den kan bevise at noe er gæli. Litt som hva Kondo gjør for oss i dag, bare grundigere.

🔥 1
🙌 6

I really enjoyed @neumann's talk. We got a trial run last week. So many things I think about when I think of software makes sense through the lense of finite and infinite games.

➕ 2

@borkdude according to the talk, the type checker (they called it type checker, not compiler) does not change any compiler behavior. It only emits warnings when it finds a type problem. Kind of like clj-kondo!

yeah so basically a linter add-on type of thing

maybe akin to typed clojure?

Yeah, that too!

Type checking is based on set theoretic types. Essentially, the type of an arg or return value is the set of values it can have. That opens for the dynamic() type, which is the set of all values.

💡 1

There's an interesting blog post on it on the Elixir homepage: https://elixir-lang.org/blog/2026/06/03/elixir-v1-20-0-released/

👍 3
👀 1

And the story! This French professor has researched type theory (set theoretic types) for 20 years across five PhD theses. It just fits better than traditional "type everything" approaches for dynamic languages. And Jose just goes ahead and gets it into Elixir! Just think about it, you believe you've done your job in research, but then industry suddenly decides to take your life's work seriously. And TypeScript sounds similar, right? Surface level only! TypeScript's type system isn't sound. In other words, typescript sometimes lies about the types of values, in which case a programmer must help the type checker. Elixir's types are sound, meaning they don't lie. Only they sometimes can't know the precise type of a value, which is necessary due to Elixir's dynamic nature; the same would hold for Clojure. Jose had tried reading Giuseppe Castagna's papers, but it was just math. So why not just let the researchers bring their theory into the world! And Jose was the one who forced through "we cannot start by introducing type annotations. We shall provide value to existing codebases without any changes required." You can just hear Rich's ethos echo in that approach! "Could the same work for Clojure?" is the obvious next question, and I think the answer is yes.

For this to work properly you do need macro-expansion so it has to be something with actually loads your program in a runtime, right? Is this what elixir's thing is doing or does elixir not support macros?

Macros are a good point. I don't know how they solve that part. Elixir does have macros, so presumably they have an answer.

> This French professor has researched type theory (set theoretic types) for 20 years across five PhD theses. Ah! I vaguely recall José Valim talking about that on some podcast a while back.

yeah I heard it too, it's cool

Elixir has macros, but https://elixir.hexdocs.pm/macros.html#write-macros-responsibly might be relevant for how it works with the type system. In particular: > In Elixir, a macro must be explicitly invoked in the caller during compilation time.

@teodorlu @slipset I'm glad my talk made and impact and got you thinking. Thank you both for your support. Erik, thanks so much for setting up the talk for Ardoq, and spending a lot of time with me there. Teodor, thanks for your encouraging words and sitting up front and giving me energy from your smile.

❤️ 4
💜 1