Language page — context, influences, and learning notes on the 100hellos site.
Source on GitHub (100hellos/wat)
docker run --rm --platform="linux/amd64" 100hellos/wat:latest
Read the repo README, or fork the project and customize it.
For an interactive shell:
docker run --rm --platform="linux/amd64" --entrypoint="" -it 100hellos/wat:latest zsh
WAT (WebAssembly Text Format) is the human-readable text representation of WebAssembly bytecode. While WebAssembly is typically generated by compiling high-level languages like C, C++, or Rust, WAT allows developers to write WebAssembly modules directly in a text-based S-expression format.
WAT provides direct access to WebAssembly's low-level capabilities:
The WAT implementation uses WASI (WebAssembly System Interface) to interact with the host system:
(module
;; Import WASI functions for system interaction
(import "wasi_snapshot_preview1" "fd_write" ...)
;; Define linear memory for string storage
(memory 1)
;; Store "Hello World!" string at memory address 0
(data (i32.const 0) "Hello World!")
;; Main function sets up I/O vector and calls fd_write
(func $main (export "_start") ...)
)
This implementation uses Wasmtime, a standalone WebAssembly runtime that supports WASI for system interactions.
Content type
Image
Digest
sha256:5618e37e7…
Size
43.2 MB
Last updated
5 months ago
docker pull 100hellos/wat