Hacker News new | ask | show | jobs
by pier25 3390 days ago
Swift is fast and the language is nice and all, but this feels more like propaganda. Let's not forget IBM and Apple have become friends recently.[1]

I really don't see Swift becoming a popular full stack solution outside of environments invested in iOS and macOS.

Swift can indeed run on a multitude of systems but that doesn't mean it's a good option. For example it's not even close to being ready for Android. It can run, but that's it. Other than that you are on your own. No UI libs, nothing.

This leaves you with iOS if you need to run on mobile which is extremely restricted. Want to freely distribute an app among your colleagues on the lab? Fuck you. You have to do all sorts of acrobatics with testing devices, provisioning certificates, etc.

In Android you just compile an .apk and send the link to your colleagues to install it, like in any other platform on Earth except iOS. Even macOS.

[1] http://www.apple.com/ipad/business/work-with-apple/ibm/

5 comments

> Swift is fast

Not really. Apple's propaganda is fast, Swift can sometimes be almost kinda fast if the stars align just right, but in general it is quite slow. For example, last I checked, Kitura's HTTP parser is written in C. And has to be.

Another one: the various JSON "parsers" that wrap the built-in NSJSONSerialization API add about an order of magnitude overhead. That is after all the actual parsing and conversion to a property list, which isn't exactly the most efficient representation in the first place.

The Big Nerd Ranch guys realized that the only way to get a "high performance" JSON parser is to do it 100% in Swift. They did that and the result is significantly faster than the wrappers. And only 4x slower than NSJSONSerialization, which again isn't exactly a very efficient parsing model (think XML DOM parser).

https://github.com/bignerdranch/Freddy/wiki/JSONParser

I do a more in-depth analysis in my book, "iOS and macOS Performance Tuning"

https://www.amazon.com/gp/product/0321842847/ref=as_li_tl?ie...

EDIT: I forgot the link to Freddy

I do not say this to defend Apple, as this is itself a form of "fuck you" "acrobatics" forced on you by Apple, but if you download Cydia Impactor (a program I develop that has a horrible UI which is about to get at least somewhat better in the next couple days), you can drag the IPA file to the device and it will have you log in with your Apple account (even if you are not a registered developer) and can then automate the entire 7-day free provisioning and installation process, helping this use case.

Also, while I am leaving a comment: the server space is different from Android in that 1) you don't need a UI and 2) there apparently is a sponsor working on the open source project (and it is my understanding that IBM is actually putting in more time than Apple) to make it useful there: Ruby is a language that is going to be a problem for you building either Android or iOS apps, and yet that is certainly not a reason to claim it would be a bad choice of language for coding a website backend.

>Swift is fast and the language is nice and all, but this feels more like propaganda. Let's not forget IBM and Apple have become friends recently.

Let's not forget it. How does that make presenting their product propaganda any more so than any other product presentation? Heck, they even use it themselves for their backend.

>I really don't see Swift becoming a popular full stack solution outside of environments invested in iOS and macOS.

Doesn't Apple becoming friends with IBM ensure that it will be used at least by many IBM customers? Which is quite a large potential base (and not all are happy for how Oracle moves with Java).

I also don't see why a top notch, statically compiled, very fast language, with automatic memory management, and support from a huge vendor AND a huge community AND open source, wont catch up.

>Swift can indeed run on a multitude of systems but that doesn't mean it's a good option. For example it's not even close to being ready for Android. It can run, but that's it.

That's because the work for porting properly there hasn't been done yet. But it's more or less the same with Google's own Go, which is much older than Swift, Rust, D, etc.

> Go, which is much older than Swift, Rust, D, etc.

Go is definitely newer than D, which came out in December 2001, though D2, which is significantly different, came out in June 2007, while Go came out in November 2009. And, in the grand scheme of things, Go isn't too much older than Rust, which came out in January 2012.

Additionally, from the point of view of "no UI libs," basically every natively compiled language is at a significant disadvantage on Android, even the originally intended native language, C++ (1983).

> How does that make presenting their product propaganda any more so than any other product presentation? Heck, they even use it themselves for their backend.

There is that aspect, sure.

But what I wanted to point out is the irony of IBM promoting Swift since there isn't really any obvious advantage of using it full stack unless you are using iOS. Which happens to be the product of their new friend.

That is all.

IBM has already ported Java over to the z Systems platform. So why is them also supporting Swift a bad thing here?
I'm not saying that's a bad thing.

What I'm saying is that moving to swift full stack is only beneficial if you are using iOS or macOS on your clients.

While it's not as easy as android it's not exactly complicated to distribute an app internally

https://developer.apple.com/library/content/documentation/ID...

Most of this is talking about getting up and running the first time too so it has length but it's not complicated.

> You have to do all sorts of acrobatics with testing devices...

A problem completely unheard of in Android land.

Ok, so maybe you can find a few situations in which Android might be a better solution that iOS. Congratulations. Android for the win. But there are many, many craptons of successful iOS apps out there that might like to be able to use services running on e.g. Linux. The existence of useful roles for Android devices won't make those go away.

As long as you are ok with going through the App Store and only using iOS then yeah, good for you.

This is what I meant earlier with:

> I really don't see Swift becoming a popular full stack solution outside of environments invested in iOS and macOS.

But in many enterprise, industrial, education, and scientific applications, iOS is a complete fail. Not because of iOS in itself, but because of the many restrictions Apple imposes on the development workflow and the limited hardware.

Or if you need cough mobile crossplatform cough...