Hacker Newsnew | past | comments | ask | show | jobs | submit | nhatcher's commentslogin

Aaron Swartz has a nice blog post about it[1].

It's been discussed several times on HN[2]. I had periods I go through without news. It's been harder to do that lately.

[1]: http://www.aaronsw.com/weblog/hatethenews

[2]: https://hn.algolia.com/?q=i+hate+the+news


I submitted that link. In all fairness the link in this post is more accurate. I'm glad to see people are interested. Let's see where all this goes.

Eli Bendersky's post are always insightful and interesting.

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


If you're open to Forth,

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


Ben Lynn's page https://crypto.stanford.edu/~blynn/compiler/ compiles (a large subset of) Haskell to web assembly (which you can download; a prime number sieve yielded 40KB of code) and runs it in the browser.

That is exactly the kind of thing I was looking for. Thanks you!

WebAssembly Text Format (wat) is fine to use. You declare functions that run imperative code over primitive i32/i64/f32/f64 values, and write to a block of memory. Many algorithms are easy enough to port, and LLMs are pretty great at generating wat now.

I made Orb as a DSL over raw WebAssembly in Elixir. This gives you extract niceties like |> piping, macros so you can add language features like arenas or tuples, and reusability of code in modules (you can even publish to the package manager Hex). By manipulating the raw WebAssembly instructions it lets you compile to kilobytes instead of megabytes. I’m tinkering on the project over at: https://github.com/RoyalIcing/Orb


I'm working on a TypeScript/Swift/Dart style language, and currently this hello-world is 1444 bytes:

    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.


you can just compile c/c++ to wasm in the browser - there are wasi/emscripten builds of clang itself around (yosys, clang-repl, etc).

Yes, those are fascinating technologies. But way too big to be running in a small app in the browser.

> compiles to wasm in less than 1Mb of wasm

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.


C based Mandelbrot WASM demos can be ~1 KB total. Assuming you mean a simple scripting language though, Assembly Script does exactly that.

AssemblyScript ships its own garbage collector and doesn't seem to making progress on supporting WASM GC.

AssemblyScript in general seems to have stopped making much progress. Unless you benefit greatly from having exact width numeric types it's very difficult to justify using it over normal TS.

Sorry! It was too beautiful not to share it. But I'm sure you can do a show HN once you think is ready.

That's okay, thanks for sharing!

Gossip tense has been discussed here:

(276 points and 255 comments) https://news.ycombinator.com/item?id=41793485


You’re the inspiration, my friend.


Those happen. Best wishes for 2026


Happy new year from Indore, India

https://app.ironcalc.com/?model=OIDKt-KaOnt-52CaU


Some heartfelt comments on that thread. Also interesting his first blog post:

https://kivooeo.github.io/blog/first/


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: