I really would like to see a small language that compiles to wasm in the browser.
Of course you can use things like Lua that has it's own vm also in wasm. Or Rhai with it's own interpreter. But I am looking for a language that compiles to wasm in less than 1Mb of wasm
https://github.com/remko/waforth
> WAForth is entirely written in (raw) WebAssembly, and the compiler generates WebAssembly code on the fly.
https://github.com/remko/waforth/blob/master/src/waforth.wat
Janet, a Clojure-like Lisp compiles a whole playground of itself and the std lib in 823kb: https://janetdocs.org/playground
https://codeberg.org/veqq/janetdocs/src/branch/master/public...
you can do smaller for other things.
export let main = () => {
console.log("Hello, World!");
};
I'm trying to make that smaller. The binary includes the Console class, which is needed (I may be able to tree-shake the non log() methods away), but also the Error and IndexOutOfBoundsError classes which aren't needed because there are no catch() expressions.I think it really helps to have a language designed from the ground-up to obsess over bytes for WASM. Trying to do that with a familiar high-level language with a rich standard library is tricky.