https://pine32.be - © pine32.be 2026
Welcome! - 125 total posts. [RSS]
A Funny little cycle 2.0 [LATEST]


Search 125 posts with 52 unique tags


#1780951065


[ golang | wasm ]

In post 1757190021 I talked about the special SQLite lib I am using based around embedded wasm. A couple of months back, the library made a move to a new architecture. No more wasm but still no CGO. The solution: transpile a wasm build of SQLite to pure go code and compile that into your library. This gives us more type safety and better maintainability because the wasm build can be used as a “normal” go module. Also the boot time for applications is better because there is no waiting for the wasm module to load and “boot”. One downside is a clean build getting slower because you are rebuilding SQLite fully (still faster than any Rust build). Also the resulting binary is a bit bigger. But this is still a valid trade off to have no CGO dependency. I will keep using this library.

The transpiler, wasm2go, is also available for general use. I want to try it with libvips for one of my projects. But for now SIMD is not supported, not until the go api for it is stable. I could also build libvips myself with SIMD disabled but that sounds like work and messing with C build systems. So I will just wait, I’m not in a hurry.