Working on my WASM-first language during some downtime today. Just added dead-code elimination.
export let main = () => 42;
now compiles to:
(module
(type (func (result i32)))
(export "main" (func 0))
(func (type 0) (result i32)
i32.const 42
)
)
I think this is as small as possible!
Feb 1, 2026 00:11This isn't notable on its own, but the language has standard library that backs a lot of the syntax: Strings, Arrays, Maps, Records, plus Box, Console, etc., etc... and all of that is implicitly imported, but only output to the binary if it's used.
And the binary is 41 bytes!
From my experience on the Dart team a long time ago, it's super important to focus on small binary size really if that's a project goal. You might want that goal to inform the language design before you ship.
Here's a trickier example:
export main = () => "hello";
That uses the String class, and since WASM doesn't have strings, we need to export functions to read the length and byes from strings.
Output is still very small!