Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
matklad
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
matklad
3y ago
>The fact that Jetbrains was actually behind rust-analyzer To clarify, I was not working at JetBrains when I started to work on rust-analyzer, so they are not _directly_ behind. They are very much indirectly behind though, as - JetBrains
62.
▲
by
matklad
3y ago
Yes
63.
▲
by
matklad
3y ago
> It took 2 years of work while sponsored by a real business With a team of 1.5 people. I personally wouldn't call that amount of effort "huge", but adjective definitions may vary. The important bit here is "couple of
64.
▲
by
matklad
3y ago
>because it managed to get enough people to muster the huge effort that requires. Not really true on both counts: - you don't need _that_ many people, if you know what you are doing. For both rust-analyzer and IntelliJ Rust, the hea
65.
▲
by
matklad
3y ago
Thanks! You are exactly the target audience for this article! It really is only useful when: * you already have the intuitive understanding of problems being described * but you haven’t quite yet verbalized the problem and connected the dot
66.
▲
Two Kinds of Code Review (2021)
(matklad.github.io)
3 points
by
matklad
3y ago
|
0 comments
67.
▲
by
matklad
3y ago
Like this: https://user-images.githubusercontent.com/1711539/277602101-...
68.
▲
by
matklad
3y ago
Two scenarios where this breaks: * parent process is killed after it forks, but before it calls `waitpid`. Nothing even attempts to kill&wait for the child * parent process is killed after it issues `waitpid` syscall. The child continue
69.
▲
by
matklad
3y ago
waitpid is inherently racy. wait is covered by This can not be achieved using a pattern equivalent to { ... }. The parent process itself might be abruptly killed, and the finally blocks / destructors / atexit hooks are n
70.
▲
by
matklad
3y ago
No, I am just spelling-impaired (even in my mother tongue) :)
71.
▲
by
matklad
3y ago
There's some truth to this! I strongly encourage to architect language servers as libraries first and foremost, with LSP being a relatively thin layer on top of protocol-agnostic library, and only _one_ of the ways to consume the res
72.
▲
by
matklad
3y ago
Agree this is not a problem. rust-analyzer also includes a boatload of custom extensions. Here's how "query type of the selected expression" works, for example: https://github.com/rust-lang/rust-analyzer&
73.
▲
by
matklad
3y ago
I think our observations are consistent: I would say that candidates ability to solve leetcode-style problem during an interview reveals very little of their ability to code in the small or in the large. "Algorithms during code intervi
74.
▲
by
matklad
3y ago
https://cses.fi/problemset/ is by far the best resource I know.
75.
▲
by
matklad
3y ago
language-centric: the language you are compiling is flexible (you are also the language designer), you want to build the best possible language implementation-centric: the language you are compiling is mostly fixed and/or defined by an
76.
▲
Resilient LL Parsing Tutorial
(matklad.github.io)
2 points
by
matklad
3y ago
|
0 comments
77.
▲
by
matklad
3y ago
> BUT ZIG.. There’s no binary search implementation in Zig that I could find, rather it calls to C++. Zig’s binary search is here, it’s an unoptimized textbook version: https://github.com/ziglang/zig/blob/
78.
▲
by
matklad
3y ago
Note that Zig supports general sum types and pattern matching. It however deliberately chooses not to use those features for idiomatic error handling.
79.
▲
by
matklad
3y ago
Not at all, Rust and C++ are more-or-less equivalent here. In C++, like in Rust, each lambda gets a unique unnamable type, and you can use template parameters to express direct calls. > The lambda expression is a prvalue expression of un
80.
▲
by
matklad
3y ago
Depends on the context! For close-to-the-human high level languages, you generally want to solve these things through optimizations. For close-to-the-cpu low-level languages, you rather want tools to express the desired behavior in the sour
81.
▲
by
matklad
3y ago
Yup! Ideally, you want to do this analysis on compiler IR, _before_ it gets lowered to LLVM IR. But to do that in a sustainable way, you need a quasi-stable internal IR format. Zig is rather new, and, while the compiler is a delight to hack
82.
▲
by
matklad
3y ago
Derived from Rust code. With some proc macro magic, function declarations like `fn my_query(arg: Foo)` are decorated with prologue&epilogue which do required runtime tracking of dependencies.
83.
▲
by
matklad
3y ago
A bit more context in lobste.rs discussion: https://lobste.rs/s/te7x8n/durable_incrementality
84.
▲
Unit and Integration Tests
(matklad.github.io)
3 points
by
matklad
3y ago
|
1 comments
85.
▲
by
matklad
3y ago
Compare these two methods: https://github.com/ziglang/zig/blob/0dffab7356685c7643aa6e3c... https://github.com/ziglang/zig/blob/0dffab7356685c7643aa6e3c... One of them requires
86.
▲
by
matklad
3y ago
That's not quite it: with heapless, memory is fully static, the size of hash map is a compile-time parameter, which is a part of HashMap's type. In Zig, the map could be initialized and sized at runtime, but you still can enforce,
87.
▲
by
matklad
3y ago
As counter point, the way that Zig implements hash maps is absolutely instrumental for TigerBeetle. Zig hashmaps _are_ quite a bit more cumbersome than, eg, in Rust --- you need to decided whether you want the allocator to be bundled with t
88.
▲
by
matklad
3y ago
I am not an expert, but here’s my attempt at a useful comment. On the highest level, `nix` is an alternative build system. So, if someone packages your app with `nix`, there’s now extra work to keep that working, and it’s on the packager to
89.
▲
by
matklad
3y ago
No need for test_context, we can add an optional argument to functions marked with test.
90.
▲
by
matklad
3y ago
I covered this a bit here: https://rust-analyzer.github.io/blog/2020/07/20/three-archit... I don't actually _know_ how exactly clangd works, especially post modules, but pre-modules C++ has a compil
More ›