top | item 46996869

(no title)

bartblast | 17 days ago

To clarify - Hologram's runtime is heavier than Gleam's, but that doesn't mean it's heavy. The compiler does tree-shaking, bundling only the code your app actually uses, so you're not shipping the entire reimplemented runtime to the browser.

As for the WASM bytecode interpreter idea - you'd run into the same problems I described in my earlier comment. Even a minimal interpreter compiled to WASM tends to land in the multi-MB range once you include enough of the runtime to be useful. You still can't touch the DOM from WASM, so every UI update crosses the JS bridge with serialization overhead. You lose the ability to surgically call native browser APIs (like built-in Unicode support) instead of bundling your own. And you lose readable output, which matters for debugging.

discuss

order

dnautics|16 days ago

gleam doesn't run a bytecode interpreter in wasm! i think it compiles straight to rust? which is why there are some leaky as hell abstractions.

bartblast|15 days ago

Gleam is written in Rust but compiles to Erlang (BEAM) or JavaScript - I mentioned the JS compilation in my previous comment. The WASM point was a response to your bytecode interpreter suggestion, not about Gleam.