Viewing profile — matklad
matklad
HN member- Joined
- Mon, Feb 17, 2014, 6:26 PM UTC
- HN karma
- 1,170
- Public activity
- 207 items
- HN profile
- View on Hacker News ↗
About matklad
Recent public activity
-
comment
Comment #48845157
Some thoughts on this here: https://matklad.github.io/2025/12/23/static-allocation-compi...
-
comment
Comment #48842897
To add more context around lifetime errors and TigerBeetle's particular style guide: >Many projects opt to answer these kinds of questions through a style guide. TigerBeetle's Tige…
-
comment
Comment #48143056
To clarify, those are things an LLM considers to be issues, and LLMs can make mistakes. Some of those are clear false positives, others I need to revisit tomorrow to say one way or…
- story
-
comment
Comment #47100722
Ha! I also use `line_number = line_index + 1` convention!
-
comment
Comment #46793760
Thanks, I haven't considered this! My history is usually naturally project-scoped, but I bet I'll find ~/make.ts useful now that I have it!
-
comment
Comment #46445148
I assume you ment to write `assert(subexpression != undefined)`? This is resilient parsing --- we are parsing source code with syntax errors, but still want to produce a best-effor…
-
comment
Comment #46435137
In const recv_buffers = try ByteArrayPool.init(gpa, config.connections_max, recv_size); const send_buffers = try ByteArrayPool.init(gpa, config.connections_max, send_size); if the …
-
comment
Comment #46428544
>If you look at MITRE's top 25 most dangerous software weaknesses, the top four (in the 2025 list) aren't related to UB in any language (by the way, UAF is #7). FWIW, I don't find …
-
comment
Comment #46425985
They do make a lot of sense in other contexts :-) From the actual rules, only #2 (minimize preprocessor) and #10 (compiler warnings) are C specific. Everything else is more-or-less…
-
comment
Comment #46425673
There's some reshuffling of bugs for sure, but, from my experience, there's also a very noticeable reduction! It seems there's no law of conservation of bugs. I would say the main …
-
comment
Comment #46424316
See https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/TI... for motivation. - Operational predictability --- latencies stay put, the risk of threshing is reduced (_other_ a…
-
comment
Comment #46424220
To add more context, TigerStyle is quite a bit more than just static allocation, and it indeed explicitly attributes earlier work: > NASA's Power of Ten — Rules for Developing Safe…
-
comment
Comment #46424101
Yes, very good point, thanks! As a tiny nit, TigerBeetle isn't _file system_ backed database, we intentionally limit ourselves to a single "file", and can work with a raw block dev…
-
comment
Comment #46260164
It is the other way around --- it is _relatively_ easy to re-use the storage engine, but plug your custom state machine (implemented in Zig). We have two state machines, an account…
-
comment
Comment #46167512
It's not that ironic though --- the number of bugs that were squashed fuzzers&asserts but would have dodged the borrow checker is much, much larger. This is what makes TigerBeetle …
-
comment
Comment #46165576
You need to learn both. Both borrow checker (Rust) and comptime (Zig) are huge ideas worth getting your hands dirty with. If you don't have time to learn both, then learn Zig, as i…
-
comment
Comment #46080783
Just to avoid potential confusion, the claim is that this is a function that generates a random permutation: pub fn shuffle(g: *Gen, T: type, slice: []T) void { if (slice.len And t…
-
comment
Comment #46078314
It is much better than this. You can _directly_ enumerate all the objects, without any probabilities involved. There's nothing about probabilities in the interface of a PRNG, it's …
-
comment
Comment #45706577
I personally learned Zig by reading https://ziglang.org/documentation/master/ and stdlib source code once I joined TigerBeetle. enums.zig and meta.zig are good places to learn, in …
-
comment
Comment #45706539
Well said! Having a mental borrow checker running in background certainly helps a lot when coding in Zig. What also helps is that Zig safety checks generally catch lifetime bugs at…
-
comment
Comment #45706507
I strongly agree with your statement overall, but not in details. Regarding string manipulation, Zig has slices and comptime-checked `printf`, so that makes string handling _massiv…
-
comment
Comment #45705489
There's a change in the tradeoffs in the above scenario: - you still get extra benefit from Rust, but the magnitude of the benefit is reduced (e.g., no UAF without F). - you still …
-
comment
Comment #45437470
Yeah, there's actually trickiness here. Another curveball is that, with simulation testing, you generally want more assertions to catch more bugs, but slow assertions can _reduce_ …
-
comment
Comment #45050351
I used to think that way, but I've learned that there's one good reason for why the API is designed that way: priority inheritance. Priorities are bound to threads, and, when a hig…