How I Built Zig-SQLite

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

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.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • zig-sqlite

    zig-sqlite is a small wrapper around sqlite's C API, making it easier to use with Zig.

  • You _must_ provide a u16 bind parameter. However the value itself is of course not required to be comptime-known, that would make the whole thing unusable.

    For what it's worth there are in zig-sqlite variants of the method which bypass the comptime checks; they're not documented properly yet but see all methods named `xyzDynamic`, for example https://github.com/vrischmann/zig-sqlite/blob/master/sqlite....

  • zig

    General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

  • > * arbitrary file I/O. I can take my compile time data and write a python script to put it in a std::array, but I shouldn’t have to.

    https://ziglang.org/documentation/0.9.1/#embedFile

    I haven't tried, but because it should just be equivalent to a string literal you should be able to further process it using comptime as well.

    > * non-fixed-sized containers, ie vector

    One way is to just have a function count how many entries you need and use arrays. This is all pretty straightforward because comptime.

    Real dynamic comptime containers are dependent on making a comptime allocator available. There's a ticket for that: https://github.com/ziglang/zig/issues/1291

    > * a generic memoization utility in the standard library for caching. If I want my function to handle any input at runtime, but I want to pre-populate a cache at compile time for values that I know will be called, it’s doable but not as easy as it should be. (In general, given the amount of algorithms that rely on memoization, I’m somewhat surprised that Python is the only language I know that makes memoization as easy as a decorator).

    I don't think it's possible to use comptime to generate wrapper functions duplicating the signature of a given function, at least I haven't found a way to do so. The function signature has to be spelled out in the comptime code.

  • 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.

    InfluxDB logo
  • makelua

    Lua embedded to gmake

  • I first tried rust in 2015[1]. It was my first serious attempt at rust.

    The language was not small whatsoever at the time. It was not fun.

    [1]: https://github.com/motiejus/makelua/tree/rust

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts