8 ms·
Introducing Rust Language Server
- JoshTriplett 10y agoI saw the demo of this at RustConf, and it was incredible. See the video linked from the post: https://www.youtube.com/watch?time_continue=2405&v=pTQxHIzGqFI https://www.youtube.com/watch?time_continue=2405&v=pTQxHIzGq... I look forward to seeing support for this integrated with vim.
- hetman 10y agoI think the most astonishing thing to me about the Rust language project is not the language it self (sure it's innovative but there's also still a lot of work to be done to make it get out of your way). It's the speed and tenacity with which the project has managed to push development of the supporting tooling. The development tools surrounding a language can often be more important for productivity than the language itself, and it feels like the Rust team and community really get that.
- JoshTriplett 10y agoI think that's a side effect of making a welcoming community a priority. The Rust Language Server grew out of feedback from the Rust Language Survey, in which many people responded that they wanted good IDE support. That isn't a glamorous task to work on, especially if you're already comfortable with the level of editor support you have, but it helps bring more people into the community, which has a multiplicative effect.
- theossuary 10y agoI think it's a side effect of having a punishing language. Coding Rust is always described as fighting with the compiler, I don't think Rust would have ever taken off if there weren't great tools to fight the compiler with. I think that's a part of it, anyway.
- fabrice_d 10y agoI don't think "fighting the compiler" is an accurate description of the Rust coding experience. There is a learning curve during which you feel like you fight the borrow checker a lot, but once you get it you will find that the compiler is actually helpful.
- duaneb 10y agoAgreed. Refactoring tools would help address compiler concerns quicker, however.
- deleted 10y ago[deleted]
- iopq 10y agoThere's plenty of fighting the compiler. error[E0281]: type mismatch: the type `fn(_) -> _ {tool::second::<_>}` implements the trait `std::ops::FnMut<(_,)>`, but the trait `for<'r> std::ops::FnMut<(&'r _,)>` is required (expected concrete lifetime, found bound lifetime parameter ) --> src\lib.rs:53:11 | 53 | .filter(apply(second, i)) | ^^^^^ | = note: required by `apply` error[E0271]: type mismatch resolving `for<'r> <fn(_) -> _ {tool::second::<_>} as std::ops::FnOnce<(&'r _,)>>::Output == _` --> src\lib.rs:53:11 | 53 | .filter(apply(second, i)) | ^^^^^ expected bound lifetime parameter , found concrete lifetime | = note: concrete lifetime that was found is lifetime '_#11r = note: required by `apply` error: aborting due to 2 previous errors I now know why I'm getting this error. Would you?
- vertex-four 10y agoClosure-related error messages are not one of the strong points of Rust so far, unfortunately.
- lmm 10y agoI suspect I would - I'll happily guess if I can take a look at the code (or at least the signatures of "filter", "apply", "second" and "i").
- jimbokun 10y agoNot a Rust developer, but this project sounds sexy to me! :) I use Emacs as much as possible, but for Java dev use IntelliJ because the Java plugins I've tried were always relatively clunky. Having great language support regardless of editor sounds wonderful!
- wst_ 10y agoYou can develop Rust with IntelliJ as well. There's a plugin out there.
- steveklabnik 10y agoThey gave it a snazzy site: https://intellij-rust.github.io/ https://intellij-rust.github.io/ One really interesting thing about this effort is that the IntelliJ folks have their own stuff for autocomplete; they're not using racer.
- xorxornop 10y agoYeah, that seems nearly a constant for them. For example, in ReSharper (and presumably Project Rider), despite C# having the excellent, very fast (and, critically, fully open source!) compiler-as-a-service, Roslyn, they continue to use their own internal compiler service for code autocompletion, refactoring, and correctness analysis.
- royjacobs 10y agoResharper has been in development far longer than Roslyn and seems to be much more suited to working with partially incorrect code (the kind you have while typing away) and incremental changes. Does Roslyn have the same support?
- drchickensalad 10y agoRoslyn is built for incomplete/flawed code
- allengeorge 10y agoI can't upvote this enough. I found the Rust community incredibly welcoming, and loved the focus on tooling - making our day-to-day lives so much better. So much so, that after a few weeks of working with Rust I contributed a few small fixes to the IntelliJ Rust plugin. So, yeah - the community inspired me, and I hope the RLS inspires other people to contribute to Rust and the tooling around it as well!
- aswanson 10y agoI really wish I had time to contribute to this language. The community seems awesome.
- seangrogg 10y agoIn two years there will be too many tools and people will start complaining of Rust fatigue, don't worry.
- xuejie 10y agoI might be wrong but one possible explanation is that the language is so hard to learn that people would need tools to help in the beginning. Within Mozilla, they can use servo as a selling point or turn to creators for help, but from the outside world, we've got so many languages available, while some might not be good when the software grow big, they are more beginner-friendly than Rust. Hence Rust needs all those tooling from the very start.
- leshow 10y agoIt's really not that hard. I think it depends where you are approaching it from.
- xuejie 10y agoI actually agree, it's not that hard, yes one can definitely grasp that with some efforts. But my point really is: the time from start learning Rust till when you can deliver your project is definitely longer than many other languages out there. So Rust needs more tooling than many other languages out there, which is not a bad thing considering all the merits in Rust. That's why we are seeing tooling growing very rapidly in this space.
- mgattozzi 10y agoI think it's more because we like making development easier and having tools to do that is great because it means I can spend more time with the compiler telling me I coded something wrong.
- mycall 10y agoIt would be great if Rust Language Server supports Language Server Protocol.
- steveklabnik 10y ago(As mentioned below, it's the default protocol it uses)
- rubber_duck 10y ago>It's the speed and tenacity with which the project has managed to push development of the supporting tooling. Compared to what ? Community designed languages like D, Nim, w/e - no dispute here. But corporately backed languages such as C#, F#, Swift, TypeScript, Kotlin - not really. I guess it's fair since Rust is middle ground - sponsored by Mozilla but not getting the level of investment as the others mentioned.
- rkangel 10y agoI think that's the point. Lots of community languages leave the tooling to the community, which only works if your language gets adopted (and doesn't help it to get adopted). Rust is a community language (admittedly with the organisational backing of Mozilla), but is driving the whole ecosystem.
- favorited 10y agoFor anyone interested in similar tools, Microsoft recently published a protocol[1] for this type of service, and an implementation[2] of it for VSCode+NodeJS. Swift also has a library[3] called SourceKit which does the same thing for Swift – it can run as an out-of-process daemon, and people have written integrations for Atom, Emacs, etc. to get autocomplete, syntax highlighting, def links, etc. [1]https://github.com/Microsoft/language-server-protocol https://github.com/Microsoft/language-server-protocol [2]https://github.com/Microsoft/vscode-languageserver-node https://github.com/Microsoft/vscode-languageserver-node [3]https://github.com/apple/swift/tree/master/tools/SourceKit https://github.com/apple/swift/tree/master/tools/SourceKit
- nrc 10y agoIndeed, the RLS uses that protocol to communicate with IDEs.
- favorited 10y agoThanks, I totally missed that. That's pretty great – I thought it was a neat idea from MS, but I was worried it would get any traction. Glad to have been wrong!
- steveklabnik 10y agoA lot of us in Rust-land are very big fans of VS: Code and what they're doing. I'm in the process of switching to it as my primary editor.
- pjmlp 10y agoThe work the community has been doing there is great. The Rust development experience in VS: Code is the only reason why I use it. Kudos to everyone.
- bjz_ 10y agoYeah, I switched to VS Code because of the nice Rust plugin, and the editor is now really growing on me! The Elm support is also getting quite good.
- beliu 10y agoThis is awesome. The best languages are the ones with strong tools. Side note: really looking forward to rolling this into Rust support for Sourcegraph (Sourcegraph team member here) to make any Rust library as easy to explore as https://sourcegraph.com/github.com/gorilla/websocket/-/blob/client.go#L39 https://sourcegraph.com/github.com/gorilla/websocket/-/blob/... and https://sourcegraph.com/github.com/staltz/xstream@master/-/blob/src/extra/flattenSequentially.ts#L68 https://sourcegraph.com/github.com/staltz/xstream@master/-/b... are for Go and TypeScript. Thanks for making and open-sourcing this!
- haberman 10y agoI've wanted this for a long time. But I don't see why it has to be language-specific. Maybe some of the fancy parts do, but why can't make/cmake/ninja/etc. support this in a language independent way? Just basic queries/commands like: 1. run any build steps that directly depend on file X 2. run any build steps that directly or indirectly depend on file X 3. get whether the build of X succeeded or failed, and console output These alone would go so far towards making Vim/Emacs/etc more user-friendly.
- steveklabnik 10y agoThis is what https://news.ycombinator.com/item?id=12739817 https://news.ycombinator.com/item?id=12739817 is about, and I agree it's a great idea! In that sense, it's not language-specific.
- denfromufa 10y agoThis most likely originated from TypeScript, which actually went further with compiler and code analysis integrated
- steveklabnik 10y agoWe've been planning this for a while, and it's largely been a joint effort between Jonathan and Nick; Jonathan _did_ work on TypeScript before coming to work on Rust, though.
- joostdevries 10y agoCompilers that have a language service api are awesome. The Typescript compiler does and it makes for high quality low latency refactoring, code completion, show expression type etc across ediors and IDEs. Since my other day to day language is Scala I was glad to find out that the upcoming Dotty Scala compiler will also feature a language service api. Yay.
- avodonosov 10y agoIs it something like swank for common lisp?
- k4rtik 10y agoI recently learned how modern IDE's provide the kind of features Rust LS is targeting. For anyone else interested, here is a great video explaining the same: https://channel9.msdn.com/Blogs/Seth-Juarez/Anders-Hejlsberg-on-Modern-Compiler-Construction https://channel9.msdn.com/Blogs/Seth-Juarez/Anders-Hejlsberg...
- jayflux 10y agoThere's some talk of getting this into Sublime Text https://github.com/jonathandturner/rustls/issues/18 https://github.com/jonathandturner/rustls/issues/18