Hey Coders!!
A lot of you have been telling me that rust is soon going to replace java.
Looking at the perspective of the number of people using java, I would say Rust isn't going to replace java.
I don't think a language can fully replace another one.
Oracle released Java in 1995. It is still used worldwide by so many developers out there.
I mean, sure, Java is pretty lengthy and we need another way to make it easier to write code.
Technologies such as Rust and Go function the same way as Java but they are written in shorter code.
Hello World Written in Java:
class Simple{
public static void main(String args[]){
System.out.println("Hello Java");
}
}
Hello World Written in Rust:
fn main() {
println!("Hello world!");
}
Well, Rust does have a lot of new more interesting ideas and concepts but we don't know whether they are going to be adopted universally.
There are also a lot of other companies that have java code written in their programs.
One advantage of using Java is that you have a lot of libraries and APIs available.
Well, Rust doesn't really have as many developers as Java does.
Rust might not be large enough to become a conventional language.
The Final Reason why I think Java won't be replaced is because the entire company of Android has a lot of servers that run on Java.
Overall, There is a possibility that Rust could replace Java but it most likely wont.
I hope I answered your question and I hope you enjoyed this blog!
And don't forget...
Oldest comments (73)
I don't know about rust but I think kotlin is better in terms of development experience and most of the time kotlin code is concise and shorter than java code.
Yes, but Kotlin was designed with this exact mentality. Java plus some features, minus some annoyances, basically.
While I assume that you can do most things in Rust, it is primarily a speed and memory safety focused language. Without garbage collection, I might add. That does not make Rust bad, obviously, but I genuinely don't see the point of this article.
And adding some other annoyances, like not being able to use Java 17 together with Kotlin at the moment.
Right.
I was actually wondering about that. Is Kotlin supposed to be compatible with Java in the future as well? If not, major RIP.
True.
Yes, and likely it's won't be much longer before Java 17 is supported. Spring is likely to take a year before going to 17. If it's not possible by then, it's going to be a major deal breaker. Originally people used Kotlin mostly because they were stuck on also JVM's with Android. Kotlin also has other compile targets, like native and js. But I think they are still used very little.
Despite all the differences between the two languages, Java and Kotlin are 100% interoperable. You can call Kotlin code from Java, and you can call Java code from Kotlin.
Not 100%, you can't call a coroutine from Java, and you can't use Java Code that contains records for the moment. But yes, it all runs on the JVM, as does Scala, Groovy and Clojure, which you could use all together in one app.
Seems you can use Java records with Kotlin (and even define them in Kotlin)
kotlinlang.org/docs/jvm-records.ht...
Conciseness per se is pointless. Development productivity is only thing that matter when comparing Kotlin and Java. And Kotlin often is worse than Java in this regard. At least for backend development.
Do you have personal experience with this? I wonder if this will change with time as people adapt to using the language more. In my area, Kotlin jobs or even projects are still very rare unfortunately, so please elaborate.
This might change over the time, but odds are low since some issues are inherent to Kotlin as a language. Here is my answer on similar question with more details and my personal experience.
I should note, that many Java issues, which make people consider Kotlin, can be solved by adopting Pragmatic Functional Java in combination with Java 11 and up (especially Java 17).
I don't know much about Rust, but from what I gather, it has about the same chance of replacing Java as JavaScript replacing C in the Linux kernel. Would make roughly the same amount of sense too.
Also, 3 vs. 5 lines in a hello world program proves what exactly?
I doubt rust would replace Java but it defo has more of a Chance replacing Java than JS has replacing C.
Rust is intended to actually replace C++; it adds all the safety features needed to make responsible code with C/C++, but brings a modern syntax with what I'd say is by far the most helpful compiler ever.
If I want to build a desktop GUI app using GTK, I would certainly pick C++, because Rust executable size is big and takes very long to compile.
Err... and the C++ one will likely have bugs and race conditions, and the Rust one won't.
Do you not understand the value proposition of Rust?
Rust has less boilerplate here, but only because there is nothing that needs error checking or making the borrow checker happy. I suspect a thirty line piece of java ported to scala and rust would have the fewest lines in scala. Java probably comes in slightly smaller than rust, but could easily be a little bigger.
I guess this isn't about the number, but the length of the lines. You can have less lines, but with a bigger length.
Oracle did neither create nor release Java. It was Sun Microsystems, which Oracle acquired in 2010.
Looks like author have no idea
While I like Rust a lot and consider its approach to resource management brilliant, I believe that Rust has very little chances to replace Java. First and foremost, it has no sensible advantages for enterprise app development - main Java use case. Rust is still more complex to use than Java and Java still has much more developers than Rust.
Oracle did not release Java in 1995. Get your facts right please.
I read somewhere else about the chances of using rust in the Linux kernel development. Specifically in device driver development to make it easier.
In 2021 comparing languages especially in the arena that Java plays is not comparing the right thing. I will include kotlin in Java and any other jvm language that plays well with Java. The reason being is all of the quote on quote microservice Frameworks all of the libraries all of the years of development all of the companies using it to include Enterprises and companies like Netflix to include the humongous community. That is what any language has to overcome. I don't see any language of run time doing that or even coming close. I used lots of different languages over my 26 years of my professional software development experience
Every programming language has its pros and cons and over time becomes suited for certain kind of development. No language replaces any other language ...
Well, if we talk about a great enough time period, most languages will be replaced, at least at the general usage level.
I still hope that JS becomes the browser version of Java bytecode. Any day now!
For the browser we have been stuck on JS, or at least compiling to JS for a while now. With WASM there finally seems an alternative, although currently you still need a bit of JS.
Yes, I don't think Java is going to be replaced
I don't think Rust or any other language can replace Java as in today's world most of the devices are running on Java even Android also.
Yes, I don't think Rust will
Yes, but that comes with additional complexity. Which is not a bad thing, as I said. We could say that Java does not have an ownership model because it's garbage collected nature does not need it.
It's just a different approach that demands different things from the programmer.
I think the most important part of Rust is that its ownership model also allows thread safety without manually synchronizing access to shared memory. Java cannot do that even in theory.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.