Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
matklad
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
matklad
26d ago
The goal always was to refactor rustc to make compiler-based LSP feasible. The idea of original RLS, "we'll just use the compiler", is fundamentally sound. It's just that you'll need to turn the compiler sideways to
2.
▲
by
matklad
26d ago
I can shed some light here! This is going to be longish comment, but hopefully by the end of it you should understand _why_ we decided to avoid using the disk initially, even if you don't agree with that decision. Historically, the dec
3.
▲
by
matklad
26d ago
To clarify, author is https://github.com/popzxc , not me! My thoughts are here: https://matklad.github.io/2026/08/21/rust-glancer.html
4.
▲
Rust Glancer: Rust LSP using 100x less RAM
(rust-glancer.github.io)
423 points
by
matklad
26d ago
|
112 comments
5.
▲
by
matklad
2mo ago
Some thoughts on this here: https://matklad.github.io/2025/12/23/static-allocation-compi...
6.
▲
by
matklad
2mo ago
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 TigerStyle is an example in Zig and Google's 3
7.
▲
by
matklad
4mo ago
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 another.
8.
▲
Automation That Screams Joy
(tigerbeetle.com)
9 points
by
matklad
5mo ago
|
0 comments
9.
▲
by
matklad
7mo ago
Ha! I also use `line_number = line_index + 1` convention!
10.
▲
by
matklad
8mo ago
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!
11.
▲
by
matklad
9mo ago
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-effort syntax tree. Although expression is required by the gramma
12.
▲
by
matklad
9mo ago
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 second try throws, than the memory allocation c
13.
▲
by
matklad
9mo ago
>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 this argument logically sound, in context.
14.
▲
by
matklad
9mo ago
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 universally applicable.
15.
▲
by
matklad
9mo ago
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 effect here is that global allocator often le
16.
▲
by
matklad
9mo ago
See https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/TI... for motivation. - Operational predictability --- latencies stay put, the risk of threshing is reduced (_other_ applications on the
17.
▲
by
matklad
9mo ago
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 Safety Critical Code will change the way you code foreve
18.
▲
by
matklad
9mo ago
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 device or partition, without file system involve
19.
▲
by
matklad
9mo ago
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 accounting one, and a simple echo one here: https://gith
20.
▲
by
matklad
10mo ago
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 context somewhat special --- in many scenarios, sec
21.
▲
by
matklad
10mo ago
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 it requires much smaller time investment (though do try
22.
▲
by
matklad
10mo ago
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 <= 1) return; for (0..slice.len - 1) |i
23.
▲
by
matklad
10mo ago
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 just non-determinism! You could _implement_ non-de
24.
▲
by
matklad
11mo ago
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 addition to usual suspects like a
25.
▲
by
matklad
11mo ago
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 runtime nicely. E.g., undefined memory is set to `0xAAAA`,
26.
▲
by
matklad
11mo ago
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 _massively_ more ergonomic than in C. But, yeah, managing the lifet
27.
▲
by
matklad
11mo ago
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 get extra drawbacks from Rust, but the magnitude of dra
28.
▲
by
matklad
1y ago
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_ testing efficiency by requiring more CPU time per itera
29.
▲
by
matklad
1y ago
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 high priority threads wants to lock a currently occup
30.
▲
by
matklad
1y ago
This is compiler bug, the code should not compile (see issue #25046)
More ›