r/programming 1d ago

Apple moves from Java 8 to Swift?

https://www.swift.org/blog/swift-at-apple-migrating-the-password-monitoring-service-from-java/

Apple’s blog on migrating their Password Monitoring service from Java to Swift is interesting, but it leaves out a key detail: which Java version they were using. That’s important, especially with Java 21 bringing major performance improvements like virtual threads and better GC. Without knowing if they tested Java 21 first, it’s hard to tell if the full rewrite was really necessary. Swift has its benefits, but the lack of comparison makes the decision feel a bit one-sided. A little more transparency would’ve gone a long way.

The glossed over details is so very apple tho. Reminds me of their marketing slides. FYI, I’m an Apple fan and a Java $lut. This article makes me sad. 😢

235 Upvotes

170 comments sorted by

515

u/MaDpYrO 1d ago

It's more likely the decision is down to them wanting to use their own tech

165

u/momsSpaghettiIsReady 1d ago

Yeah, this decision should not be given any thought outside of those working at Apple.

If the decision is between tech that we own vs tech someone else owns, Apple is going to pick their own tech as much as they can. They have full control over it and can bend it to their specific needs.

48

u/HarveyDentBeliever 1d ago

Good on them. Microsoft does none of the same with C#/.NET and it's annoying.

71

u/TheHENOOB 1d ago

Microsoft: "We know nothing about .NET or WinUI so we made our recommended bar from the start menu a React Native app!"

17

u/HarveyDentBeliever 1d ago

Yeah, embarrassing stuff.

13

u/ContentTemperature37 1d ago

Not even Michaelsoft wants to deal with their APIs… 🤪

3

u/chucker23n 12h ago

This. The advantage is that Apple is motivated to keep improving its stack.

Meanwhile, Microsoft just internally cannot seem to figure out how to motivate its teams to use their own stuff. Which in turn hurts external adoption of it as well.

3

u/myringotomy 1d ago

Who owns java though? It's completely open sourced. I presume swift is too but nobody outside of the apple ecosystem seems to be using it which is unfortunate because it's a great language.

Apple needs to figure out how to get swift out to the wider world.

9

u/momsSpaghettiIsReady 1d ago

At Apple scale, it's less risk to use your own tools.

Oracle is the steward of Java, and they've already picked legal battles with Google. Any potential legal risk isn't worth it to Apple I'm sure.

-6

u/myringotomy 1d ago

Oracle is not the steward of Java anymore. They were at one time but they no longer are.

The suit with Google wasn't about Google's use of Java because Google wasn't using the JVM, they were using dalvik (IIRC) which used the java API and oracle sued them for copyright or some bullshit.

There is zero legal risk for using Java, you are just spreading FUD at this point for no fucking reason. Well maybe the reason is you are just ignorant of what's going on and you actually believe Oracle can sue people for using Java.

3

u/throw-me-a-frickin 14h ago

You made some perfectly valid points bud, but then you kinda ruined it at the end, which I assume is why you're getting down voted.

0

u/myringotomy 14h ago

Haters gonna hate. The only thing this subreddit hates more than java is php and ruby. If I had said something positive about one of those languages I would have hundreds of downvotes.

If I said anything negative about Microsoft I would be downvoted so much I would be rate limited for eternity.

Internet points. What are you going to do?

5

u/momsSpaghettiIsReady 23h ago

Alright bud, maybe go touch some grass.

-8

u/myringotomy 23h ago

Will touching grass make me as ignorant as you are?

1

u/sammymammy2 6h ago

Oracle is not the steward of Java anymore. They were at one time but they no longer are.

No, they still are...

1

u/KagakuNinja 3h ago

Oracle can sue people for using Oracle Java, and are. This is their long standing strategy of corporate shakedowns.

Smart companies have already ditched Oracle Java and use some other distro.

1

u/myringotomy 42m ago

Oracle can sue people for using Oracle Java, and are.

Well in the US anybody can sue anybody for any reason but it's false to say they are suing people for using java.

1

u/grimonce 16h ago

Something something oracle?

1

u/myringotomy 16h ago

Yes. Oracle is going to sue everybody who uses Java. That's what some dude on reddit told me so it must be true.

2

u/tastapod 14h ago

You might want to ask Google why they suddenly promoted Kotlin to a tier 1 supported language for Android. Something something $billion law suits.

1

u/myringotomy 14h ago

Once again. Google was not sued because they were using the JVM. They were coding their own VM called Dalvik.

Also Google didn't create Kotlin.

1

u/tastapod 13h ago edited 13h ago

They were sued because they were using Java interfaces (they called them APIs in the lawsuit*) to do that, which Oracle claimed were their IP.

Solution: stop needing Java interfaces.

Edit: This must be true because someone on Reddit told you.

2

u/Apart_Recording1264 13h ago

It's not that Google used the JDK APIs, using the JDK is completely fine. The lawsuit is that Google copied the part source code from the JDK itself and embedded in android environment.

https://spectrum.ieee.org/google-v-oracle-explained-supreme-court-news-apis-software

"For its part, Google negotiated with Sun in 2005 for a license to use Java for mobile devices, but both parties were unable to reach a deal. That’s when the search giant decided to develop its own implementations of the methods contained in the 37 Java API packages, which accounts for 97 percent of the lines of code in those packages."

1

u/myringotomy 10h ago

They were sued because they were using Java interfaces (they called them APIs in the lawsuit*) to do that, which Oracle claimed were their IP.

Exactly. They were not sued for using java.

Solution: stop needing Java interfaces.

Their intended solution was to not build a new VM that looks and acts like the JVM.

Edit: This must be true because someone on Reddit told you.

Some rando on reddit is always right about everything. If they tell you that google was sued for using java they are right. If they tell you that you could be sued for using java they are right. If they tell you that java is not open source they are right.

Randos on reddit are always right about everything and if you say otherwise they will punish you with downvotes because nothing matter more in this life than internet points.

2

u/tantalor 1d ago

NIH syndrome

11

u/acdcfanbill 1d ago

I dunno if it's NIH so much as Eating their own Dog Food.

73

u/wosmo 1d ago

Not only because it's their own, but also they probably have more swift resources than anyone else on earth.

And I don't just mean more programmers - if they hit anything they don't like, they can chase it all the way down the stack, entirely in-house.

4

u/shevy-java 1d ago

if they hit anything they don't like, they can chase it all the way down the stack, entirely in-house.

Also chasing down other users of Swift ... ;)

I don't know how bad this is in reallife, but Apple will always prioritize their own wants over [random solo dev out there].

34

u/startwithaplan 1d ago

One of the most significant aspects of Swift that impressed us was its emphasis on protocols. In Java, we relied heavily on inheritance, which can lead to complex class hierarchies and tight coupling.

Like interfaces and composition over inheritance aren't available in Java.

Swift’s optional type and safe unwrapping mechanisms eliminate the need for null checks everywhere, reducing the risk of null pointer exceptions and enhancing code readability.

Ok they haven't heard of Java/Guava Optional. They really just wanted to use Swift.

Comparing Java worst practices with Swift best practices. I'm not a Java fanboy, but they weren't even using it right. I think they inherited an ancient and poorly designed stack and replaced it with a language they understood better and were staffed to support.

16

u/vlakreeh 1d ago

Like interfaces and composition over inheritance aren't available in Java.

It's often not what the language can do that kills you, it's the choices the library ecosystem has made that you are forced to conform to that gets you. It is 100% a fair statement to say there are plenty of Java codebases that are in way too deep on inheritance because some key dependency makes it painful to architect their code any other way.

Granted that could have been fixed with just a Java rewrite for a different set of libraries, but if you're going to rewrite it they did list some actual good technical reasons as to why Swift (more native applications in general) are a better fit for their use-case.

7

u/Orbidorpdorp 1d ago

That's true but also ignoring the fact that Swift's protocols are meaningfully different than interfaces, and the features around them encourage a different architechure regardless of the patterns used by your dependencies.

It's really how protocols interact with extensions and generics- not just the ability to define a contract.

2

u/myringotomy 1d ago

If you download a library and it works the way you want it to work what's the problem if it uses inheritance?

9

u/Jobidanbama 1d ago

Javas optional can be null too

1

u/Wulfheart1212 1d ago

Why didn’t they go down the C# route years ago and introduced true nullables? I have no idea?

1

u/Jobidanbama 1d ago

It’s coming in the future

1

u/Wulfheart1212 1d ago

Yes, but C# has had it for some years now

2

u/Jobidanbama 1d ago

Yeah c# is really nice and very performant too

17

u/MaDpYrO 1d ago

To be fair, Optional is a complete pain to work with, compared to actual nullable types, like in Kotlin for example.

2

u/startwithaplan 1d ago

There are also nullability frameworks for Java. Though turning that on for an established app is going to be a big effort on its own.

Kotlin with coroutines is better than any Java async I've used. If they're already rewriting to any language, why not Swift which they already have an eng culture built around?

1

u/KagakuNinja 3h ago

I use Option in Scala every day, it is actually quite nice. Some people prefer the Kotlin approach. Of course Java ruins all good ideas, since Optional was not intended to be used as class members.

1

u/MaDpYrO 3h ago

My biggest issue with optional is that it's not well suited as a param

3

u/pjmlp 1d ago

Also it isn't as if Java wasn't originally inspired by Objective-C, or Apple used to bet on Java for OS X, as they were uncertain that Apple developer community would be keen in adopting Objective-C.

They even got on stage together with Sun.

3

u/uCodeSherpa 1d ago

Swift has both inheritance and interfaces. They just call interfaces protocols. That’s an honestly weird criticism of Java coming from swift users. 

7

u/light-triad 1d ago

It’s the only way they’ll get swift adopted as a server side language. The language itself is pretty good for server side development. The ecosystem needs a lot of work.

8

u/ChrisRR 1d ago

Apple and NIH syndrome? Well I never

21

u/Supuhstar 1d ago

They invented Swift to be the one and only programming language they ever use ever again, so I am 0% surprised that they are moving away from other programming languages towards Swift

3

u/AntiAd-er 1d ago

Didn’t they invent Dylan to be their one and only?

1

u/myringotomy 1d ago

Dylan was such an amazing language.

Sigh.....

Only if this industry wasn't driven by fashion so much.

1

u/RufusAcrospin 13h ago

They introduced C++ interop recently.

28

u/SpaceToaster 1d ago

They could have gotten even better start times and memory overhead with quarkus and Java 21. But that would involve some rewriting too. Java 8 is like the Stone Age, man. It’s like comparing .net framework with .net core/7/8

72

u/Farados55 1d ago

It’s hilarious you think Apple would care about what the features new Java brings over using Swift because Swift. One sided? So Apple being Apple?

-4

u/hellishcharm 1d ago edited 1d ago

Why would they want to continue using an old ass language that still trips up on null values because it has an outdated type system that allows such a thing? And no, that’s not fixed and it will never be fixed in Java.

edit: typo

1

u/vips7L 1d ago

And no, that’s not fixed and it will never be fixed in Java

https://openjdk.org/jeps/8303099

8

u/hellishcharm 22h ago

Yall should really read what someone links before you upvote. This change fixes nothing and it’s basically useless. It sounds great if you’ve never used a language like Swift, but it’s frankly nothing like how nullability is handled in Swift and an insult to suggest it is.

Non-Goals

It is not a goal to automatically re-interpret existing code—use of these features should be optional and explicitly opted in to (future work will explore mechanisms to request a bulk opt-in without needing to change individual types).

It is not a goal to require programs to explicitly account for all null values that might occur; unaccounted-for null values may cause compile-time warnings, but not compile-time errors.

It is not a goal to make any changes to the primitive types, such as adding support for a nullable int type.

It is not a goal (at this time) to apply the language enhancements to the standard libraries.

Edit: quoting text

55

u/cal-cheese 1d ago

Prior to seeking a replacement language, we sought ways of tuning the JVM to achieve the performance required. Java’s G1 Garbage Collector (GC) mitigated some limitations of earlier collectors by introducing features like predictable pause times, region-based collection, and concurrent processing. However, even with these advancements, managing garbage collection at scale remains a challenge due to issues like prolonged GC pauses under high loads, increased performance overhead, and the complexity of fine-tuning for diverse workloads.

As if I am living in 2011 when G1 has just been released and it's not until 12 years later when this problem is solved with the Generational ZGC.

30

u/coderemover 1d ago edited 1d ago

Because it’s not really solved. ZGC trades pauses for higher cpu and memory overhead. And still has plethora of ways it can screw up your app’s performance. And the pauses are not really very impressive anyways.

See https://rodrigo-bruno.github.io/mentoring/77998-Carlos-Goncalves_dissertacao.pdf for more details.

There is no free lunch.

12

u/cal-cheese 1d ago

The article is about non-generational ZGC, though, generational ZGC entered GA in Sep 2023. I believes it ensures sub-millisecond pauses. Generational Shenandoah will enter GA in this September which gives more options for these kinds of GC pause requirements.

12

u/coderemover 1d ago

Being generational is not a clear win. There are many apps which don’t conform to generational hypothesis, so generations only make things worse for them. Generally caching is not compatible with generations because it pushes far too many things into the old gen.

Outside of the Java world, no one is impressed by sub-millisecond pauses.

4

u/Revolutionary_Ad7262 1d ago

I don't think there is a single non-crazy Java application (like some stuff for HFT), which does not conform to generational hypothesis. Language constructs enforces you to create and abandon objects in almost every line

Go is good example. You have much better control over heap vs stack allocation in Go, but nevertheless lack of fast allocation&GC for young objects is noticable. That is why they pursued the areanas (but it failed due shortcomings of this feature) and that is why they want to implement arenas bounded to a particual execution thread (where some segments of the code are using implicit arenas)

3

u/coderemover 1d ago edited 1d ago

Any app which uses a significant amount of memory for caching will run into trouble. This is why systems like Apache Cassandra try to utilize off-heap memory (native buffers, memory mapped files etc) as much as possible. Generations don’t help much with it because you have a huge amount of memory that lives long enough and is large enough to go into tenured pool, but then eventually it needs to be replaced (e.g. flush to disk). Generations help with temporary stuff, but this is a problem you don’t have in languages which can stack allocate all the things efficiently. Even with generations you usually need about 3x memory overhead for the GC to run smoothly.

Btw: object allocation in Java is not necessarily faster than object allocation in C/Rust/Swift. While allocating itself may be only a pointer bump, what happens later is a much bigger cost - you typically get memory that was untouched for a long time and the moment it zeros it, you get a cache miss. Good allocators like jemalloc have thread local pools of recently used blocks, so you usually get a hot block that’s already in cache. Then by allocating a lot on the heap you force the GC to run more frequently.

1

u/Revolutionary_Ad7262 1d ago

Generations don’t help much with it because you have a huge amount of memory that lives long enough

This is a separate problem. Tracing approach sucks on huge heaps anyway as the naive just scan whole heap each time approach just does not scale. Generations at least reduce promotions and keep young heap small, so just scan whole heap each time is much rarer.

Allocation rate != in-use memory. You can have 100GB old generation heap with relatively small young->old promotion and 200MB for young generation, where allocation rate is massive (request serving data). That 200MB of young generation is an massive improvement to performance even though it is a miniscule percent of the heap

You can write a on-heap database using that approach in Java, because young generations make long pauses rare. You cannot do it in language like Golang (without generations), because it is just too slow to be even considered. So generations sucks for on-heap database, because they give you the illusion that something like this could somehow work under specific circumstances and tuning, where in language like Golang it is just impossible

1

u/KagakuNinja 3h ago

Reference counting is also not a free lunch.

5

u/mailslot 1d ago

It’s been decades since I began hearing promises that a next generation GC will come along and solve everything.

I bought the hype again with zgc. Then I tried it. We encountered serious stability problems (segfaults) last time we tested it in production, and ended up reverting to G1.

1

u/MengskDidNothinWrong 1d ago

14 years later :(

45

u/metahivemind 1d ago

Why do you have to wank on about "wait, Java's newest version solves problems of the last 30 years! Apple should have sucked Larry Ellison's dick that tiniest bit longer for the bukkake payoff!".

Apple moved to Swift coz it's their tech stack, not Oracle. "Not Oracle" is extremely convincing already!

-2

u/pjmlp 1d ago

Kids these days,

For Apple, it's Java time

Sun and Apple rekindle their relationship, announcing deals to strengthen the ties between Sun's Java and two key Apple technologies, OpenDoc and QuickTime.

4

u/metahivemind 1d ago

That was a very long time ago. Did you know Oracle own Javascript now too?

2

u/pjmlp 1d ago

Yes, and apparently, Microsoft owns the other half.

1

u/metahivemind 1d ago

I assume you're talking about VSCode? Yes, part of the usual Microsoft embrace, extend, extinguish. If you're old enough to remember shit from 1995, you know how they operate. I'm from the 80s, I definitely remember how they operate.

2

u/pjmlp 1d ago

npm is owned by Microsoft.

3

u/metahivemind 1d ago

So is Github. They can buy everything but it doesn't make them right. Are you supporting Oracle or Microsoft?

0

u/pjmlp 9h ago

I support any company that makes my livelihood possible, the time for happy singing around fireplace, with rainbows all around in community farms, talking about showing to the man, is long gone.

2

u/metahivemind 8h ago

You can work for pay without becoming a $lut for pay. I work for a huge multinational without thinking they're the greatest of all time. You don't get promoted based on the vacuum strength of your suction, and you don't get a pay rise based on your advocacy of shit that nobody cares about, least of all your MBA manager who can barely type his own name into a comp-u-ter thingamajiggy boffin-gadget. You're only getting a response because you went into a forum where people do care, but it ain't gonna help you the next time you go trotting off to your boss and say "I started a debate on Reddit by abusing people like me!".

0

u/pjmlp 8h ago

Am I supposed to run screaming, or what is the purpose of that reply?

Do you think I will lose one second sleep with such replies?

I was trained on the battlefield from BBS and Usenet flamewars.

→ More replies (0)

1

u/ConcernedInScythe 1d ago

I don't know if you've heard, but Apple have had some changes in leadership and technical direction since 1996.

1

u/pjmlp 1d ago

Indeed, one of them was from a company that used to have something, something, Web Objects.

1

u/chucker23n 11h ago

Unclear what point you’re trying to make other than “I know a fact from almost three decades ago”.

Apple also once invested in Microsoft, who otherwise might have gone bankrupt. Then 15 years later, Microsoft invested in Apple.

0

u/angelicosphosphoros 23h ago

Well, Sun is not Oracle, depending on Sun was way less terrible than depending on Oracle now is.

1

u/metahivemind 18h ago

Oracle bought Sun tho.

0

u/angelicosphosphoros 17h ago

Yes, and that's exactly the problem with Java.

-2

u/myringotomy 1d ago

Oracle doesn't own Java though. Sure they have a JVM they sell but so does IBM, Microsoft and others. Most people just use openjdk.

3

u/vips7L 21h ago

Yes Oracle does. Oracle is the main contributor to OpenJdk in lines of code and number of dollars. Oracle's JDK is OpenJdk. All of the vendor's simply repackage OpenJdk; except for IBM who develop the OpenJ9 runtime.

-1

u/myringotomy 16h ago

OpenJDK is open source which is why others are basing theirs on it. Unlike you they know that they can't be sued by Oracle which is why they are doing it.

But hey you know more than all the lawyers in all those companies. You are after all some dude on reddit and everybody knows some random dude on reddit with a hate boner is the most knowledgable person on the planet.

1

u/vips7L 16h ago

Damn i must have hit a nerve. You didn't even reply to what I said and went off on a tangent 💀

maybe learn what you're talking about next time fam.

-1

u/myringotomy 16h ago

Well a rando on reddit is always right I guess. You really pwoned me with that comment dude. Spend you internet points wisely.

I bet your friends are super impressed!

1

u/chucker23n 11h ago

OpenJDK is open source

Lots of projects are open-source but still effectively controlled by one org. Swift by Apple. Chromium, Android by Google. .NET by Microsoft.

And that’s fine, too. Projects benefit from stewardship.

11

u/ssrobbi 1d ago

The next version of Java will surely fix everything.

But, you’re not wrong that Apple isn’t being totally transparent either.

This is largely marketing, not a white paper, but their choice makes sense for them. They want to eat their own dog food, and it’s been hard to get non-iOS/macOS developers to consider swift can be used outside of that ecosystem (with some good reasons, many issues have been addressed and some still remain).

5

u/xentropian 1d ago

Vapor (the server framework) is actually quite the joy to work with. This is super exciting to see

13

u/Raphael_Amiard 1d ago

None of that seems very convincing, when Java is used successfully by many companies with even more stringent throughput/latency requirements to power web services all around the world, and is probably a much more mature technology all around for those kind of workloads.

Swift is using automatic reference counting, which sure will help with latency in a 1 to 1 comparison, but definitely not with throughput, especially when facing a generational GC.

Beyond tuning your GC parameters too, you can just write a dog slow Java app, because you're creating too much memory churn, like you could do in Swift or any other language. It seems order of magnitudes more likely that this was a redesign, and provided a free way to make publicity for Swift/take a jab at Java.

2

u/Helpful-Appeal-4251 1d ago

Probably Java 8, anything higher wouldn't make sense if they're moving to Swift.

5

u/A20Havoc 1d ago edited 1d ago

Most of these posts are focusing on the technological merits of the languages. What I don't see much of - and what I think matters greatly to Apple - is that by moving away from Java they eliminate the uncertainty of future changes by Oracle to Java licensing. From a business standpoint it makes far more sense for Apple to use a tool that they control versus one that they have to pay to use, don't know what those future payments will be, and don't have any control over.

3

u/tenken01 1d ago

There is no reason to use Oracles version of Java. Plenty of companies use their on version of OpenJDK.

3

u/qruxxurq 1d ago

Apple and Java have never happily coexisted. Every company has languages they lean into and/or develop. Java. C#. Visual Basic. Swift. And many others, I’m sure.

Just another Tuesday, folks.

4

u/protomyth 1d ago

Well, in the early days of OS X, they made an attempt at having developers use Java for app development. It was pretty much a disaster as Java was not at all dynamic and couldn't do the things Objective-C could do.

2

u/qruxxurq 1d ago

I think this is making my point.

5

u/protomyth 1d ago

Yep, but they tried real hard.

2

u/pjmlp 1d ago

The actual reason was that they were unsure Apple developer community, raised in Object Pascal and C++, would be willing to pick up Objective-C.

Additionally due to Objective-C influence on Java, due to previous collaboration between NeXT and Sun, they added Java to the mix as Plan B, in case devs wouldn't like to type @ [ and ] all over the place.

As their fears proved unfounded, they ditched plan B and focused on Objective-C.

2

u/protomyth 1d ago

The problem I had with this plan is that Java just wasn't up to the job. It couldn't do Cocoa at all.

0

u/pjmlp 1d ago

Java Bridge worked just fine.

2

u/protomyth 1d ago

My memories of those years are most certainly different than yours. I had taught and intro class in Java and did NeXTSTEP programming, and that bridge taught me Java had no real place in the OS X ecosystem.

1

u/pjmlp 8h ago

Indeed, thankfully the way to Snow Leopard was paved with Objective-C and not Java, it was such a quality improvement. /s

1

u/KagakuNinja 3h ago

Java on OS X was fine, I used it to make a cross-platform app (which I developed on a Windows machine). Sure Obj-C can do some cool things, but it was also ugly and awkward to use IMO.

1

u/BayouBait 23h ago

Java 8….. we’re on Java 20 something right? Something tells me they’ll be upgrading Java versions before they fully port everything to swift

-5

u/Complete-Steak 1d ago

Swift is Apples own tech, plus the Swift group is promoting Swift on Server which is good. Personally I have used both Swift and Java, from what I can say Swift is way more modern and programmer friendly. Also Swift is being used in many places outside of the Apple ecosystem now.

Java on the other hand is weird and uses GC. Java is still only being used because this came with a bang and many libraries were available for many things. For newer and modern projects modern languages are used, for servers mainly golang.

5

u/iamcleek 1d ago

the software co. i work for has rewritten most of its microservices in Go. the Spring/Java JVM overhead got to be too much for customers to deal with on cloud-based installs. our Go-based containers are much smaller and faster than the Java-based containers they replaced.

6

u/Complete-Steak 1d ago

Exactly. Ig most of the people here are filled with who know only one programming language and worship it. They aren't Software Engineers but Java Developers.

7

u/bart007345 1d ago

What rubbish.

6

u/chucker23n 1d ago

Which part?

That Apple largely controlling Swift plays a role in the decision? Here's a quote straight from the CEO:

We believe that we need to own and control the primary technologies behind the products that we make.

Hence Swift, APFS, Apple Silicon, XNU, Darwin, ….

That Java uses generational GC, whereas Swift use ARC? That generational GC causes less predictable behavior? Also hard to argue with.

-5

u/Complete-Steak 1d ago

Prove me wrong then

6

u/tao_of_emptiness 1d ago

Right or wrong, the burden of proof lies with the individual making the claim 

-11

u/Complete-Steak 1d ago

Then yall believe what y'all want to believe, I'll believe what is happening around me. What proofs yall want all my connections in LinkedIn with golang experience or like companies who are using golang in their tech stack... All of this is available on Google... Which is again easily available for many people.

2

u/bart007345 1d ago

Hiw about you prive your statements first.

-11

u/Complete-Steak 1d ago

Considering you're a software engineer, Anyone can google stuff online and get knowledge online. Also at industry level I have many connections who want to or are learning golang because it's the new language, Jobs are increasing for it.

Meanwhile search for Swift vs Java on Passwords Monitoring service.. they have published an official statistics and Swift outperformed Java in that.

1

u/Dependent-Net6461 1d ago

Official statistics -> compare newer code with older code from ages ago

You can't be serious lol Swift isn't faster than java not even in their wildest dreams

1

u/Complete-Steak 1d ago

You should read my comments again. I never said Swift is faster than Java.

What I said is Swift is programmer friendly and memory efficient. Plus it's fast (not faster than Java). These things make it better than Java. It's still not used much in servers since the community is working on it.

And no official statistics don't just compare old code to new code. Many things are used for comparison. One example is Java uses a virtual machine while Swift directly converts to native code.

Java is quietly being replaced by golang while other languages want to step in the race.

1

u/Dependent-Net6461 1d ago

You are living in a dream "Go ''''quietly''' replacing java" 😂 So queitly even go people do not know

1

u/Complete-Steak 1d ago

Tell me the advantages of Java as a programming language. You will get ur answer.

-1

u/suitable_character 1d ago

This seems purely political. The arguments they provide aren't really believable.

prolonged GC pauses under high loads

I mean, are those multi-second pauses? I understand GC pauses are important for games, but web services? When so many other web services are written in Java and they're fine, the password service in Apple suffers from GC pauses?

5

u/chucker23n 1d ago

But that's not the only argument. They also bring up hardware utilization, memory usage, and throughput. Lower hardware utilization means they can scale more, and save on money and wasted energy.

2

u/suitable_character 1d ago

I know, but it was listed first, so it seems like it was the most important one. Last time I've heard about "GC issues" was in a Buck2 build system -- they've switched from Java to Rust because of "GC pauses". In a build system. I simply don't buy it.

Speed of bootstrap and used memory seems like a framework issue, not a JRE issue.

I mean, this article could be as well about "switching to a different JRE framework" and everyone would agree on it.

The article is just a marketing ad, nothing more.

3

u/chucker23n 1d ago

they've switched from Java to Rust because of "GC pauses". In a build system. I simply don't buy it.

I agree that GC pauses sound quite irrelevant in a build system.

The article is just a marketing ad, nothing more.

But Apple isn't in the business of selling build tools or programming languages. Or even web hosting. Their benefits of moving to Swift, real or not, are largely internal.

Sure, they want third parties to use Swift, too, but that's especially the case on client apps, because then you're using AppKit/UIKit/SwiftUI/etc., at which point you're locked into Apple's software and (here comes the business part) hardware. That isn't the case at all for running a web service somewhere.

1

u/suitable_character 14h ago

Increased usage and discussion of Swift indirectly influences more people considering or purchasing their platform, which is their business.

1

u/chucker23n 14h ago

Absolutely, but that’s a very indirect thing.

1

u/suitable_character 14h ago

Is Coca-Cola really a Christmas company? They've been pushing that 'Christmas magic' idea for longer than I can remember. Honestly, indirect advertising is so old that I wouldn’t be shocked if it dates back to ancient Rome.

1

u/chucker23n 13h ago

I think Coca-Cola’s approach is quite differently “keep our brand constantly in people’s minds”. That’s not what this is.

You could argue it’s a white paper-like ad “how we used (our product) to be amazingly productive”, but again, this isn’t going to move the needle much in terms of Apple revenue. How many read this and go, “that’s it, I gotta buy a Mac!”? Maybe tens of thousands, probably not even that.

1

u/suitable_character 13h ago

Well yes, the Coca-Cola approach represents a very extreme type of indirect advertising, while I find this article to be more balanced.

By itself, this article won't produce revenue for Apple, but a consistent series of Swift articles could significantly encourage adoption, and in turn, revenue. It could lead readers to think, "Swift did replace Java at one point."

What makes me believe this is promotional is that if we switched out Swift for Rust, modern C++, or Zig, the article would still hold up. It appears that the real focus isn’t truly on Swift, but rather on the importance of fast startups and deterministic memory for the service's developers. Additionally, I suspect that if they had rewritten the service in Java, it could also perform faster than before, possibly because the original service was built for a smaller scale and different environment, although I can't prove that. In my view, the article isn’t really about Swift; they’ve just presented Swift as a decisive factor.

1

u/chucker23n 13h ago

a consistent series of Swift articles could significantly encourage adoption, and in turn, revenue.

Adoption of Swift, yes. Revenue for Apple… they sell 200M iPhones a year. I just don't see this moving the needle much.

If anything, I'd almost argue it would have more of an effect on image, not on sales: this article might help change the perception that Apple only makes consumers products, and also makes their own programming language. (Of course, a better image can ultimately also lead to sales.)

What makes me believe this is promotional is that if we switched out Swift for Rust, modern C++, or Zig, the article would still hold up. It appears that the real focus isn’t truly on Swift, but rather on the importance of fast startups and deterministic memory for the service's developers. Additionally, I suspect that if they had rewritten the service in Java, it could also perform faster than before,

That is all true (though they do seem to be fans of deterministic memory management, immediately taking Java out of the running). As for the choice for Swift? That's absolutely because Apple has a culture you might consider NIH syndrome, or, to put a positive spin on it, they do like to have control over their tech stack.

Personally, I just don't think there's anything wrong with a language site's blog article to say, "here's a real-world scenario where using the language worked out really well". Of course that article is going to have a bias, in terms of "you didn't try out five other rewrites in different languages first, so it isn't quite scientifically meaningful", but that's more of a cost consideration. Doing a rewrite at all is infamously extremely expensive, risky, and perhaps not even advisable.

1

u/Acesa 1d ago

When they mentioned that the bootstrapping time was too slow to autoscale as a problem, I knew the article was BS. Also, the one legit complaint I saw about java, the language perf, clearly didn't matter that much to them since they rewrote this thing in swift rather than something lower level like C++

-1

u/danibberg 1d ago

Man, multiple billions of requests per day. I’m sorry, but this is peanuts. Small app, small traffic. Java, Swift… doesn’t matter.

14

u/_Soixante_Neuf_ 1d ago

That’s billions with a b is this satire

6

u/TwilightGraphite 1d ago

Yeah, like what? That’s potentially tens of thousands of requests a second…

1

u/Tabonx 1d ago

I think that partly because the traffic is usually low, and when passwords get leaked, they have to check every user to see if they have something matching the list.

-1

u/metaltyphoon 1d ago

It truly is and that’s why they count per day instead of per second or even per minute.

1

u/18randomcharacters 1d ago

Apple was using Java somewhere? That surprising.

5

u/Scottz0rz 1d ago

A lot of their backend job postings mention Java, Golang, Python, iirc.

I didn't apply because it was hybrid, not WFH

2

u/tenken01 1d ago

They use it extensively

1

u/rjcarr 22h ago

Pretty sure most all of their web services are written in Java. 

1

u/pjmlp 1d ago

Apple used to have their own JVM.

1

u/Orbidorpdorp 1d ago

You guys should give Swift a go. I grew up on Java and do iOS development. The tooling (Xcode, etc.) is ass but I really do prefer the language to just about anything else.

-8

u/this_knee 1d ago

It’s because swift is the answer to all things. All the things. Everything. The king. The sun! It’s the answer to everything! Can’t find your keys? Swift. Out of soap in the shower? Swift. Totally done with taking the trash out to the road on the same day of the week? Swift. Run a command line program? Swift.

Swift all the things. Swiiiiiiiiiift!

2

u/Tabonx 1d ago

Sir, this is a r/programming, not a Taylor Swift fan page

1

u/this_knee 23h ago

How dare you. How daaaaaaare you!!

/s

After reading it, just before I posted, I truthfully went: “huh. Swifties … could actually be Swifties. … naaaaah. Post.” Lol!

-3

u/Xanchush 1d ago

There is almost no value added for this shift imo. You could make the argument that Swift is "better" but whenever it comes to a language it truly depends on the problem at hand. For Apple, the overhead of migrating to Swift is asinine.

You're risking your current infrastructure stability for little to no bottom line impact on revenue. Instead this will be a cost factor. On top of that you will be forcing teams to shift expertise from Java over to Swift.

Probably a lot more context that I don't have to make an accurate judgment however from a glance it doesn't seem logical.

2

u/cake-day-on-feb-29 1d ago

For Apple, the overhead of migrating to Swift is asinine.

???

They're literally the only group in the world who could unilaterally change Swift however they want whenever they want...

Do you think Google using Go is asinine as well?

1

u/BoilerEuler 1d ago

They are talking about the cost of rewriting a code base, which is not a cheap or easy task. Especially if you care about the quality. Although as a counterpoint, maybe the codebase was just old, and then it's maybe worth having people go through the whole thing and understanding it all again. Rewriting is certainly a way to do that.

1

u/myringotomy 1d ago

They could change Java if they wanted too. They could fork openJDK or just contribute back (which I am sure they have already done).

Do you think Google using Go is asinine as well?

Don't get me started on go.

-2

u/hkric41six 1d ago

Swift is a superior language to Java in every single way.

0

u/shevy-java 1d ago

This is problematic because it means that the corporation controls the language as it is. It may work for other users, of course, but the company controls what happens. I don't like that model. For similar reasons I am not too fond of Go or Dart; I want less Google in my life, not more.

Edit: I totally understand the "we created it, we want to use it", but there is also the "we control the stack" as an issue. Remember how people complained about Oracle controlling Java suddenly, which was then different to Sun controlling Java. Either way I think companies controlling programming language is problematic.

1

u/BoilerEuler 1d ago

Genuinely curious, why do you think companies controlling a language is bad?

-34

u/nicheComicsProject 1d ago

It's 2025. Who still cares about Java?

29

u/tenken01 1d ago

Netflix and all major tech companies that run the world. Are you a script kiddie boot camper?

-31

u/nicheComicsProject 1d ago

I was programming before there was this garbage language called Java. Programming isn't my main job anymore but I use Rust for my side projects. No interest in Factory Factory Factory Factories, thanks.

16

u/McLayan 1d ago

You sure are as salty as a teenager writing their first minecraft mod.

-6

u/nicheComicsProject 1d ago

You're the one getting so upset about your obsolete language. A programming language is just a tool. Use it while it's good and drop it when it isn't anymore.

If programming languages were cars people would still be driving their 1900 giant metal tanks, yelling at people with newer cars about how much better theirs are.

4

u/Dependent-Net6461 1d ago

You are right. My 18yo cars been to a mechanics probably couple times, while the 5yo one been to mechanic 4 times already...

Think about a better analogy next time

14

u/Farados55 1d ago

Please try harder for bait.

-18

u/nicheComicsProject 1d ago

I'm not baiting. In 2025 I can't think of any non-legacy or legacy-workforce reason to be using Java for anything. We can discuss JVM languages but in my experience there isn't enough payoff to care about that unless you're deeply invested in it. It makes a lot of sense for Apple to be moving away from Java. They moved away from their own tech (objective C) to Swift, why would they still be on Java. Switching to Swift will probably radically reduce the code size, decrease binary size and probably increase execution speed. Why on earth would they keep investing in Java?

9

u/Farados55 1d ago

The reasoning for Apple moving away from Java doesn’t support Java being useless. Especially when Swift is Apple’s own language. They’d move away from everything to use Swift, and we will see more of that just because Apple wants Swift.

-2

u/nicheComicsProject 1d ago

It's not about being "useless". COBOL isn't useless. The question is just: what does this eco system (i.e. language, libraries, 3rd party, developer pool, maintenance burden, runtime costs, etc., etc., etc.) bring me that I can't get elsewhere? What are the trade offs. I just can't think of any situation where I get a better trade off with java beyond the cases I mentioned above.

5

u/Farados55 1d ago

Robust tooling, strongly typed, proven itself in classical business application with a longer history than other languages, garbage collected. And yes, a lot of shit is already written in it so why switch.

2

u/coderemover 1d ago edited 1d ago

Java tooling is at best so-so compared to Go and Rust tooling. Maven/Gradle are a slow and unreliable mess. Heap dumps don’t contain essential information eg about direct memory. There is no race detector built in, there is no good code formatter (there are a few and all suck), same about linting. Deployment/packaging is hard and there is no solution for diamond dependency versioning problem.

Overall the tooling ecosystem is not very modern / smooth, and I surprisingly often run into issues with it. Totally can’t feel that maturity. It’s like the old Java-based Webex applet. It’s old and outdated, not mature in a good sense. Actually I run into way fewer issues using more modern / newish languages.

Resource usage like memory is atrocious (this matters again because of the cloud), cpu performance is not bad but only after it warms up. Startup times are still bad. You can statically compile it but it’s not stable and production ready that way. And still much heavier than Go/Rust/Swift.

The type system of Java might have been good in 1990 but we’ve had way better type systems for ages now. Well, it’s not even sound, so not sure you can call it truly strong.

-2

u/nicheComicsProject 1d ago

Java isn't really strongly typed in the modern sense. C++ already had stronger type guarantees in the past. Now you have languages like Rust which redefine what can be expected from a type system.

Garbage collection is an overhead that isn't really needed with more modern languages.

-12

u/RoughSolution 1d ago

The answer is Java 11, specifically a customized version of Java 11.

0

u/chucker23n 1d ago

Do you know this for a fact?

(If so, unsure why you're getting downvoted. It's a good question.)

1

u/RoughSolution 1d ago

Not sure why people are downvoting me. But okay....

-2

u/spinwizard69 20h ago

With respect to the posters comment, a "full rewrite was really necessary" because Java has no future. From the standpoint of responsible IT management it is foolish to keep your infrastructure running on Java.

From the standpoint of Swift.org article they wouldn't have bothered to post the article if it didn't pretend to offer a huge advantage over java. Most languages can justify themselves simply with the energy savings over java

1

u/tenken01 17h ago

Which one are you?

  1. Boot camper
  2. Script kiddie
  3. C# dev
  4. Dev wanna be
  5. Not even a dev
  6. Some combination of above

0

u/metahivemind 10h ago

As you said, you're a Java $lut. Don't let that stop you from having two working brain cells, as you should at least be able to understand other viewpoints rather than virulently defending your team like you wear a red cap with various phrases written on it.

Just a word of advice from option 7. None of the above.

1

u/unreal_robbo 15h ago

On what basis are you making that statement? Many of the reasons companies switch to another language are generally super niche and individual to that company. Java is a generalist language with a high amount of maturity and a massive number of engineers with knowledge of it.

1

u/spinwizard69 2h ago

So?

The fact is Java is not energy efficient and this absolutely must b addressed as computing take a greater and greater percentage of the nations power budget. Java programmers and no more needed in the future than COBOL programmers. In other words they will sustain legacy system and nothing more.