Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Script Interpreter using the spectest module

Given the following print.wast file:

(module

  (func $print_i32 (import "spectest" "print_i32") (param i32))

  (func $main
    i32.const 42
    call $print_i32
  )

  (start $main)
)

You can print the value thanks to the print_i32 function imported from the spectest module:

$ owi script ./print.wast
42