3 ms·
Does compiling to WASM, using a cgo free WASM runtime, and replacing the OS layer (VFS) with portable Go code count? That's the elevator pitch (so far) for: ht
by ncruces 3y ago
Does compiling to WASM, using a cgo free WASM runtime, and replacing the OS layer (VFS) with portable Go code count?
That's the elevator pitch (so far) for:
https://github.com/ncruces/go-sqlite3/tree/main https://github.com/ncruces/go-sqlite3/tree/main
- tedunangst 3y agoYeah, that's cool. :) although probably a bit slower running through an interpreter. Modernc/libc takes a rather different approach. It's got some pretty funny files in it. https://gitlab.com/cznic/libc/-/blob/master/musl_openbsd_arm64.go?ref_type=heads https://gitlab.com/cznic/libc/-/blob/master/musl_openbsd_arm...
- ncruces 3y agoIt is slower. The WASM runtime https://wazero.io https://wazero.io has a compiler on amd64 and arm64 (on Linux, macOS, Windows, and FreeBSD), but the current compiler while very fast (at compiling), is very naive (generates less than optimal code). An optimizing compiler is currently being developed, and should be released in the coming months. I'm optimistic that this compiler will cover the performance gap between WASM and modernc.