I've use this. Slightly slower, but for my use case that was fine (a small blog) and immeasurably better doing away with all the CGO hassle. Especially when I might cross compile to an Arm architecture, or some docker container that uses a different approach to the c libraries (like Alpine vs Ubuntu Server or whatever) it was always a hassle, and thats all gone away now. Always seemed silly that one of the most popul…
>Always seemed silly that one of the most popular storage technologies couldn't be accessed with pure Go. I don't know why Google didn't pay someone to do this or do it themselves. Surely they use Go and sqlite together.
Go port of SQLite without CGo
31–40 of 122 posts
Re: Go port of SQLite without CGo
#32Earlier quoted context omitted.
at segment we benchmarked https://github.com/segmentio/ctlstore against this driver. We saw about a 50% hit to read performance, so we didn't move forward with it, but the improvements in service build times were really appealing.
Really tho, how much is build time vs runtime? Maybe is just work small projects but I rarely care about build time. Am I missing something?
Linters and IDEs get slow when they check for errors, tests run slow, feedback drags, and all your workflows that took advantage of Go's fast compile times are now long enough that your flow and mental context disappear.
I'm way more lenient with other languages since the tooling and ecosystem are built around long build times. Your workflows compensate. But Go's tooling and ecosystem assume it compiles fast and treat things more like a scripting language. When that expectation is violated it hurts and everything feels like it's broken.
Re: Go port of SQLite without CGo
#33Earlier quoted context omitted.
>Always seemed silly that one of the most popular storage technologies couldn't be accessed with pure Go. I don't know why Google didn't pay someone to do this or do it themselves. Surely they use Go and sqlite together.
Why would someone at google ever use sqlite?
Re: Go port of SQLite without CGo
#34Earlier quoted context omitted.
>Always seemed silly that one of the most popular storage technologies couldn't be accessed with pure Go. I don't know why Google didn't pay someone to do this or do it themselves. Surely they use Go and sqlite together.
Why would someone at google ever use sqlite?
Your comment truly does SQLite a disservice. SQLite is probably one of the most impressive pieces of software to have ever graced this earth.
Re: Go port of SQLite without CGo
#35I should mention that if you use this, somebody will eventually discover this line of code and be unhappy. https://gitlab.com/cznic/libc/-/blob/v1.22.2/libc_openbsd_am...
Re: Go port of SQLite without CGo
#36It's a really neat project. I did some simple benchmarks of it and it was between 10% slower to twice as slow. Which depending on your use case isn't that bad! https://datastation.multiprocess.io/blog/2022-05-12-sqlite-i...
Re: Go port of SQLite without CGo
#37Wait, so I can use sqlite and Go on Windows (yeah, I know) without gcc!?
Re: Go port of SQLite without CGo
#38Re: Go port of SQLite without CGo
#39If you cross-compile (which everybody using macOS to developer for Linux servers does), it's annoying to introduce SQLite to your project, because immediately the conventional `GOOS= GOARCH= go build` trick stops working. But, in case it's helpful, it's also really easy to set up a full cross-compiling environment, either with Zig or with Filippo's musl-cross: https://words.filippo.io/easy-windows-and-linux-cross-com…
export GOARCH=arm64
export CC=zig cc -target aarch64-linux-musl
export CXX=zig cc -target aarch64-linux-muslRe: Go port of SQLite without CGo
#40If you cross-compile (which everybody using macOS to developer for Linux servers does), it's annoying to introduce SQLite to your project, because immediately the conventional `GOOS= GOARCH= go build` trick stops working. But, in case it's helpful, it's also really easy to set up a full cross-compiling environment, either with Zig or with Filippo's musl-cross: https://words.filippo.io/easy-windows-and-linux-cross-com…
No one should touch servers directly, unless for down tracking stuff or remote development, in which case, they also don't need to cross compile.