I just got the basic example of 'add_one' at https://crates.io/crates/wasmer working.
One thing that confuses me from that page is the mention of multiple compiler passes:
Compilers (mutually exclusive):
singlepass
: it will usewasmer-compiler-singlepass
as the default compiler (ideal for blockchains ).cranelift
: it will usewasmer-compiler-cranelift
as the default compiler (ideal for development ).llvm
: it will usewasmer-compiler-llvm
as the default compiler (ideal for production ).
Here is why this is confusing to me.
-
If we are compiling from Rust to wasm, the wasmer compiler is not used right? because we use whatever the host systems' cargo --target=wasm32-unknown-unknown ends up using.
-
If this "compiler" is not referring to Rust -> wasm, what is it referring to? "wat -> wasm" ist just assembling right? (Are we running compiler optimization passes on wat -> wasm? That seems unlikely).
Thus, my question: wasmer has 3 options for compiler: singlepass, cranelft, llvm. Under what conditions is the wasmer compiler pass actually used ?