Skip to content

Comment on How I Built Zig-SQLiteparent

Comments

So, yes, it'd be nice to have an implementation of SQLite3 in some non-C language. However, that's a tall order.

And here you're proposing Zig while someone else will prefer Rust, and someone else Go. So you'll need N>1 rewrites.

This is why SQLite3 is written in C then, because for all the ways in which C sucks, it is the most common (lowest) denominator that ticks the portability checkbox.

Language runtimes that want to not have a C runtime embedded are the hardest hit. The best thing to do for those in the short-term is to talk to a C-coded IPC service that runs the C-coded thing that otherwise can't be run.

because for all the ways in which C sucks, it is the most common (lowest) denominator that ticks the portability checkbox.

This is actually something that Zig is supposed to do as well. There should be nothing that you can do in C but can't do in Zig. So hypothetically, in the future (say, twenty years from now), a Zig implementation of SQLite could be a preferred one since you're not losing anything with it. (With the additional benefit that should you want to, you might be able to compile application-specific queries into it.)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.