Swift at Apple: Migrating the Password Monitoring Service from Java
229 comments
·June 3, 2025paxys
mpweiher
With the 90% reduction in memory consumption, I'd wager that most if not all the performance improvement came from that. In fact, it is a little surprising that hardware utilization only dropped 50%.
Reduced memory consumption for cloud applications was apparently also the primary reason IBM was interested in Swift for a while. Most cloud applications apparently sit mostly idle most of the time, so the number of clients you can multiplex on single physical host is limited by memory consumption, not CPU throughput.
And Java, with the JIT and the GC, has horrible memory consumption.
eosterlund
The thing about DRAM is that it isn't SRAM; cost matters. You struggle to find deployment environments that have less than 1 GB DRAM available per core, because at that point, ~95% the HW cost is typically CPU anyway. Shrinking that further is kind of pointless, so people don't do it. Hence, when utilizing 16 cores, you get at least 16 GB DRAM that comes with it, whether you choose to use it or not. If you use only 10% of that memory by removing the garbage from the heap, then while lower seems better and all that, it's not necessarily any cheaper in actual memory spending, if both fit within the same minimum 1 GB/core shape you can buy anyway. It might just under utilize the memory resources you paid for in a minimum memory per CPU shape, which isn't necessarily a win. Utilizing the memory you bought isn't wasting it.
Each extra GB per core you add to your shape, actually costs something. Hence every GB/core that can be saved results in actual cost savings. But even then, usually every extra GB/core is ~5% of the CPU cost. Hence, even when going from 10 GB/core (sort of a lot) to 1 GB/core, that only translates to ballpark ~50% less HW cost. Since they did not mention how many cores these instances have, it's hard to know what GB/core were used before and after, and hence whether there were any real cost savings in memory at all, and if so what the relative memory cost savings might have been compared to CPU cost.
conradev
This is why serverless is taking off on the opposite end of the spectrum (and why it’s so cheap)
You can share memory not only at the machine level, but between different applications.
dgs_sgd
Interesting. If IBM was trying to solve for memory consumption, why do you think they picked Swift over alternatives that might also have achieved lower memory consumption?
dagmx
Swift is at a good middle ground of performance, safety and ease of use.
It has higher level ergonomics that something like rust lacks (as much as I like rust myself), doesn’t have many of the pitfalls of Go (error handling is much better for example) and is relatively easy to pickup. It’s also in the same ballpark performance as rust or C++.
It’s not perfect by any means, it has several issues but it’s quickly becoming my preferred language as well for knocking out projects.
tgma
Which other sufficiently popular modern language that's more efficient than Java lacks a tracing GC?
Rust and Swift are pretty much the only two choices and Rust is arguably much more pain in the ass for the average joe enterprise coder.
tgma
IBM is a huge and quite balkanized company and I don't think there was ever a centralized push towards Swift outside some excited parties. With that, I would note that circa 2018 there was a DRAM shortage in the industry and people started thinking more about memory conservation in datacenter workloads.
tiffanyh
I'd typically agree with your comment but ...
Given that they also experienced a 90% reduction in Memory Usage (presumably from Java GC vs Swift AOT memory management) - it seems more likely the gains are in fact from the difference in languages.
javanonymous
The JVM tends to use as much memory as it can for performance reasons. It is not a reliable indicator of how much memory it actually needs. Why spend resources on clearing memory if there's still unused memory left?
If memory is an issue, you can set a limit and the JVM will probably still work fine
tgma
Your comment is definitely true. However, if you study GC performance academic papers over the past three for four decades, they pretty much conclude GC overhead, amortized, can be on par with manual alloc/free[1], but usually the unwritten assumption is they have unbounded memory for that to be true. If you study how much memory in practice you need not to suffer a performance loss on an amortized basis, you'd arrive at 2-3x, so I'd claim it is fair to assume Java needs 2-3x as much memory as Swift/C++/Rust to run comfortably.
You can actually witness this to some degree on Android vs iPhone. iPhone comfortably runs with 4GB RAM and Android would be slow as dog.
[1]: I don't dispute the results, but I also like to note that as a researcher in Computer Science in that domain, you were probably looking to prove how great GC is, not the opposite.
cellularmitosis
If it were such an easy problem to fix, don’t you think they would have done so rather than rewriting in Swift?
plorkyeran
The typical rule of thumb is that getting good performance out of tracing GC requires doubling your memory usage, so a 90% reduction suggests that they made significant improvements on top of the language switch.
mrighele
The 90% reduction doesn't necessarily have to be related only to GC.
In my experience Java is a memory hog even compared to other garbage collected languages (that's my main gripe about the language).
I think a good part of the reason is that if you exclude primitive types, almost everything in Java is an heap-allocated object and Java objects are fairly "fat": every single instance has an header of between 96 and 128 bit on 64-bit architectures [1]. That's... a lot. Just by making the headers smaller (the topic of the above link) you can get 20% decrease in heap usage and improvements in cpu and GC time [2].
My hope is that once value classes arrive [3][4], and libraries start to use them, we will see a substantial decrease in heap usage in an average java app.
[1] https://openjdk.org/jeps/450
[2] https://openjdk.org/jeps/519
geodel
That is just GC part. Another big difference is Reference type (Java) vs Value Type (Swift).
username223
I remember the 2x rule from 20 years ago - do you know if things have changed? If locality is more important now, tracing GC might never be as performant as reference counting. Either you use 2x the memory and thrash your cache, or you use less and spend too much CPU time collecting.
loxs
The java runtime is a beast. Even the fact that another runtime is just capable to do a similar thing is impressive, disregard the fact that it might be better. Even being on par makes it interesting for me to maybe try it on my own.
favorited
The post notes that the user-facing app was "introduced in the fall of 2024," so presumably the services aren't that legacy.
remus
You can learn a lot when writing V2 of a thing though. You've got lots of real world experience about what worked and what didn't work with the previous design, so lots of opportunity for making data structures that suit the problem more closely and so forth.
isodev
But did they write the backend from scratch or was it based on a number of “com.apple.libs.backend-core…” that tend to bring in repeating logic and facilities they have in all their servers? Or was it a PoC they promoted to MVP and now they’re taking time to rewrite “properly” with support for whatever features are coming next?
Someone
My $0.02 is that Java not having value types (yet), while Swift has, is a large reason for the efficiency gains.
CharlieDigital
As a C# dev, I guess I've just taken it for granted that we have value types. Learned something new today (that Java apparently does not).
MBCook
It does for primitives.
For user defined stuff we’ve recently gained records, which are a step in that direction, and a full solution is coming.
pjmlp
However you can make use of Panama to work around that, even if it isn't the best experience in the world.
Create C like structs, in regards to memory layout segments, and access them via the Panama APIs.
dehrmann
I would have guessed it's boxed primitives.
throwaway2037
Is that still a thing in 2025? There are so many third party libraries that offer primitive collections. Example: https://github.com/carrotsearch/hppc
gt0
Agree, this is almost always where the benefits come from. You get to write v2 of the software with v1 to learn from.
tialaramex
Sure, maybe you can get money to have some businesses try out rewriting their line-of-business software in the same language versus in a different language and get some results.
My expectation is that if you put the work in you can get actual hard numbers, which will promptly be ignored by every future person asking the same "question" with the same implied answer.
If the "just rewrite it and it'll be better" people were as right as they often seem to believe they are, a big mystery is JWZ's "Cascade of Attention-Deficit Teenagers" phenomenon. In this scenario the same software is rewritten, over, and over, and over, yet it doesn't get faster and doesn't even fix many serious bugs.
tilne
For others that hadn’t head of CADT either: https://www.jwz.org/doc/cadt.html
I confess to having been part of the cascade at various parts of my career.
staplers
If the "just rewrite it and it'll be better" people were as right as they often seem to believe
Generally speaking, technological progress over thousands of years serves to validate this. Sure, in the short term we might see some slippage depending on talent/expertise, but with education and updated application of learnings, it's generally true.rs186
Yes! The post would have been much more informative if it did an in-depth analysis of where the performance gain comes from. But Apple being Apple, I don't think they'll ever want to expose details on their internal systems, and we probably can only get such hand wavy statements.
MBCook
I suspect that didn’t fit into the goal of the blog post.
I don’t think it’s meant to be a postmortem on figuring out what was going on and a solution, but more a mini white paper to point out Swift can be used on the server and has some nice benefits there.
So the exact problems with the Java implementation don’t matter past “it’s heavy and slow to start up, even though it does a good job”.
BonoboIO
Imagine what rust or go could have achieved
dontlaugh
Go is similar to Swift when it comes to mandatory costly abstractions.
It’s only Rust (or C++, but unsafe) that have mostly zero-cost abstractions.
airspeedswift
Swift, Rust, and C++ all share the same underlying techniques for implementing zero-cost abstrations (primarily, fully-specialized generics). The distinction in Swift's case is that generics can also be executed without specialization (which is what allows generic methods to be called over a stable ABI boundary).
Swift and Rust also allow their protocols to be erased and dispatched dynamically (dyn in Rust, any in Swift). But in both languages that's more of a "when you need it" thing, generics are the preferred tool.
frizlab
Swift have them too now (non-Copyable types).
rafram
> It’s only Rust (or C++, but unsafe) that have mostly zero-cost abstractions.
This just isn't true. It's good marketing hype for Rust, but any language with an optimizing compiler (JIT or AOT) has plenty of "zero-cost abstractions."
quux
I'm hoping to hear some good news at WWDC for swift development in editors other than Xcode (VSCode, Neovim, etc.) Last year they said "we need to meet backend developers where they are" and announced plans to improve sourcekit-lsp and other efforts.
st3fan
This project is getting more mature https://github.com/swiftlang/vscode-swift
And https://github.com/swiftlang/sourcekit-lsp an be used in any LSP compatible editor like Neovim.
candiddevmike
IMO, Apple has quite the track record of never "meeting X where they are". They could make Xcode cross platform, but they never will.
klausa
Xcode is probably like, one of the top… 3? 5? biggest macOS-native applications in the world.
Making it cross-platform would require either reimplementing it from scratch, or doing a Safari-on-Windows level of shenanigans of reimplementing AppKit on other platforms.
rafram
> Safari-on-Windows level of shenanigans of reimplementing AppKit on other platforms
I was curious about this, so I downloaded it to take a look. It doesn't look like they actually shipped AppKit, at least as a separate DLL, but they did ship DLLs for Foundation, Core Graphics, and a few other core macOS frameworks.
AdamN
Xcode on Windows/Linux would be wacky and not worth the effort - it's very tightly coupled to MacOS so effectively impossible imho. People targeting MacOS/iOS aren't typically running Windows on the desktop. The more critical thing to meeting developers where they are would be for the entire developer loop to be doable from a JetBrains IDE on MacOS.
st3fan
There would be no point in doing that. All the devs they care about already have Macs. If you are on Windows or Linux and you want to work on Swift server side code then you can use their official LSP or VSCode extension in your favorite editor.
tough
There's always XTool https://github.com/xtool-org/xtool
paxys
Who even wants Xcode to be cross platform? People can barely tolerate it on macs.
What you really mean is people want the iOS development toolchain to be cross platform, and that would mean porting iOS to run in a hypervisor on linux/windows (to get the simulator to work). That is way too big a lift to make sense.
atonse
Exactly.
I’ve never wanted Xcode in more places. When I used to be a native mobile dev, I wanted to not have to use Xcode.
And it’s technically possible. But totally not smooth as of a few years ago.
kridsdale1
I’ve been writing iOS apps primarily for 15 years. I haven’t had to use Xcode since about 2016 since Facebook and Google have fully capable VSCode based editors with distributed builds in the Linux clouds. It’s pretty great, but I don’t know of an open source version of this system. That is, integration with Bazel/Buck that can build iOS on non-Mac hardware.
DavidPiper
Swift SourceKit LSP + VSCode is actually pretty good these days. I recently got it working with CMake for a Swift / CMake project, and the only real pain in that was getting CMake set up properly. Everything else worked out of the box with VSCode's extension manager.
lawgimenez
My main wish for Apple this upcoming WWDC is to make Xcode not make my M2 super hot.
elpakal
Ive wanted this for years. FWIW I've used CLion's Swift plugin for my pure SPM projects and it's actually decent.
sureglymop
I hope so too! We even have an official Kotlin LSP now... maybe that serve as inspiration.
rescripting
Swift has an official LSP: https://github.com/swiftlang/sourcekit-lsp
It was first released 7 years ago.
sureglymop
Thanks for letting me know! I had no idea...
maximilianroos
> One of the challenges faced by our Java service was its inability to quickly provision and decommission instances due to the overhead of the JVM. ... To efficiently manage this, we aim to scale down when demand is low and scale up as demand peaks in different regions.
but this seems to be a totally asynchronous service with extremely liberal latency requirements:
> On a regular interval, Password Monitoring checks a user’s passwords against a continuously updated and curated list of passwords that are known to have been exposed in a leak.
why not just run the checks at the backend's discretion?
potatolicious
> "why not just run the checks at the backend's discretion?"
Because the other side may not be listening when the compute is done, and you don't want to cache the result of the computation because of privacy.
The sequence of events is:
1. Phone fires off a request to the backend. 2. Phone waits for response from backend.
The gap between 1 and 2 cannot be long because the phone is burning battery the entire time while it's waiting, so there are limits to how long you can reasonably expect the device to wait before it hangs up.
In a less privacy-sensitive architecture you could:
1. Phone fires off request to the backend. Gets a token for response lookup later. 2. Phone checks for a response later with the token.
But that requires the backend to hold onto the response, which for privacy-sensitive applications you don't want!
paxys
Especially since the request contains the user's (hashed) passwords. You definitely don't want to be holding that on the server for longer than necessary.
ivan_gammel
Is it really a problem? Client can pass an encryption key with the request and then collect encrypted result later. As long as computation is done and result is encrypted, server can forget the key, so cache is no longer a privacy concern.
potatolicious
You can, and in situations where the computation is unavoidably long that's what you'd do. But if you can do a bit of work to guarantee the computation is fast then it removes a potential failure mode from the system - a particularly nasty one at that.
If you forget to dump the key (or if the deletion is not clean) then you've got an absolute whopper of a privacy breach.
Also worth noting that you can't dump the key until the computation is complete, so you'd need to persist the key in some way which opens up another failure surface. Again, if it can't be avoided that's one thing, but if it can you'd rather not have the key persist at all.
maximilianroos
thanks!
lilyball
> why not just run the checks at the backend's discretion?
Presumably it's a combination of needing to do it while the computer is awake and online, and also the Passwords app probably refreshes the data on launch if it hasn't updated recently.
null
mtrovo
Without a deeper profiling analysis of the Java application it's hard to not consider this whole piece just advertorial content. Where exactly were the bottlenecks in Java or top delta gains compared to Swift. The service scope looks so simple that there might be some underlying problem with the previous version, be it the code not scaling well with the irregular batch nature of traffic or custom cryptography code not taking advantage of the latest native IO constructs.
And I'm not defending Java by any means, more often than not Java is like an 80s Volvo: incredibly reliable, but you'll spend more time figuring out its strange noises than actually driving it at full speed.
CharlesW
> Without a deeper profiling analysis of the Java application it's hard to not consider this whole piece just advertorial content.
I'd be surprised if anything Apple wrote would satisfy you. TFA makes it clear that they first optimized the Java version as much as it could be under Java's GC, that they evaluated several languages (not just Swift) once it became clear that a rewrite was necessary, that they "benchmarked performance throughout the process of development and deployment", and they shared before/after benchmarks.
cogman10
Ok, I'm pretty skeptical that they actually did optimize what they could. In fact, reading between the lines it sounds like they barely tried at all.
For example, they mention G1GC as being better than what was originally there but not good enough. Yet the problems they mention, prolonged GC pauses, indicates that G1GC was not the right collector for them. Instead, they should have been using ZGC.
The call out of G1GC as being "new" is also pretty odd as it was added to the JVM in Java 9, released in 2016. Meaning, they are talking about a 9 year old collector as if it were brand new. Did they JUST update to java 11?
And if they are complaining about startup time, then why no mention of AppCDS usage? Or more extreme, CRaC? What about doing an AOT compile with Graal?
The only mention they have is the garbage collector, which is simply just one aspect of the JVM.
And, not for nothing, the JVM has made pretty humongous strides in startup time and GC performance throughout the versions. Theres pretty large performance wins going from 11->17 and 17->21.
I'm sorry, but this really reads as Apple marketing looking for a reason to tout swift as being super great.
CharlesW
As someone who hasn't used Java professionally, this was helpful informed skepticism. Thanks!
> Did they JUST update to java 11?
As an LTS release with "extended" support until 2032, that certainly seems possible.
Another near-certain factor in this decision was that Apple has an extreme, trauma-born abhorrence of critical external dependencies. With "premier" support for 11 LTS having ended last fall, it makes me wonder if a primary lever for this choice was the question of whether it was better to (1) spend time evaluating whether one of Oracle's subsequent Java LTS releases would solve their performance issues, or instead (2) use that time to dogfood server-side Swift (a homegrown, "more open" language that they understand better than anyone in the world) by applying it to a real-world problem at Apple scale, with the goal of eventually replacing all of their Java-based back-ends.
wiseowise
> TFA makes it clear that they first optimized the Java version as much as it could be under Java's GC
No, it doesn’t.
mring33621
I understand there may be some bias in this article, but the resource usage improvements are hard to ignore for a company that pays for cloud compute/memory usage.
I'm gonna look into server-side Swift.
Looks like it'll take some fiddling to find the right non-xcode tools approach for developing on linux.
I prefer Jetbrains tools over VSCode, if anyone has any hints in that direction.
dhosek
I don’t know that there’s anything that magical about Swift in particular, but rather the difference of running without the big runtime of the JVM and the advantages of memory management. Go will probably give improvements (and likely be an easier mental adjustment from a JVM language), and Rust, once you mentally adapt to its model will give even bigger improvements. Swift has the advantage of being object-oriented (if that’s an advantage in your mind), but I was thinking 10 years ago that with the move to microservices that Java/Spring apps were going to not work so great with the quick start-up/shut-down that the cloud/microservice model wants.
manmal
Will Rust really be better than Swift in such a context? Doesn’t that more or less depend on what kind of memory management is being used in Rust?
dhosek
The memory management strategies in Rust and Swift are similar. The big performance hit in Swift would come in method dispatch where it’s following Objective C strategies which would result in indirect calls for object methods. This is possible in Rust (using Box(dyn trait)), but discouraged in critical paths in favor of either static dispatch by means of enums or reified calls through Rust generics. Swift has similar capabilities, of course, but with both languages, the best performance reqires consciously making choices in development.
pharaohgeek
Sadly, Jetbrains no longer sells AppCode or supports their Swift plugins for CLion. I WISH they would open source the plugins, as CLion is far superior to Xcode. For now, though, we're really stuck with either Xcode (Mac) or VSCode (wherever). That said, I am really starting to love server-side Swift using Vapor. Swift, as a language, is great to develop in.
eviks
If resource usage improvement is entirely due to bias, it should be easy to ignore?
StackRiff
I wonder what Apple is using for production monitoring, observability, and performance profiling with swift applications on Linux. In my experience this is one of the key missing pieces in Swift server ecosystem.
You can link against jemalloc, and use google perftools to get heap and CPU profiles, but it's challenging to make good use of them especially with swifts method mangling and aggressive inlining.
maz1b
I've always wondered a slight amount as to why larger enterprises (which have the resources to hire specialists) don't hire people with expertise in say things like Rust, or Elixir/Phoenix?
It's one thing to say that we want to hire commonly available developers like in Java or C#, but if you have a long term plan and execution strategy, why not pick technology that may pay off larger dividends?
ITT: I get why they chose Swift, it's Apple's own in house technology. Makes total sense, not knocking that at all. Nice writeup.
neepi
It’s because Java and c# are so commoditised we don’t have to pay people as much.
Also it’s about short term balance sheet not long term product management in the SME and small SaaS space. I don’t think anyone other then the developers give a shit.
manmal
They do have Elixir positions, eg https://jobs.apple.com/en-us/details/200562288/senior-softwa...
geodel
Many reasons:
There are not enough Rust experts in the world for a typical enterprise to hire and benefit from it.
Elixir/Phoenix are not order of magnitude improvements over Java like Rust, they are marginal improvements. Enterprise don't care for that.
dwaite
it sounds like you are asking why enterprises aren't choosing to write Rust code vs Java code. I wouldn't turn away a developer just because they had experience with Elixir.
It really comes down to whether there's someone making the case that a particular application/subsystem has specialized needs that would warrant hiring experts, and whether they can make the case successfully that the system should use technologies that would require additional training and impose additional project risk.
Until you are dealing not with enterprise applications but actual services, it can be difficult to even maintain development teams for maintenance - if your one ruby dev leaves, there may be nobody keeping the app running.
Even when you are producing services - if they are monolithic, you'll also be strongly encouraged to stick with a single technology stack.
maz1b
No, I was making a point about if the goal is lowering resource usage, more throughput, concurrency, speed/perf, etc, a larger company can achieve that "unfair advantage" of things like rust or elixir etc because they have the resources as compared to SMBs or startups.
Of course, every company and org has to see whats best and feasible for them. Valid points you brought up no doubt.
zapnuk
Very interesting. I wish they had gone into a little more detail about the other technologies involved.
Was the Java Service in Spring (boot)?
What other technologies were considerd?
I'd assume Go was among them. Was it just the fact that Go's type system is to simplistic or what were the other factors?
geodel
Swift is Apple's own language. They have all the experts from lowest to highest level .
Writing a long winded report/article for fair technical evaluation of competing technologies would utter waste of time and no one would believe if answer were still Swift.
> I'd assume Go was among them. ...
I don't see any reason to evaluate Go at all.
latchkey
> I don't see any reason to evaluate Go at all.
https://devblogs.microsoft.com/typescript/typescript-native-...
MBCook
But that ignores the fact Apple has a MASSIVE investment in Swift.
I think they already use Go in places, but they’ve clearly stated their intention to use Swift as much as possible where it’s reasonable.
I suspect they didn’t evaluate C++, Rust, Go, Erlang, Node, and 12 other things.
They have the experience from other Swift services to know it will perform well. Their people already know and use it.
If Swift (and the libraries used) weren’t good enough they’d get their people to improve it and then wait to switch off Java.
If you go to a Java shop and say you want to use C# for something Java can do, they’ll probably say to use Java.
I don’t read this post as “Swift is the best thing out there” but simply “hey Swift works great here too where you might not expect, it’s an option you might not have known about”.
pjmlp
I don't buy the reasoning.
First of all, it is a missed opportunity for Microsoft to have another vector for people to learn C#.
Secondly at BUILD session, Anders ended up explaning that they needed to rewrite the AST data structures anyway, given that Go type system is much inferior to Typescript.
And Go's story on WebAssembly is quite poor, when compared with Blazor toolchain, they are hopping Google will make the necessary improvements, required for the TypeScript playground and when running VSCode on the browser.
Finally, some of the key develpers involved on this effort have been layed off during the latest round.
dontlaugh
That still seems like a long term mistake to me, an evolutionary dead end.
geodel
Yeah, while they are at it they can also learn on how to write OS for ARM architecture from Microsoft.
anuragsoni
Apple maintains servicetalk[1] (java networking framework built on top of netty), so I'm guessing this is one potential JVM framework that was being used.
miffy900
I'm going to call it now: Swift on the backend is pointless for everyone but Apple, and trying to make it takeoff as a backend service language is as pointless as porting Xcode cross platform and trying to lure non-Apple devs into using it over say VSCode, any JetBrains IDE or Visual Studio.
The choices that already serve the market are just too numerous and the existing tooling is already far greater in features, functionality and capability than anything that Apple can provide. What's funny is that they actually have the money to dedicate resources to this space to compete with C#, Java, go or Rust, but they're not going to because it's just too far afield of their core business. Any backend service written in Swift is not going to be running on a Mac in the cloud, and probably won't be serving just iPhone/iPad clients exclusively, so why bother when we know Apple leadership will treat it as an afterthought.
If it does takeoff, I'm betting it will be because the open source community provides a solution, not Apple and even then it will be in a tiny niche. Indeed, this entire project is enabled by Vapor, an open source Swift project that I'm guessing the team only chose because Vapor as a project finally reached the requisite level of maturity for what they wanted. It's not like Apple went out on their own and built their own web framework in Swift, like Microsoft does with C# and ASP.NET. All of this makes me feel even more skeptical about Swift on the backend. Apple won't do anything specifically to give Swift a legup in the backend space, beyond the basics, like porting Swift to linux, but will avail themselves of open source stuff that other people built.
jeremymcanally
Apple certainly do have web frameworks they’ve written in Swift.
No, I don’t know why they aren’t publicly available (at least yet). But I do know they power a number of public facing services.
eviks
> they're not going to because it's just too far afield of their core business
Apple car was farther?
hu3
and it's dead
georgeecollins
I am really curious what people's take on Hacker News is of Swift. It feels like I heard about it more five years ago. People seem to like Go, Rust is cool (I learned that one), and Python, C#, Java seem here to stay.
I mean I am asking as general purpose language, not just back end.
wiseowise
There was really big excitement about Swift everywhere, but Apple decided not to capitalize on it and hype died off. Swift is pretty much Mac/iOS language and there are no indications that it is going to change anytime soon.
dwaite
Rust and Swift share a lot of core concepts.
Swift has a few extra bits for Objective-C compatibility (when running on Apple platforms), but otherwise the biggest differences come to design and ergonomics of the language itself.
If I need complete control over memory for say a web server, or am writing code to run on an embedded device (e.g. without Linux), I'll use Rust - even if Swift technically has the features to meet my needs.
Thats the reverse if I am creating mobile or desktop apps. I'd probably prefer using neither for web services like in this article, but would still probably pick Swift given a limited choice.
MBCook
I really like it. It feels clean to me and easy to read, but has great async and other modern features. A bit like a compiled TypeScript without all the baggage that comes from JS’s existence.
It has its issues in places, mostly the compiler, but I love getting to develop in it.
I suspect you hear less about it because it’s no longer new and the open source community doesn’t seem to care about it that much, unlike Rust.
It still seems to be viewed as “the iOS language” even though it can do more than that and is available on other platforms.
pjmlp
Fine language for anyone on Apple's ecosystem.
If one rather be OS agnostic, then not so much.
hu3
As for HN, I see comments about swift becoming complex and bloated with many ways to do the same thing. Like C++ish.
misiek08
I would love to see such post from Microsoft about C#. "We looked into few alternatives and chose our own language, it fitted the task, worked great and came as best overall in terms of technology, devex and maintainability".
Great read, thanks for sharing! This means to me you are mature, sharing stuff instead of making obscure secrets from basic stuff existing at many companies <3
fmorel
They've done quite a few user stories on https://devblogs.microsoft.com/dotnet/category/developer-sto... and related blogs, especially about .NET Framework to .NET migrations.
metaltyphoon
Not quite the same but close. I assume OP was mentioning from one stack into a completely different one.
artdigital
Hearing a company like Apple is using swift on the server side changed my view on server Swift
I’ll definitely take a look again, great to see it becoming mature enough to be another viable option
k_bx
The big questions are: how's package management, community, ease of forking, patching and other dependency management related stuff. Server-side development needs those questions to have good answers.
artdigital
Swift has all of that already answered. Non Xcode swift with SwiftPM is solid
cogman10
I'm honestly very skeptical that Apple actually did everything they could to make Java startup fast and the GC perform well under load.
G1GC is a fine collector, but if pause time is really important they should have used ZGC.
And if startup is a problem, recent versions of Java have introduced AppCDS which has gotten quite good throughout the releases.
And if that wasn't good enough, Graal has for a long time offered AOT compilation which gives you both fast startup and lower memory utilization.
None of these things are particularly hard to add into a build pipeline or deployment, they simply require Apple to use the latest version of Java.
> In comparison with the previous Java service, the updated backend delivers a 40% increase in performance, along with improved scalability, security, and availability.
As is always the case with such rewrites, the big question is whether the improvements came from the choice of language or because they updated a crusty legacy codebase and fixed bugs/bottlenecks.