register('', 'putc', Extern::Func(FuncInst::Host(new FuncType([ValType::I32], []), function (Runtime $runtime, int $c) { printf('%c', $c); }))); $runtime = Runtime::instantiateFromStream($wasmBinaryStream, $linker); $runtime->invoke('main', []);