That post seems to be missing.
jmk1ng 35 points 3 years ago

Nothing wrong with Java or JVM based languages. They're just not the shiny new thing anymore.

I don't know what kind of software you write at your company. It could be that the JVM was a poor fit for the stuff you do and Rust is far more suited. Or it could just be someone in leadership read a blog post where some company migrated from Java to Rust and saw a billion percent perf increase despite their use case being specific and not at all applicable to what you do and decided to decree that everything gets ported to Rust.... or any dozen of reasons in-between

path: 0 617136, hotness: undefined, score: 35, children: 0
heartlessevil 21 points 3 years ago

Java is fine, especially if you use a modern version or Scala/Kotlin. If you're talking about migrating to Rust specifically, it's probably because Rust can do a lot of things that people used to reach to Java for, with zero-cost abstractions. (The most obvious obviously being garbage collection.) Secondly, Java's performance for a running application is best-in-class for a dynamic, GCed language, but it still has a notoriously slow startup time. This makes it unsuitable for some use cases, where Rust might be a better option. (The tradeoff is probably that Java runs on more platforms with one executable.)

path: 0 617235, hotness: undefined, score: 21, children: 1
letsgoshopping 0 points 3 years ago
path: 0 617235 624562, hotness: undefined, score: 0, children: 0
o11c 20 points 3 years ago

Java has never had a good reputation, lol. But seriously, by every possible measure it has superior competitors:

  • Compared to dynamically-typed or interpreted languages, Java performs better, but it requires a frankly ludicrous amount of extra typing.
  • Compared to AOT compiled languages, it performs poorly except in purely numeric code where it has the advantage of portable -march=native. Other code almost never can be optimized due to the mandatory memory overhead.
  • Compared to any language, Java lacks support for most forms of ownership that people actually intend, and makes them very difficult to implement them yourself. Of the 3 ownership policies it does support, GC is useless (solely a crutch for programmers who are too lazy or too incompetent to specify what they want), Weak is sabotaged by its relation to GC, and Unique is limited to local contexts and does not compose. (I don't consider Phantom and Soft to actually be distinct ownership types, just hooks for GC ownership)
  • In its own niche (static types + JIT + GC), C# is strictly superior as a language, due to supporting value types (although not all C# bothers to use them, at least you have the option of performance). The only disadvantage of C# is in its ecosystem: historically there were a lot of Windows-only libraries; also there were people specifically depending on Java's ecosystem.

Writing your new app in Java is still better than using Electron or something though.

path: 0 617632, hotness: undefined, score: 20, children: 1
letsgoshopping 1 point 3 years ago
path: 0 617632 624541, hotness: undefined, score: 1, children: 0
mrkite 19 points 3 years ago

Started? Java has had a bad reputation since its inception. Slow startup, memory hungry, verbose. The main benefits of Java were its WORA mindset and its memory safety.

Rust takes that safety even further, plus it's making inroads in places Java would fall flat. For example, the M1 video drivers for Linux are written in Rust.

I personally can't wrap my mind around Rust's memory model.. Java is far easier to understand. That said, Rust certainly has momentum that I haven't seen since Java replaced Scheme in every university's CS101.

path: 0 617954, hotness: undefined, score: 19, children: 3
lovechickenfeet 2 points 3 years ago

yeah, is it because the linux community started to accept Rust? I have never experienced on Rust, but definitely it's time for me to use it.

path: 0 617954 621312, hotness: undefined, score: 2, children: 1
Ashiette 3 points 3 years ago

It's also because Rust had made it easier to develop cross platform and the Rust compiler is more efficient than java

path: 0 617954 621312 622346, hotness: undefined, score: 3, children: 0
letsgoshopping 0 points 3 years ago
path: 0 617954 624608, hotness: undefined, score: 0, children: 0
Hotzilla 16 points 3 years ago

Ever since Oracle accuired Java, it got bit annoying in some parts. Of course there are now milllion plus one open source Java JDK/JRE implementations, but it adds another level of complexity.

Previously it was Sun Java, and everyone used that, which was clear.

Now compability between JDK's is like "sure, SHOULD work, but no quarantee"

path: 0 621727, hotness: undefined, score: 16, children: 2
qtie314 2 points 3 years ago

Installing Java in a new machine is always a pain with the multitude of JRE/JDK options. What's correct, what's better, what's free? IDK, good luck

path: 0 621727 635545, hotness: undefined, score: 2, children: 1
JackbyDev 2 points 3 years ago path: 0 621727 635545 700581, hotness: undefined, score: 2, children: 0
UFODivebomb 15 points 3 years ago

Java is improving rapidly. As is the JVM. They are both quality tools that might be the right tools.

I don't program in Java but I do Scala and am familiar with the JVM. The JVM is hard to beat for observability and predictability. Businesses love predictability. Especially enterprise. "500k more? But predictable? Fuck yes." See also: backwards compatibility.

That said the JVM needs to change. Check out the project Valhalla blogs. At the same time the science and engineering of building languages and systems has improved. "New" does not carry the same risk as what the 00s would lead one to believe.

Memory safety is a huge value. I'm sticking to Scala - more my style. Rust is memory safe and native. Which is kinda fucking awesome. So I can see the appeal.

Tl;Dr. Java bad? No.

path: 0 637140, hotness: undefined, score: 15, children: 2
philm 2 points 3 years ago

It's more than just being Rust memory safe, the whole language just feels more I don't know how to phrase that... well/better-designed.

Regarding predictability, what do you mean with it? Regarding performance (memory and cpu) Rust easily wins because of the lack of GC and the power of the ownership system (RAII).

If you mean with predictability "not changing so fast". I think Rust has slowly reached maturity and the current focus lies on increasing the ergonomics of the current features. The major upgrades (switches between editions) are also absolutely painless IMHO, I never had any issues with it. The current trend (see SO survey) also shows that Rust will likely be a good long-term investment for a company (it's still the most loved and fastest growing major language).

path: 0 637140 672473, hotness: undefined, score: 2, children: 1
ExistentialOverloadMonkey 1 point 3 years ago

the whole language just feels more I don’t know how to phrase that… well/better-designed.

There is always Kotlin (and also Scala, if you want to go functional, that is).
It's a very productive and fun language with many great features over Java regarding null safety and other things.

I'd say Rust is only unquestionably best if you really need that last bit of native performance, otherwise, Kotlin might be worth considering as well for many use cases.

path: 0 637140 672473 696445, hotness: undefined, score: 1, children: 0
epicujjwal 11 points 3 years ago

I believe it is just an inclination to use Rust. A lot of companies still use java and one of the reasons being oracle is shitty with the terms, but compiled languages like rust are greater choices than java in terms of speed and efficiency.

path: 0 626249, hotness: undefined, score: 11, children: 0
alr 7 points 3 years ago

So Java is kinda slow. Its "everything is a class" mentality has lost favor as first-class functions have become popular through languages like JavaScript (no relation to Java) and Python. Even C++ has them now.

Independent of the language itself, Oracle (the company that owns Java) has become unpopular in the industry recently as they changed the way the Java Development Kit was licensed, making it significantly more expensive, and for being on the wrong side of the Google v. Oracle suit. (Literally everyone, from the OSF and the EFF to the "big five" tech companies took Google's side.)

path: 0 625889, hotness: undefined, score: 7, children: 9
Sheldan 13 points 3 years ago

Java is not really slow, if implemented well. This is just a reputation it has gotten.

path: 0 625889 630179, hotness: undefined, score: 13, children: 8
funbike 8 points 3 years ago

Depends on what metric you are looking and how. A warmed up JVM will run nearly as fast as Go or Rust, but many benchmarks fail to take JVM warmup into account and erroneously show Rust/Go as orders of magnitude faster, which is unfair. That said, it would be nice if warm up wasn't required. Graalvm helps in that area, but now you have to do something special.

However, JVM startup time is terrible. It's gotten better and there are ways to deploy a trimmed image, but it's still not as good as most other solutions unless you go into annoying extra steps.

path: 0 625889 630179 631208, hotness: undefined, score: 8, children: 1
kevincox 2 points 3 years ago

I've worked at a handful of companies where we would deploy a few times a day and our JVM would almost never get warmed up. It would be getting close to peak performance then a new deploy would occur.

That being said it isn't that slow. Still way faster than the dynamic interpreted languages like Python or Ruby. But it is almost never comparable to non-GCed languages like C++ and Rust.

path: 0 625889 630179 631208 653482, hotness: undefined, score: 2, children: 0
o11c 2 points 3 years ago

Java lacks value types, so it can only be fast if you avoid classes and (pretty much) only use primitives. Some other JVM languages implement them hackily, but C# / .NET does this properly.

Valhalla has been calling for a decade, but the warriors must not be worthy, and looking at their demo stuff I don't think they understand what they're doing with the restrictions they're specifying.

path: 0 625889 630179 634386, hotness: undefined, score: 2, children: 3
JackbyDev 2 points 3 years ago

I think Valhalla will arrive in the next three years. I'm not a betting man, but that's my bet.

path: 0 625889 630179 634386 674627, hotness: undefined, score: 2, children: 1
o11c 1 point 3 years ago

2015 called, they said the same thing.

But e.g. the fact that they're talking about forcing fields to be final means Valhalla's value types are self-sabotaging anyway.

path: 0 625889 630179 634386 674627 676900, hotness: undefined, score: 1, children: 0
JackbyDev 1 point 3 years ago

lacks value types

Valhalla approaches!

path: 0 625889 630179 634386 674623, hotness: undefined, score: 1, children: 0
alr 1 point 3 years ago

Depends on the use case. But I think that's secondary to the other reasons I gave. Java increasingly looks and feels old-fashioned. People really like higher-order functions these days and Java's implementation of that with things like the Bifunctor and Predicate interfaces and arrows as anonymous classes (that can seriously impact compilation time) is really clunky and hamfisted. And Oracle has just been a nasty company two work with of late and I think companies with a choice would rather not.

path: 0 625889 630179 676445, hotness: undefined, score: 1, children: 0
JackbyDev 1 point 3 years ago

I suspect tail latencies will generally always be bad in the JVM because it is garbage collected. If you absolutely must have reliable times and reliable tail latencies then a garbage collected language will not be great. But you're right, in the other cases it is fine.

path: 0 625889 630179 700692, hotness: undefined, score: 1, children: 0
dvektor 5 points 3 years ago

I am jealous of your job

path: 0 652791, hotness: undefined, score: 5, children: 0
delial 3 points 3 years ago

Java is an okay language, but your shop is probably switching, because Oracle changed up the licensing for Java to rake in more money from companies that can't switch.

path: 0 673915, hotness: undefined, score: 3, children: 0
gnus_migrate 3 points 3 years ago

It's really a question you should be asking someone in your company. There is no general answer to this question, and every company has it's own reasons for doing something like this. It could be that the CTO is a moron and wasting engineering time chasing a fad, it could be that staying on Java presents some sort of risk to the company, it could be that Java simply isn't a good fit for the problems the company is solving, there are a million reasons for doing something like this. It doesn't necessarily mean that Java is bad, just that Java isn't really fit for the company's purpose.

path: 0 683281, hotness: undefined, score: 3, children: 0
JackbyDev 2 points 3 years ago

Java is fine, what do you think is wrong with it? You'd have to say why they're switching to Rust, without the details we can't say if it seems right or wrong.

path: 0 673874, hotness: undefined, score: 2, children: 0
funbike 2 points 3 years ago

The JVM is a beast, and it's very inefficient with memory esp strings.

path: 0 631071, hotness: undefined, score: 2, children: 1
o11c 4 points 3 years ago

I would say that strings are one of the least inefficient things in the JVM. Yes, you pay double cost for ASCII, but the memory is contiguous unlike Object-heavy code where you have to pay double size cost and an indirection. Also, slicing is "free" unlike many other languages (though make sure you copy if the parent is going to die).

path: 0 631071 634300, hotness: undefined, score: 4, children: 0
ExistentialOverloadMonkey 2 points 3 years ago

I'm just here to shill for Kotlin because, for non-performance critical applications (and notice I didn't say non-performant!), the JVM can still be an excellent platform.

And while Java still has many of its old 'faults' (a question of opinion, I suppose), it also has come a long way with many cool new features. But yeah, Kotlin really just hits it out of the park, I really want to encourage people to give it a try!

path: 0 696926, hotness: undefined, score: 2, children: 0
Kissaki 1 point 3 years ago

Did you not ask anyone in your company why they're making the switch?

What makes you think it's bad reputation in California?

path: 0 719021, hotness: undefined, score: 1, children: 0
philm -4 points 3 years ago

Ah nice to hear, people come to sanity in your company :X

I've programmed in all kinds of languages and Java (and the likes like C# IMHO) often felt like programming boilerplate all the way (spoiler: I don't like OOP, why should I ever need an abstract factory? And I never understand why error handling needs to be done with exceptions, just use return values monadic style). The type-system, composability and power that Rust has, is IMHO unparalleled (the combination, there are languages for each of these topics that are more powerful I think).

JVM is just outdated IMHO (I don't want to list the reasons why JVM is bad, that is googleable, but one thing I don't like much is lack of monomorphisation and integration into the web), I think Rust shows that a GC is not necessary for having a nice-to-use high-level crossplatform language (even frontend web is working remarkably well).

path: 0 672216, hotness: undefined, score: -4, children: 0

thanks for using Leebra!

go to feed...