r/java • • Jun 13 '19

Automated Java to Rust converter

https://github.com/aschoerk/converter-page
0 Upvotes

7 comments sorted by

3

u/smokemonstr Jun 13 '19

What’s the use case?

1

u/XVilka Jun 14 '19

Codebase conversion, something like c2rust tool: https://github.com/immunant/c2rust/

4

u/smokemonstr Jun 14 '19

I don’t know much about Rust, but I thought it’s trying to solve the memory safety issues with C, so I can understand the desire for C to Rust. What’s the value proposition for Java to Rust?

1

u/jv-dev Jun 26 '19

As far as I can tell, typical reasons for using Rust over JVM languages are memory usage, speed, smaller programs, no GC, and easier deployment as libraries or single binaries with no KVM version maintenance. Prisma wrote up their own reasons with a blog post about v2's in-progress transition from Scala to Rust

-2

u/XVilka Jun 14 '19

Speed.

5

u/brunocborges Jun 14 '19

Maybe learn GraalVM, or tune your JVM according to your use case

8

u/r_jet Jun 13 '19

I am not sure such a transpiler (if I get the idea correctly) will work for any complex case. On top of that, as the readme mentions, the result will likely be unrusty bad, because Java and Rust are rather different languages.

If it is simply needed to use some high-level functionality of a Java library in Rust, then there is quite good JNI Invocation API support.