Live data from Hacker News

Ask HN: What is the future of Swift on the server-side?

news.ycombinator.com

1–10 of 60 posts

Ask HN: What is the future of Swift on the server-side?

#1
I am in a dilemma on which language to choose on the backend for my project. I am looking for a performant, statically-typed, systems programming language. I know C++. But C++ has become somewhat an over-engineered language that is mostly in a to-be-not-to-be state of feature development. So I looked at Rust and it already seems going in the direction of C++. So I looked at Swift, and I like what I see, but I am not sure if the language has any serious users on the server-side. IBM was one who was part of the group working on server-side features of Swift, but left the group sometime back.

So I was wondering if anyone here is using Swift and or Vapor for backend development?

What are the other alternatives, Nim?

Re: Ask HN: What is the future of Swift on the server-side?

#2
> backend for my project

> a performant, statically-typed, systems programming language.

What is your project about? What are the latency requirements? How many concurrent users you expect to have? If these numbers are not high, why are you not using a general purpose language like go or Kotlin?

I used vapor for a evaluation project a while ago and abandoned it quickly. While Swift is a nice language, it is still a 2nd class citizen on non-Mac systems.

You can do a small PoC project and see if you like it.

Re: Ask HN: What is the future of Swift on the server-side?

#3
I have also been keeping an eye on it for the past couple of years, but without significant outside commitment, I'm hesitant to do anything serious with it.

Swift is a really nice language, much easier to skill up than Rust and MUCH better ergonomics, but again, IBM pulled out and the working group moves at a glacial pace...

I'd be curious to hear as well if there are any corps quietly relying on it.

Re: Ask HN: What is the future of Swift on the server-side?

#4
I'm pretty sure that the objc.io[0] people are using it for their site. Much of their SwiftTalk series[1] covers work on their backend. They are fairly serious players.

For myself, I won't use it on the server, but that's because I write servers for relatively low-cost, limited-skill, demographics. I use PHP.

[0] https://www.objc.io

[1] https://talk.objc.io

Re: Ask HN: What is the future of Swift on the server-side?

#6
Seems like you know the answer. It probably depends on what your goals are…

If you intend to make money and or invite a team into the project over time then maybe look for something lots of people use (.Net Core, C++, TypeScript, Java, etc.)

If you want this project to be a labor of love that is mostly powered by you then pick whatever esoteric thing you want that fits the bill (again sounds like you know the options, Rust, Crystal, Nim, Server Side Swift, etc.)

Re: Ask HN: What is the future of Swift on the server-side?

#7
I have a production app live using Swift/Vapor. I created this app solely for the purpose of learning full-stack development using Swift, and so far it has been an amazing ride. The best thing about using Swift on the server if you're already an iOS developer is that a ton of models and DTOs are simply shared across your backend and your app(s).

I have deployed my backend on a tiny DO droplet using Docker, and it just works. There was a slight bit of learning curve for deploying it, but I can now create images locally on my Mac and pull them remotely for a fresh deployment/migration in less than a minute. Being able to build locally using Docker for Mac also means that the speed is great.

Before that, I had the app live on a Heroku setup but it cost quite a bit.

My app is at https://apps.apple.com/nl/app/instint/id1454800508

Re: Ask HN: What is the future of Swift on the server-side?

#8
Given your criteria, Go might be a good choice maybe. It has a bigger or shall we say a more "successful" backend story.

Regarding Swift I am not sure how popular it is for the backend, you might not have a lot of libs for example for doing common things. Also no idea well a Swift backend performs under load. Swift is a nice language for sure, maybe if you can risk it, go for it but keep also this in mind - https://boringtechnology.club/

Post reply on HN