Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
homebrew-musl-cross
Homebrew Formula for static-friendly musl-based GCC macOS-to-Linux cross-compilers
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
No, but that has the disadvantage of being C compiled into Go, then being compiled into native executable.
I'm actually surprised by how readable this came out; props to the Go->C compiler author. But you can guess that pushing this sort of thing through the Go compiler is going to cause some slowdowns due to sheer paradigm mismatch: https://gitlab.com/cznic/sqlite/-/blob/master/lib/sqlite_lin...
I don't think I understand what the argument for that is, because I've only ever heard it articulated as "cgo isn't go" which doesn't really convey much information.
Is this go? https://gitlab.com/cznic/libc/-/blob/master/libc_openbsd.go?...
I mean technically I suppose it is code that conforms to the go language grammar, but I'm not sure why a language purist would accept this.
Or with musl-cross:
https://github.com/FiloSottile/homebrew-musl-cross
It works pretty well! It's a thing you might keep in your back pocket to test builds from your ARM dev machine on a dev host, and then let the CI/CD system build the real version later.
Sqinn author here. Nothing against CGO, but I develop/deploy on Win/Linux, and cross-compiling CGO is very painful. Regarding performance: To my own surprise, Sqinn out-performs mattn (and others) for normal workloads, see https://github.com/cvilsmeier/sqinn-go-bench
I think it's a somewhat unfair (though who cares if it's unfair) comparison because you aren't using the database/SQL interface and mattn does.
If you drop that interface, you get much better performance.
See: https://github.com/eatonphil/gosqlite for example.
It is slower.
The WASM runtime wazero [1] uses a compiler on amd64 and arm64 (on Linux, macOS, Windows, and FreeBSD), but the current compiler is very fast (at compiling), but 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.
[1]: https://wazero.io