What Is Wasm

  • Bytecode
  • Needs VM

# #![allow(unused_variables)]
#fn main() {
#[no_mangle]
pub fn double(n: u32) -> u32 {
    n * 2
}
#}
(module
  (type $t0 (func (param i32) (result i32)))
  (func $double (export "double") (type $t0) (param $p0 i32) (result i32)
    (i32.shl
      (local.get $p0)
      (i32.const 1)))
  (table $T0 1 1 funcref)
  (memory $memory (export "memory") 16)
  (global $g0 (mut i32) (i32.const 1048576))
  (global $__data_end (export "__data_end") i32 (i32.const 1048576))
  (global $__heap_base (export "__heap_base") i32 (i32.const 1048576)))