DEV Community

maddie lim ✨
maddie lim ✨

Posted on

WebAssembly Hello World

played around with WebAssembly and wrote a simple hello world module in WebAssembly text format (WAT) using WebAssembly Studio!

(module
  (import "console" "log" (func $print (param i32 i32 )))
  (import "js" "mem" (memory 1))
  (data (i32.const 0) "hello, sparkles")
  (data (i32.const 15) "you are looking cute today :)")
  (func (export "main")
    i32.const 0
    i32.const 15
    call $print
    i32.const 15
    i32.const 29
    call $print
  )
)
Enter fullscreen mode Exit fullscreen mode

sketch: https://webassembly.studio/?f=0zvla8tncsy

WebAssembly Studio screenshot show hello world code

Oldest comments (0)