(module ;; Imports from JavaScript namespace (import "console" "log" (func $log (param i32 i32))) ;; Import log function (import "js" "mem" (memory 1)) ;; Import 1 page of memory (54kb) ;; Data section of our module (data (i32.const 0) "Hello World from WebAssembly!") ;; Function declaration: Exported as helloWorld(), no arguments (func (export "helloWorld") i32.const 0 ;; pass offset 0 to log i32.const 29 ;; pass length 29 to log (strlen of sample text) call $log ) )