Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
matklad
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
21 ms
·
181.
▲
by
matklad
6y ago
Agree with you that there won't be any problems with panicking in this setup. Although, it'll require some non-minor api adjustments: at the moment, Range's fields are public. To maintain the invariant, we would have to make
182.
▲
by
matklad
6y ago
>This does mean writing for n in (1..10).iter(), but Rust already requires that for collections, so it’s more consistent. Even this needn't be the case. `Range` can implement `IntoIter` to plug into `for` loop syntax. Another relate
183.
▲
by
matklad
6y ago
Yeah, I agree that not elaborating on this was unfortunate (but elaborating would be tangential, as relatively few people are familiar with Emacs Lisp). I think Emacs Lisp is in the "easy to improve upon" category because of: * la
184.
▲
by
matklad
6y ago
I am not the author, but work in the same domain. Empirically, existing compilers are impossible to turn into good IDEs, unless the language has header files and forward declarations. Otherwise, you get a decent IDE by doing one of the foll
185.
▲
by
matklad
6y ago
There are also nightly binary releases!
186.
▲
by
matklad
6y ago
I‘ve written a bit about ide vs text editor here: https://www.reddit.com/r/rust/comments/fcshgy/why_do_you_thi...
187.
▲
by
matklad
6y ago
Did a quick benchmark: https://gist.github.com/matklad/ebc1acd2fab884f3ff9d96d4175f... . Seems like hypothesis is not wrong, but also is not interesting: the difference is pretty small, and it can be easily dwarfed by t
188.
▲
by
matklad
6y ago
> It shouldn't be as cheap as just iterating over a sequence of 32-bit integers. I wonder if there are any benchmarks about this? Specifically, it feels like in theory iterating utf8 could actually be faster if the data is mostly
189.
▲
by
matklad
6y ago
The excessive "precision" is because I've just copy-pasted what the original bench printed. As for "is this a reliable result", I believe I've performed diligence, appropriate for a HN comment, to make sure tha
190.
▲
by
matklad
6y ago
Note that Rust and Go programs differ in a seemingly insignificant, but actually important detail. Rust does this next_dist = std::cmp::min( dist_if_substitute, std::cmp::min(dist_if_insert, dist_if_delete), );
191.
▲
by
matklad
6y ago
I'd love to read an article that compares capabilities of the two! Martin Fowler seems to think otherwise: > I was known for my annoying habit of stating how Smalltalk's IDE was better than anything I'd seen. No longer. Fo
192.
▲
by
matklad
6y ago
Out of curiosity, which editor are you using? I've hit a similar problem when trying out upcoming neovim lsp support: https://github.com/neovim/nvim-lsp/issues/195
193.
▲
by
matklad
6y ago
I must say I don't fully understand your original question, so I can't answer it directly. However, I can share my (very hand-wavy) thoughts on the general LSP ecosystem, and it looks like that might actually answer your question.
194.
▲
by
matklad
6y ago
A fun example here is rust-analyzer: we implement cancellation via unwinding. This is not technically a panic, but the mechanism is the same, and it more or less is invoked every time a user types something in a file.
195.
▲
by
matklad
7y ago
There’s one specific substantial benefit in comparison with typical Java-like languages: concurrency is much easier in Rust. Having “is this thing thread safe?” answered at compile time is something I missed in Kotlin a lot. Of course, it d
196.
▲
by
matklad
7y ago
Agree that there’s consensus on anyhow for applications, but I think many folks now prefer vanilla std::error::Error for libraries (which itself got better as a result of all the experiments in the ecosystem).
197.
▲
by
matklad
7y ago
>Still I think I am not mistaken in my impression that you don't wish for rust-analyzer to become popular too early as that would put some unwanted constraints on experimentation. You are not mistaken indeed. More specifically, I do
198.
▲
by
matklad
7y ago
> I wonder whether an entire class of challenges that the project faces is attributed to electron? No, not at all.
199.
▲
by
matklad
7y ago
Being alpha quality and providing better experience than RLS are not incompatible. rust-analyzer is definitely alpha-quality at the moment.
200.
▲
by
matklad
7y ago
Benchmark uses fixed seeds, there’s no inherent randomness.
201.
▲
by
matklad
7y ago
Fibers under the magnifying glass [1] might be a relevant paper here. Its conclusion, after surveying many different implementations, is that lightweight threads are slower than stack less coroutines. [1]: http://www.open-std.org
202.
▲
by
matklad
7y ago
Sorry if the post reads like “rust did this right”: my intention was to show different trade offs around static/dynamic checking of constructors. I didn’t mean to argue that certain approaches are right, and others are wrong. In partic
203.
▲
by
matklad
7y ago
Sorry if the post sounds like I am trying to argue that one approach is inherently better than the other. It is not my goal. Rather, I want to show the amount of language level machinery (extensive static checks, or runtime nullability) tha
204.
▲
by
matklad
7y ago
There are cases where copy elision doesn't work (don't know how important is that in practice). One representative example would be something like this (I think this can't use copy-elision, but I am not an expert in C++, pl
205.
▲
by
matklad
7y ago
IntelliJ predates Roslyn. While it’s not a full compiler (doesn’t do codegen), it naturally does all the front-end bits which are required for IDEs. Note that “incremental parsing” is a nice to have, but is not required for IDEs. What is re
206.
▲
by
matklad
8y ago
That's not a particularly hard problem, all tools which try to solve it (for example, IntelliJ), solve it easily. For example, here's the syntax tree that rust-analyzer builds for this example: fn foo() { } fn fn b
207.
▲
by
matklad
8y ago
I assume you are talking about the last bit? This is of course a personal opinion anyone is free to disagree with. However in practice many popular programming languages are implemented in C or C++ (clang, gcc, swift, CPython, V8, SpiderMon
208.
▲
by
matklad
8y ago
The criticism are not about the protocol itself, but about a particular implementation. rust-analyzer also uses LSP as an interface.
209.
▲
by
matklad
8y ago
The thing is, if you target only live editing case, you can become slower for "batch compilation" case. For source browsers this probably isn't too important, b/c one can add caching using something like LSIF. However
210.
▲
by
matklad
8y ago
Unlikely: rust-analyzer focuses on static analysis. So it aims to power something akin to IntelliJ IDEA, but probably would be a bad fit for something like lightable/elisp/smalltalk ide.
More ›