I've been studying WebAssembly, and I have a basic (naive, probably) question. How does IO fit into the WebAssembly/host VM picture? There seem to be no WASM constructs (e.g., opcodes) for handling simple IO operations like printing something to the screen. In implementations of WASM, is there always expected to be a higher level language, like Javascript, mediating between WASM and the host VM to take care IO and such?
You are correct, WebAssembly itself has no IO capabilities. It only has access to linear memory and functions that are imported / exported by the host environment (JavaScript when hosted in the browser). It is these imported functions that allow WebAssembly modules to perform IO operations indirectly. This is by design, WebAssembly will never gain instructions that permit direct IO. However, with the host bindings proposal the mechanics of indirect IO API access will become simpler in the future.