[erlang-questions] Erlang VM in Rust

Anthony Ramine n.oxyde@REDACTED
Wed Sep 13 14:10:30 CEST 2017


C++ would never avoid crappy things from happening, such as silly data races because someone used a static variable in the middle of nowhere[1].

Rust would.

Rewriting something in C++ in the year of our lord of 2017 isn't the smartest move when there are better tools available. Well I guess it's good for job security, but there is Erlang itself for that already.

As for the emulator loop which requires computed gotos to be implemented, it could instead be generated from a higher-level description of the opcodes directly to an LLVM IR module, which would be faster to compile because the CFG would be less silly written by hand. Using LLVM IR is also something the JIT project I don't remember the name wants to do anyway.

As for what would Rust bring us (apart from a massive improvement of the memory safety of the whole VM), Rust allows people to be way more reckless when writing code, and that usually ends up with less runtime safety belts in the system [2].

I started writing a BEAM module loader in Rust (but I work on it only during holidays because I am actually busy at Mozilla working on things 10 years ahead of the rest of the world), and I think I found some issues in BEAM's code already. I will try to cook some BEAM compiled modules that weird out the VM in the near future.

[1]: https://github.com/erlang/otp/pull/643
[2]: http://www.randomhacks.net/2014/09/19/rust-lifetimes-reckless-cxx/

> Le 13 sept. 2017 à 03:30, zxq9 <zxq9@REDACTED> a écrit :
> 
> On 2017年09月12日 火曜日 17:05:33 Tristan Sloughter wrote:
>> Maybe Tony 'the tiger' Ramine would come back to working on Erlang if it
>> was in Rust!
> 
> Hey!
> I really like that guy.
> 
> Almost a good enough reason on its own. But I'm being selfish. ;-)
> 
> -Craig
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list