-
zig
General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
-
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.
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....
> * 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.
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