Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust makes an '.exe', Java makes a '.jar'.

I think people want to write programs that run on an OS rather than an interpreter.



You're behind the times. Write a web app using a framework like Micronaut, Spring Native or Quarkus and you'll get a native Linux EXE out of the build system that starts faster than a C program would (due to pre-initialization).

Not that installing Java is all that hard. apt-get install openjdk is sufficient.


For the majority of executing code, there is no fundamental difference when it comes to a JIT compiler.

Besides, GraalVM can produce a native executable for pretty much any JVM language/program.


Last I checked there was a significant disadvantage to using rather basic Java JIT code in a cloud environment: slow startup time and poor initial performance in terms of requests per second & latency meant scaling on demand didn't work very well. I suggested we move to GraalVM and AOT compilation on that project but we just ended up over-provisioning by a significant factor to smooth things out.


The problem is friction. To run a rust app you can just run it. To run a java app you need to install java first. This is no problem for backends running on servers, but client apps (like Minecraft) have to include their own JVMs to reach a wider audience, and this solution still introduces a bunch of complexity.


Not a thing since Java 9 and jlink introduction, or since those commercial AOT compilers exist, for 20 years now.

And if free beer is your thing, GraalVM native image or OpenJ9 also produce a regular executable.


Java compilers have been producing '.exe' for about 20 years now, it is a matter to actually care to learn about their existence.


> it is a matter to actually care to learn about their existence

That's kind of the whole point I was trying to make above; if one language makes something super easy to do without having to look for instructions compared, that makes a difference in terms of how people will decide whether to learn it. Individually, lots of small quality of life things add up and can make a language that otherwise would be unapproachable way easier to get started with than languages that don't prioritize that sort of thing.


I know learning is a chore, nothing like jumping into it without thinking. /s


If someone has two choices that can provide the same output, and one of them makes it more effort to figure out how to do, then people will do the other one more often. There's no inherent virtue is spending effort to do something equivalent. It's not clear to me why you seem to think that pointing this out deserves a sarcastic response.


Yeah, sorry. I was aware of that but was being loose with words. I do think that part of the appeal is rust feels more bare metal and direct to people even if they're using heavy abstractions as compared to Java/kotlin or C# programming.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: