2 ms·
The key difference between x64 and the BEAM is that the BEAM does dynamic type checking on the fly no matter how thoroughly you type check your code ahead of ti
by lolinder 3y ago
The key difference between x64 and the BEAM is that the BEAM does dynamic type checking on the fly no matter how thoroughly you type check your code ahead of time. x64 just sees bytes, so if you want to leave off type checking you can, hence the performance gains.
EDIT: Also, when I go to look for this quote I can't find it. Did you somehow end up on last year's announcement of an upcoming type system for Elixir [0]?
[0] https://elixir-lang.org/blog/2022/10/05/my-future-with-elixir-set-theoretic-types/ https://elixir-lang.org/blog/2022/10/05/my-future-with-elixi...
- JonChesterfield 3y agoPeople did not like that example choice. The type checking beam does can coincide with the checking the source language does but that's not fundamental. Say you compile SML to beam. Would you conclude that the compiler isn't able or allowed to do anything with the types in the source language?
- lolinder 3y agoI'm not sure where you're going with that. I'm not saying that a compilation has to be 1-to-1, I'm saying that Erlang's VM will always spend cycles type checking at runtime regardless of how thorough your compiler is. And I believe that's all José is saying in the article you're quoting from.
- JonChesterfield 3y agoThe code the VM spends time checking is different if the source language compiler emits different code, such as if it uses type information instead of discarding it, and different code has different runtime performance.
- JonChesterfield 3y agoIt's in a sibling post about type systems, not in the op, and I have an off by one in where I have replied to