News for hackers. Stuff that matters.
Re:What if the browser was the server? by quirissum on Tuesday May 12, 2026 @07:53AM (#48106944)
I explored the idea of shipping a full backend to the user using WASM-compiled Go, SQLite and OPFS. The whole thing is delivered via a URL but runs entirely on the user's machine.

Live Demo: https://localtrack.arthurcornil.com/ GitHub: https://github.com/arthurcornil/localtrack

Re:What if the browser was the server? by gamebak on Tuesday May 12, 2026 @07:58AM (#48106999)
I think a lot of companies already trying to use this stuff, not SQL related but rather focusing more on the frontend. In reality, this causes more issues, like data fragmentation, versioning between different versions, security and at the end of the day it's a either a dev cost or server cost to implement this.

Usually, server costs are much much cheaper than dev cost to implement all this into FE, but it's a viable thing for the future.

Re:What if the browser was the server? by billconan on Tuesday May 12, 2026 @08:05AM (#48107077)
how is this different from service worker?
Re:What if the browser was the server? by ncruces on Tuesday May 12, 2026 @02:11PM (#48112031)
How's the performance? My Wasm-under-Wasm tests became slow since I transitioned to the wasm2go transpiler, but I wonder if that's an artifact of repeated slow compilation (rather than execution) of tests.
Re:What if the browser was the server? by quirissum on Wednesday May 13, 2026 @02:18AM (#48118450)
For my use case (small datasets), query execution feels instant. No perceptible lag between user action and result. Though I haven't done formal benchmarking. The initial load time is the bottleneck, not query execution. Whether that's the transpiler or just the Go runtime overhead I can't say without proper benchmarking.
Re:What if the browser was the server? by ncruces on Wednesday May 13, 2026 @03:47AM (#48118996)
Thanks! Yeah, I guess on the web it would always manifest as load time.

But order of magnitude, with everything cached, on a decent laptop/desktop, is it a few seconds, or a minute?

Because what I get from testing in CI is every test takes a minute.

Re:What if the browser was the server? by quirissum on Wednesday May 13, 2026 @10:06AM (#48122083)
With everything cached in production (compressed) it takes ~100ms to load the binary.

Total global initialization including Go runtime startup and SQLite connection takes ~280ms on an M1 MacBook Pro.

So well under a second end to end with a warm cache.

Re:What if the browser was the server? by ncruces on Wednesday May 13, 2026 @01:33PM (#48124926)
That's good to know, thanks!

It makes this quite realistic, which might mean a good/great OPFS VFS (like Roy's) actually starts to make sense.

https://github.com/rhashimoto/wa-sqlite/discussions

Unfortunately I'm not knowledgeable enough on the browser side of things to advance something like that, and have quite a bit on my plate already. But if there's interest I can help demystify the SQLite/VFS side of things. Feel free to (e.g.) open a GitHub discussion on my repo to track this.