4 ms·
I'd like to understand what you mean by baked in. Not only does vscode need a plugin, it needs a language server running to do the static analysis. Are there an
by Waterluvian 7y ago
I'd like to understand what you mean by baked in. Not only does vscode need a plugin, it needs a language server running to do the static analysis. Are there analysis capabilities without the language server?
- UK-Al05 7y agoThe compiler by its self can do it, if you run it. I believe the language server is just for real time editor integration.
- Waterluvian 7y agoGotcha, thanks. This is too tangential to belong here. I need to go better understand what exactly the language server is doing if the compiler is able to provide all the details. Going to guess it has to do with partial/progressive analysis and supplying a programmatic interface to convert errors/warnings into squiggly lines rather than text output.
- steveklabnik 7y ago> I need to go better understand what exactly the language server is doing if the compiler is able to provide all the details. Converting it from what the compiler knows to the https://langserver.org/ https://langserver.org/ protocol. The long-term goal is to have the compiler be able to do this directly, but there's some stuff to do in the meantime.
- orf 7y agoI believe he means that certain things that would need static analysis in other languages are impossible to do as part of the type system. For example match statements need to be exhaustive. Your program won't compile unless they are.
- johannes1234321 7y agoNot Impossible, but have to explicitly makred as "unsafe"
- Sevii 7y agovscode requires languages to implement a language server. It doesn't have anything to do with rust.
- seren 7y agoThe other important aspect is that even if you have a static analyzer available, people might not be able to afford them (Coverity/klockwork/etc licenses) or even if they have it, there is nothing preventing them from skipping the analysis (just for this one time, I promise). (Another trick is to run the static analyizer, and not fixing the issues found...) With Rust the compiler is already providing a lots of analysis, and you can't easily skip it. And if you do by using unsafe{}, it shows. So basically, even if your dependencies are provided by the worst team in the world, you know that the guarantees enforced by the Rust compiler are in the code. (To be fair, it does not mean that the SW will do anything useful, but it won't likely segfault)