145 points · by 3dsboy08 · 3y ago · 125 comments
Now I'm working on a Rust + CUDA FFI project; RustRover has minimal support for the CUDA (essentially C++) code. It does syntax highlighting and comment-hotkey, but the introspection and refactoring appear inop. It would be nice if RustRover and CLion were combined.
Just switch to Clion and You'll problem will be solved
Multi-language code bases aren't that uncommon either. As you say mixing C and Rust is common in apps and systems level programming. Mixing JavaScript, TypeScript, Go, and other languages like Python is also pretty common in web-centric stuff.
(It still exists but seems kind of dead outside Java shops.)
Whereas you get the whole experience on Eclipse out of the box.
To keep in context, to this day you can't debug JNI on regular InteliJ, unless having CLion as well.
Something that Netbeans and Eclipse support for at least 20 years now.
These days I only do Rust dev really. I'm not clear on what their plans are for ongoing Rust support in CLion going forward now that they're rolling out RustRover. Are they going to pull it?!
Because I work at a company that is mostly C++, with some Rust. My team's project is 90% Rust, but I still need to do C++ now and then. I'd be super annoyed to lose that.
They should at least continue to offer the plugin as a paid expansion option for CLion.
In reality of course it's a bit more than just compiler support, you'd want easy interop with Javascript and Web APIs and a working debugger. With the Emscripten SDK and Chrome's and VSCode's WASM DWARF support it's looking pretty good now at least for C and C++ (but I assume the WASM DWARF debugging stuff also works for Rust, since it's the same compiler infrastructure underneath).
Leptos, as a popular recent example, suffers from one major issue (that most others suffer from too): the JSX stuff is opaque to Rust Analyzer. Code completion aside, you lose the ability to hover - massively crippling any hope of tracking down how to resolve a type mismatch.
Web Rust also has the impedance mismatch that Rust has for UI. There are several success stories - e.g. Cosmic Desktop, but I'm certain that there's more love than practicality involved.
I think part of the reason is that we are trying to shove in existing patterns - which originate from OOP languages - into Rust. In both semantic and ergonomic terms I have been bitten by trying to OOP in Rust when I was first learning it.
I think that there exists an (as yet unknown) solution to the UI problem. It's just going to look nothing like React (or Elm even).
CLion might not be the best app to start your 100 line script but it works the same on 1 000 000 line projects or even single file.
CLion 2022.3 Released - https://news.ycombinator.com/item?id=33803016 - Nov 2022 (1 comment)
C/C++ facts we learned before going ahead with CLion - https://news.ycombinator.com/item?id=9954766 - July 2015 (31 comments)
CLion 1.1 EAP starts: parser re-work, LLDB, new formatter options - https://news.ycombinator.com/item?id=9857310 - July 2015 (2 comments)
JetBrains has finally released CLion – cross-platform IDE for C/C++ development - https://news.ycombinator.com/item?id=9375543 - April 2015 (5 comments)
CLion – Brand New IDE for C and C++ Developers - https://news.ycombinator.com/item?id=8295036 - Sept 2014 (51 comments)
CLion, the new C/C++ IDE from JetBrains - https://news.ycombinator.com/item?id=8283992 - Sept 2014 (146 comments)
Hey, I am curious, when do I want to do that instead of relying on auto? Mostly curious, as I have been using auto in C++ (since C++11) relatively heavily.
From Google's C++ Style Guide:
https://google.github.io/styleguide/cppguide.html#Type_deduc...
> The fundamental rule is: use type deduction only to make the code clearer or safer, and do not use it merely to avoid the inconvenience of writing an explicit type. When judging whether the code is clearer, keep in mind that your readers are not necessarily on your team, or familiar with your project, so types that you and your reviewer experience as unnecessary clutter will very often provide useful information to others. For example, you can assume that the return type of make_unique<Foo>() is obvious, but the return type of MyWidgetFactory() probably isn't.
I would typically use auto while working on something but then have to replace many of them before creating a code review. I wish Visual Studio could do that, it clearly already knows the type.
Not just reviews, but anything that involves reading the code (which is frequently usage and maintenance). Swimming in a file where everything is auto is a special kind of hell. It's like having no firm ground to step on.
I agree that if you spend a lot of time reading code in something like GitHub, not having explicit types is annoying, but seriously, who does that?
I wouldn't use it for my project or any new project. It's out of date with how everyone else codes C++.
Isn't the return type of a widget factory method obviously Widget? This doesn't seem like a great example. Of course the method name could be wrong and not enforced at the language level like something between angle brackets, but idk.
My take is: if the code is type-agnostic (i.e. should remain identical when the type changes), and writing the type wouldn't help the reader, and the type itself isn't already a simple-to-write template (like T), then use auto. (For example, this is the case when you're just taking some value and passing it along, and have no reason to care about the type at all.) Otherwise, write it out.
The intent being that you should prefer to spell out the type unless it's genuinely adding a burden (such as being difficult to read, or adding an extra location to update if it ever changes) when the benefits are also negligible, because it's frequently useful information and a good sanity check.
1. you refactor, you change the type declaration in one place, auto handles the boring work of replacing the characters throughout your project.
2. you refactor, you change the type definition in one place, auto will handle replacing all the instances in your project, hell, it might even compile afterwards.
I believe you are describing 1. I find that easy enough to do with 'Sed' or IDE refactoring tools.
2, is more subtle and the new behaviour could now be worthy of scrutiny throughout the project. I find it difficult then to 'Grep' or IDE search through the project for all instances reliably when auto is in use. It is much easier for me with spelled out types.
I would trade the benefit of auto in 1) for the safety of spelled out types in 2) every single time.
But that's second priority to readability, because people read code much more often than they refactor it, and they need to be able to easily anchor their understanding when reading. Optimizing code for efficiency of editing instead of the ability to understand it is getting the priorities very wrong.
> Keep in mind hover documentation often isn't readily available for pull request reviewers. Most of the time, reviewers will use GitHub's online viewer to review pull requests.
`using` directives and typedefs are not forbidden, so this would avoid situations where a type is never explicitly declared.
Having worked in large code bases that used `auto` almost exclusively when possible… I’m not sure I agree. However, I understand.
https://docs.Godotengine.org/en/stable/contributing/developm...
var m = new Thing(); // you know its a thing
var t = a.b().c(); // what is it? var t = a.b().c(); // what is it?
Most likely bad code (on the right hand side) for (auto const & thing : container_of_things) {
thing->method ();
}
in this context (and this context alone) i love not knowing or having to explicit denote the type of "thing".- CLion Classic
- CLion Nova
- Rider
- ReSharper C++ for VS 2022
And the 'new UI' versus the 'old UI'.
When my teams mates act surprised my VS flies when compared with theirs, the answer to "Are you using ReSharper?" tends to be a yes.
Choice is good; lack of choices and unification is not that good.
Perhaps, but in this case, the same wheel (a C++ IDE) has been reinvented four times by the same company, whereas the competition (Visual Studio, Xcode) have existed for two decades or more. In this case, choice leads to fragmentation, to lack of focus, to poorer quality, and a focus on 'let's rewrite it again'.
They only have one C++ IDE. That is CLion.
Rider is a .NET IDE. ReSharper C++ is an extension for Visual Studio. Rider includes parts of ReSharper.
The preview is not for a new product. It's a preview of a new version of CLion, their existing C++ IDE.
They are unifying their two separate C++ engines, focusing on one code base.
The same functionality works quite well in vscode.
But I tried this release and everything works really well on the same project.
I recently decided it is over and moved entirely to VSCode. It's a massive improvement in terms of productivity even if it is not as rich, simply because it is more responsive.
The Nova preview is free to use. License not required until it is merged into CLion.
No one is forcing you to install it. Your rant is pointless.
I own CLion and will try it out. It probably works well enough. If not then I simply won't use it.