Hacker News new | ask | show | jobs
by dmpk2k 1350 days ago
> so we should not expect any meaningful performance gain from typing Elixir code

but

> The Erlang compiler already does so to improve performance within a single module and we want to eventually do so across modules and applications too.

A bit confused by this. Will Elixir potentially embed types in BEAM files like Erlang increasingly does to inform the JIT, or not?

2 comments

That's a very good question. We could potentially do it, yes, but we would have to carefully benchmark and the benefits would still be limited to single modules (no cross module optimizations at the moment). So overall it is safest to not expect any meaningful gains. You will likely gain more by writing idiomatic code with patterns and guards. :)
I read it as even if extra type information was there the BEAM doesn’t use type information to optimise across modules.