What approach is used here? WebAssembly (or something similar)? I see a bunch of huge Go files with architecture names.
Go port of SQLite without CGo
41–50 of 122 posts
Re: Go port of SQLite without CGo
#42If 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…
Cross compiling with zig is so easy. For example I use sqlite in Go projects on arm. The incantation is just: export GOARCH=arm64 export CC=zig cc -target aarch64-linux-musl export CXX=zig cc -target aarch64-linux-musl
Re: Go port of SQLite without CGo
#43Earlier quoted context omitted.
What makes it slower?
It’s hard for Go to beat C in a straight benchmark - Go is garbage collected and allocations often have extra overhead due to the memory layout of interfaces.
Re: Go port of SQLite without CGo
#44Earlier quoted context omitted.
It’s hard for Go to beat C in a straight benchmark - Go is garbage collected and allocations often have extra overhead due to the memory layout of interfaces.
In addition, a lot of optimizations (like loop unrolling) are left on the table to preserve Go's fast compile times.
Re: Go port of SQLite without CGo
#45If 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…
Not really, unless you're talking about specific Go developers, and even there, that is what the CI/CD pipeline is for. 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.
Re: Go port of SQLite without CGo
#46Why would you want to do this? SQLLITE is so stable. Why would you switch to some port that will be dead in a year?
Re: Go port of SQLite without CGo
#47I'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…
Pretty much any database is NOT written in Go, so what's the difference?
Re: Go port of SQLite without CGo
#48Re: Go port of SQLite without CGo
#49What’s the point of something like this instead of just using SQLite? Seriously, “foo but in bar!” is not exactly the sort of thing that solves real problems for most people.
Re: Go port of SQLite without CGo
#50What’s the point of something like this instead of just using SQLite? Seriously, “foo but in bar!” is not exactly the sort of thing that solves real problems for most people.