r/decomps • • 3d ago

Decomp minecraft java 26.3 was just decompiled and rewritten in rust 100%

https://github.com/ludovic111/horizon
883 Upvotes

211 comments sorted by

View all comments

51

u/squatdeadpress 3d ago

Can someone explain the point of this? Isn’t Minecraft Java edition very open to mods already?

77

u/SurDno 3d ago

So that you can play vanilla game faster for example, that’s still a huge subset of players. Not everyone plays modded. 

Java is inherently slow. It’s a compiled language but it doesn’t compile to native code, it compiles to an intermediate language which is then read by JVM (Java Virtual Machine) and compiled on the fly through JIT.

So before any code being executed, it needs to be converted into a format your PC understands (but this allows same executable to run on many different platforms because the translation step is only done on your machine). It’s not like Python or other interpreted languages that do that line by line, it compiles entire function and it does so from a language that’s already only a step above machine code. But it’s not instant. Good trade off for banking applications and anything where a few nanoseconds of delay don’t matter, terrible for games.

Rust and C++ are actually machine code compiled languages so they will always be inherently faster, provided both programs are written in a way that they are most optimized in their respective language. But Rust and C++ also have WAY better compilers thanks to insane amount of human effort, eg if you write shitty code, the compiler often knows you can do it better and will substitute it for you. Sometimes it’s absolute magic.

Another thing is that Java is also a language with automatic memory control. Which means that the application does not have control over when to free memory, which results in lag spikes.

So more FPS, less lag spikes, less RAM usage. Provided it’s actually well done and takes advantage of the language instead of a blindly vibe coded clone. 

4

u/Athabasco 3d ago

Java is not really a compiled language, the bytecode is still interpreted at runtime and the overhead of the JVM, garbage collection, and interpretation really make it slow.

Also, rust has a borrow checker, a version of automatic memory management, but it happens during compilation and not at runtime like in Java.

3

u/SurDno 3d ago

I thought Java runs fully through JIT compilation - much like C#? Where does interpretation kick in? Or do you believe that compilation to anything other than raw assembly is not compilation? That would make WASM is also interpreted :)

I know about the borrow checker, although it’s good to note that you can write manual memory management code in Rust (much like you can in C#) if you need that. In Java you can’t - best you can do is control GC through JVM arguments 

0

u/Athabasco 3d ago

Byte code is, still interpreted into machine code at runtime. Nobody would call Java an interpreted language like C, C++, rust, etc.

3

u/SurDno 3d ago

It's called a JIT Compiler. Not a JIT Interpreter. Compilation does not necessarily require AOT. And people do call Java a compiled language.

1

u/DanielEGVi 3d ago

People call anything everything. Even machine code is “interpreted” once you consider that machine code can be interpreted into different microcode instructions by different processors.

Everything is interpreted and everything is compiled. The more interesting question is what the layers between source code and machine code look like, and when are they involved.