Atom or IntelliJ for Rust?

I would strongly recommend IntelliJ with intellij-rust. It's the most complete IDE-like experience currently.

But any editor works, really. IJ is a bit on the heavy side, but is still much lighter than, say, VS

1 Like

Lighter than visual studio or visual studio code? Because IntelliJ idea takes a long time to open.

What features would you define as ide like?

1 Like

Lighter than VS, but much heavier than VS Code.

As for features:

  • Very reliable autocomplete;
  • Automatic download of crates, so you don't have to cargo build every time a dependency changes to get autocomplete for it;
  • Code transformation suggestions (convert if/else if chains to match, expand elided lifetimes, etc)
  • Automatic formatting / code style
  • Naming convention enforcement
  • Clippy-like sanity checks
  • Option to show argument-name unobstrusive hints at function call sites
4 Likes

Well, that seems like a nice list. I will give a good try the day I have a real project (more than what I usually do).
I don't do anything where I need those kind of features. Right now I almost exclusively work on my server so I use vim with a lot of plugins (and I simply like vim, but wouldn't use it for anything too big I think)

1 Like

It is a tradeoff between speed and features. You can't expect any IDE to have a lot of features and still work fast.

2 Likes

Perfect case for Rust to address? :):smiley:

2 Likes

Perfect case for Rust to address? :):smiley:

Not a bad idea though it will take a long time to build. If we can start a community-written IDE it will be amazing.

1 Like

Noooo! Don't RIIR!
There's a lot of things that need the Rust-treatment way harder than IDE's. Lets focus our few developers there, instead of reinventing (already highly capable) wheels!

Security-critical, tightly optimised things like browsers, compressions libraries or parsing of untrusted web video!

6 Likes

Well, my question was a joke :smile: :wink:

1 Like

That's the dangerous thing about the internet! You can never be sure!

1 Like

Well, this project has been around at least: https://github.com/oakes/SolidOak

1 Like

Yeah i agree with that. I don't want to rewrite everything in Rust but in this case the performance might have a boost compared to IDE written in Java. just a thought

1 Like

Just to clarify, intellij-rust itself is actually all written in Kotlin, which normally runs on the JVM. I was actually surprised to see that IntelliJ itself is still mostly Java. I would have thought that would be mostly ported to Kotlin by now. (@matklad, curious if you have insights about % Kotlin use in other JetBrains products).

Of course this isn't a big difference as they both run on the JVM and are garbage collected. But I imagine that perhaps one day, JetBrains could use Kotlin Native to compile it's IDEs to native through LLVM, just like Rust (but still having GC overhead and such).

1 Like

Well, there are almost five million lines of Java in IntelliJ community, if tokei is counting correctly. You'll need a bit of time to convert this lot into another language :slight_smile: And, actually, it's not necessary, because interop between Kotlin and Java is completely seamless, so there's no need to convert anything. However, a lot of new code is written in Kotlin.

2 Likes

It is not easy to port from one language to the other especially on a product with so many users.

1 Like

Just for reference, this is how to use cargo to check code. I've just today started learning Rust and using intelliJ. So took me a few minutes to find. Maybe it will save someone time though.

On a IDE related note, the docs mention cargo build --release for production code. But I wasn't sure how to build within intelliJ and use this parameter. So just wondered if anyone knew?

1 Like

Run | Edit Configurations ...

2 Likes

It’ll be interesting to see what type of performance Kotlin Native will yield eventually. Java is performant only because of JVMs with a PGO’d JIT - the language is otherwise performance anemic (and hostile even in some regards).

2 Likes

Rust Enhanced has "experimental" RLS Support. (Check readme)
https://github.com/rust-lang/rust-enhanced#rls

There's still quite a bit to do, but you can play with it today

1 Like

Does Intellij Rust plugin have feature that automatically modifies mod files when you add a new file to that directory? This would be really helpful

1 Like