Just use zig as your c compiler and it all just works.
The only proper way to use sqlite is to use FFI.
Obviously it "works" and they didn't "just" transpile it but spent quite a bit of effort on this. Whether it's free of bugs that are not present in SQLite is a different matter. And while it's not run against the SQLite proprietary tests, it does pass all of the TCL tests IIRC, which are quite comprehensive on their own, so there shouldn't be huge glaring bugs.
But yeah it does give me a little shiver to think you are transpiling C code to go code, and the go-code is not really "pure go", but has a platform-dependent unsafe operations. Just look at the repo
https://gitlab.com/cznic/sqlite/-/tree/master/lib?ref_type=h...
It is a less battle-tested C compiler, sure, but it's a C compiler. IMO, you can't argue that something shouldn't be called sqlite because it contains a transpiled copy of sqlite. To me this isn't really substantially different from transpiling sqlite to JS using Emscripten.
Which one do you mean? The WASM one? It includes WASM, it needs to be compiled too.
Ah github.com/cvilsmeier/sqinn-go. Which... is made by the same person that made this benchmark...?
edit: and that requires some random binary to be pre-installed...? Which is in C anyway?
https://github.com/cvilsmeier/sqinn-go
https://github.com/cvilsmeier/sqinn
so I don't see any "actually written in go".
Also, although I do (lightly) patch SQLite which might invalidate results in your view, the SQLite team is producing/testing/releasing WASM builds of SQLite built with much the same toolchain, which, hopefully, smokes out compiler bugs.
[1]: https://github.com/ncruces/go-sqlite3/blob/main/.github/work...
(OP here) Honestly, me too. Maybe it has to do with leaving out that database/sql driver layer. I guess it would need another round of pprof to find out the real reason.
> modernc, modernc.org/sqlite, a pure Go solution. This is a newer library, based on the SQLite C code re-written in Go.
Unless I'm mistaken, this is not a re-write in Go. This is a transpilation of the the SQLite C library into go, using https://gitlab.com/cznic/ccgo