Live data from Hacker News

Viewing profile — matklad

matklad

HN member
Joined
Mon, Feb 17, 2014, 6:26 PM UTC
HN karma
1,170
Public activity
207 items

About matklad

https://github.com/matklad

Recent public activity

  1. comment
    Comment #48845157

    Some thoughts on this here: https://matklad.github.io/2025/12/23/static-allocation-compi...

  2. 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…

  3. 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…

  4. story
  5. comment
    Comment #47100722

    Ha! I also use `line_number = line_index + 1` convention!

  6. 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!

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

  8. 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 …

  9. 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 …

  10. 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…

  11. 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 …

  12. 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…

  13. 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…

  14. 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…

  15. 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…

  16. 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 …

  17. 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…

  18. 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…

  19. 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 …

  20. 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 …

  21. 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…

  22. 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…

  23. 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 …

  24. 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_ …

  25. 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…