DEV Community

Cover image for Have You Ever Migrated To or From Rust? Lessons from Java Community Voices
Bruno Borges
Bruno Borges

Posted on

Have You Ever Migrated To or From Rust? Lessons from Java Community Voices

Setting the Stage

On r/java, developer u/fenugurod started a thoughtful discussion:

I don't want to start any flame war but I'm seeking different perspectives than mine. I'm doing a career change out of Go right now into Java, because the company that I work on decided to use more Java, and it has been nice. On personal projects I was kind of doing the same, but to Rust.

I like Go's tradeoffs, but over time I'm getting disappointed with the type system that does not let me express logic with more precision. I think Rust would be a perfect language, for me, if it had a GC. The immutability by default, option and result types, enums, are really good. On the other hand, Java has an amazing GC, is getting more and more features, and now I'm wondering if Java could fill this sweet spot of development that I'm looking for. A massive point in favour of Java is the market, there are almost no positions to Rust.

This is the reason of this thread, to understand if others have migrated to or from Rust to get their perspectives. I don't care that much about performance, Rust is faster but Java is plenty. I also don't care about shiny new type system features. The core for me is immutability (optional), ADT, Option/Result types. I care about safety, simplicity, and being able to evolve the software over time.

This sparked a remarkably nuanced debate among developers who have lived in both ecosystems. The comments reveal less of a language war and more of a pragmatic conversation about safety, maintainability, and team dynamics.

Let’s unpack what the thread teaches us.


1. “Don’t ‘migrate’ — learn broadly.”

u/bowbahdoe put it best:

You as an individual should not "migrate" to anything. Learn all the things you are able to. Take the jobs that serve your interests.

Because its always fun to point out and not everyone knows, you can get ADTs similar to Rust in Java via sealed interfaces.

sealed interface Animal {
    record Dog() implements Animal {}
    record Cat(double jumpDistance) implements Animal {}
    record Mouse(boolean quiet) implements Animal {}
}

Analysis:

This perspective reflects a mature understanding of how engineers grow. Technology decisions often feel existential early in a career (“Should I be a Rust developer or a Java developer?”), but over time, the best engineers realize that breadth builds judgment.

As the commenter notes, Java continues to evolve in expressiveness—features like sealed classes, pattern matching, and records are closing the gap with Rust’s algebraic data types.


2. The Hybrid Reality: Use Both

u/repeating_bears offered a pragmatic example:

I'm currently using both. Mostly Java but my application has a native component that's written in Rust. I tried Graal initially, but it seems like it doesn't or didn't support AWT/Swing on Windows and I needed that.

There are some really good things about Rust. Other than what you mentioned, serde is great, and the type inference is much better than Java (e.g. keeping the inference context across things like chained method invocations). Macros are great a lot of the time but occasionally horrible.

But I personally am not and don't aspire to be a low-level systems programmer. I'm happy with the performance of the JVM. It's always been good enough for every real-world performance requirement I've had. I feel like a lot of the annoying aspects of Rust exist because the language designers care about things that I don't generally care about. That's not a criticism, it just doesn't really fit my programming niche.

Commentary:

This captures the “and, not or” philosophy that defines modern software stacks. Rust and Java can coexist beautifully: Rust shines where performance or memory control matter (native modules, libraries, system glue), while Java dominates in business logic, scalability, and developer productivity.

Insight:

Language boundaries are not hard walls anymore. JNI, GraalVM, and FFI make hybrid architectures practical. The best developers choose integration, not migration.


3. The Cost of Rewrites

u/lambda_lord_legacy reminded everyone:

People here are going to like java. People in the rust sub will like rust. Everyone has their preferences.

At the end of the day these are just tools. Unless you're doing something very low level, you can create all the same things in java vs rust. So it's up to you what you want to do.

Migrations have cost. You need to be REALLY sure you will benefit from it to make it worth while.

Analysis:

Rewrites are emotionally satisfying but strategically risky. Organizations often underestimate migration debt — the integration work, testing effort, and retraining required when adopting a new language.

Key takeaway:

Unless there’s a structural or existential reason (like platform support or runtime constraints), rewriting in another language rarely delivers proportional value. Optimize where it matters most, and measure impact before committing.


4. Java Is “Fast Enough”

u/SuspiciousDepth5924 added:

Honestly, even with very low level stuff you could probably get by with having most of your code in java* assuming you'd be willing to deal with FFI for the hot loops. I mean people get by with writing python for ML workloads, and it actually works since most of the heavy lifting is being done by C and friends.

And I mean Java is fast, just not quite "John Carmack optimized C" fast.

(*) Notable exception is places where you can't run a jvm in the first place like small microcontrollers etc.

Commentary:

This is a reality many forget: for 95% of applications, Java’s performance is not the bottleneck. The JVM’s JIT compiler, adaptive optimization, and garbage collection make it “fast enough” for the vast majority of workloads.

Rust shines in specialized domains—embedded, real-time, or performance-critical systems—but most businesses care more about delivery velocity and maintainability than microsecond gains.


5. Beyond Java and Rust: The JVM Ecosystem

u/Typen shared a balanced view:

I have a strong preference for Java based on my personal experience level with it, but Rust is a fine language. I know the internet likes to argue over every little thing, but I'm in the camp that likes them both.

Insight:

The modern JVM gives you more than one flavor of expressiveness. Kotlin, Scala, and Clojure all offer richer type systems or functional paradigms while keeping Java interoperability.

If what draws you to Rust is its safety and ADT-like expressiveness, you might already find 80% of that inside the JVM without leaving your ecosystem.


Key Takeaways for Professionals

Consideration Question to Ask Strategic Insight
Motivation clarity Why do I want this migration? If it’s about language aesthetics, the payoff may not justify the cost.
Ecosystem & team readiness Can my team learn Rust? Is hiring feasible? Rust’s talent pool is still small compared to Java’s.
Hybrid vs full rewrite Can we adopt Rust only where it adds value? Many organizations succeed with hybrid architectures.
Refactoring cost & risk How much regression risk can we afford? Rewrites introduce new bugs as fast as they remove old ones.
Maintainability Who will maintain this five years from now? Familiarity and tooling often outweigh elegance.
Alternative paths Would Kotlin or Scala satisfy our needs? Sometimes the evolution path is within the same ecosystem.
Tooling maturity Are build, debug, and deploy pipelines ready? Tooling gaps can outweigh language benefits.

Final Thoughts

This Reddit thread is a snapshot of something bigger: how developers mature in their thinking about tools.

Rust and Java aren’t competitors as much as they are complementary paradigms — one optimized for control and safety, the other for scalability and ecosystem depth.

The smartest developers don’t pledge allegiance. They build judgment.

When you’re faced with the “Rust vs Java” question, reframe it as:

“What problem am I solving, and which language makes my team fastest, safest, and happiest doing it?”

That’s the migration that really matters.

Top comments (0)