So I'm familiar with the fact that the supported language for EOS smart contracts is C++. However, the EOS docs mention that even the C++ needs to compile down to WebAssembly.
So my question is, could I write my EOS smart contract in Rust, and use a crate to compile my Rust into Web Assembly? (A very loose example of compiling Rust to WebAssembly can be found here).
Or is a C++ compiled .wasm
file significantly different from a Rust compiled .wasm
file? (I really want to write EOS smart contracts, but I'm hoping I can just use my existing Rust knowledge, as opposed to having to learn C++)
UPDATE (post-accepted answer): Info from a similar HackerNews thread, answered by a member of the Rust core team:
So, a .wasm file can call into functions defined by its host environment; this is often a browser but in your case, it’s the EOS VM. The trick is letting Rust know what those functions are so you can call them. wasm-bindgen should have you covered there.
Beyond that, it’s all the same; the VM can’t care what the original language is.