BEAM bytecode for types - are there any plans on adding more type information to the bytecode?

Hi, first of all, I’m very new to the ecosystem, BEAM is a phenomenal technology, with recent works in Elixir and Gleam, are there any plans/works on adding more type information to the bytecode, something along the lines of Supporting Dynamically Typed Languages on the Java, but the other way around? So, we can write code in Gleam and LSPs can infer a @spec from it and the other way around?

I think there is (at least) one thing you must be aware of and that is that modules are completely independent of one another so there is no way of enforcing the type of a function in another module which calls me. So while the compiler could generate a valid and useful @spec for an exported function the code generated for that function must be able to handle any types in the arguments. Another module can call it however it wants.

Is this likely to change: no!

2 Likes