Hacker News new | ask | show | jobs
by waleedka 2976 days ago
Does Swift have a large community beyond iOS apps? Last I used it was years ago, right after it was introduced by Apple. I'm curious if it has found growth in other areas.
3 comments

Not really atm. There is a small community around server-side-swift which did some impressive work so far, most interesting project is IMO the Vapor Framework [1], but at least outside the Apple Dev community they didn’t get much attention so far. For general system programming, which would be also possible with swift, Rust seems currently a lot more popular.

[1]: https://vapor.codes

For people not familiar, Vapor is close to releasing version 3.0, using https://github.com/apple/swift-nio. I've heard rumors that the performance is really good, but I haven't ran anything personally.
Swift itself in incredibly fast, at least in microbenchmarks. I last looked at the numbers a year or so ago, but IIRC it was about as fast as C, which is several (as in 5-6) orders of magnitude faster than, say, python.

In terms of "level of abstraction" vs "Speed", Swift is definitely at a Pareto-Optimum (if that's the term for "can't get better in one dimension without losing something in the other).

Microbenchmarks aren't the be-all yada yada yada... And it's somewhat ironic that the server framework is named Vapor. But for web apps that are computation-heavy, I think it would be a valuable option to have.

Yeah, here are some old Vapor benchmarks for curious people: https://medium.com/@codevapor/server-side-swift-vs-the-other...

I drop in on the Vapor Slack group occasionally. I heard someone mention that version 3.0 was passing Go in benchmarks. Apparently they had some performance regressions integrating nio (it was just released last month) - not sure what the status is now.

I've seen a few server-side Swift frameworks (for building web apps or API apps) such as Perfect[1] and Kitura[2] (which is backed by IBM). It's not clear to me how much uptake they have so far.

[1] https://perfect.org/

[2] https://www.kitura.io/

I was starting to use Kitura but it seems the community is more in favor of Vapor right now. I moved on to Vapor as a result. IBM seems like it might abandon the project like they did their Swift Packages website.
Vapor is the likely winner in terms of Swift frameworks, but this does not say much.

The API's not stable, the framework is in very active development.

I imagine things will settle down in a year or two - until then, there are so many great alternatives (other languages), that I don't see Swift gaining much ground.

For awhile it seemed IBM was about to pick Swift as they did before with Java, but then they lost steam.
Ah, was there some news about it or it just that IBM seems less active on Swift http/ssl stuff lately?
They seem to be less active.
I wouldn't want to use it for anything that would evolve beyond 100k lines of swift code until the language improves it's build and IDE performance.

And if your making a backend, why not use kotlin which is fairly similar, but you get the entire java ecosystem?