156 points · by samcat116 · 6y ago · 97 comments
I think these guys were best known for Kitura, the (previously) IBM-backed web app framework.
I don't do web apps in Swift "for realz" (I use TypeScript and tools like Angular and Koa.js for that kind of thing), but I do use Swift on Linux and have built some toy ones using both Kitura and Vapor.
My impression is that Vapor gained a lot more traction than Kitura did, so in some ways this might just be "the market choosing" and Kitura heading for the sunset.
https://github.com/vapor/vapor/ https://swift.org/server/
Amazon has also created a Swift web framework: https://github.com/amzn/smoke-framework
What are other promising future "end-to-end" (i.e. Web / Server / Mobile) development platforms are there? IMO these are the main contenders:
- JS / node.js / React Native (Android/iOS) (+ other transpile 2 JS langs, e.g. TypeScript, Clojure, Scala, OCaml, etc)
- Kotlin to JavaScript / JVM / Android / Kotlin Native (iOS)
- C# Blazor / ASP .NET Core / Xamarin (Android/iOS)
- Dart JS / Dart VM / Flutter (Android/iOS)
Rust/Go/C++ could get some mentions, but I don't think they have enough community or commercial backing to become a popular mainstream option.The frontend frameworks in Rust are surprisingly good, and I wouldn't be too surprised if this becomes a mainstream option at some point.
That said, I generally find there isn't all that much advantage to sharing a frontend and backend language.
[0] https://twitter.com/jordwalke/status/1177373197517221888?s=2... [1] https://github.com/revery-ui/revery
E.g.: https://github.com/Daddoon/BlazorMobile and some initial discussion https://github.com/aspnet/AspNetCore/issues/11471
The other day, I noticed a slow-running python data transformation job, mostly string comparisons. It was on pace to take 18h to finish. Within half an hour, I had a Crystal version, ported line-by-line, that took 3 minutes(!) to finish.
I mean, if you asked me today to spit out a backend + web frontend + native app, I'd actually have no qualms about committing to Rust as an option. It's nowhere near perfect, but not as far off as people think either.
I think Kenny Kerr's Rust/WinRT project is going to be great on Windows (and Kerr already proved he can accomplish this kind of project with C++/WinRT), but Rust's language model is so fundamentally different from iOS and Android's that I can't imagine it being feasible any time soon.
Scala.js / Scala JVM / RoboVM
PWA is easy enough with Scala/Scala.js but I assumed that Android + iOS was a sufficiently painful process to warrant avoiding the attempt. Thought about mixing in Cordova or perhaps Ionic via the excellent ScalablyTyped typings library, but the path of least resistance is to just use TS on the frontend.
Coworker's article:
https://dzone.com/articles/why-i-dont-regret-moving-our-andr...
The parent post counted "Kotlin Native" as iOS. If you're willing to do that, you might consider "Scala Native" for iOS.
I don’t think server side swift has any chance against the other contender, it just has nothing special to offer and it’s often not even on par with competing technologies (go simplicity and concurrency, java ecosystem, python dynamic nature, rust safety, etc.). It doesn’t even have async...
I would be surprised if anyone but iOS devs use it.
Ps: and don’t get me wrong,i absolutely love its syntax and type system. But it’s not immediately obvious to someone already familiar with another PL.
If I was asked to do a full stack project with reason today I would write node bindings and use them.
The Objective-C interoperability doesn't fully support generics, so writing iOS apps entirely in Kotlin is inconvenient, but some companies are apparently (it was said at KotlinConf) already using it to share business logic on iOS.
Swift itself still needs time to mature, too. Things like the memory model, async/await, generics, etc. The future is bright, it will just require some patience to get there.
I don't think many people are going to start learning Swift just to build servers with it unless the platform/runtime provides something special. Otherwise it'll stay isolated just to the current iOS devs.
Or is this just not working on Web Framework ?
Just look at the kinds of discussions that e.g. Ian Partridge has contributed to: https://forums.swift.org/u/ianpartridge/summary
It includes substantial work on Docker images, logging, crash debugging, etc.
Maybe google will become a bit more invested in the Swift on Linux side of things, but so far I haven't really seen them invest in the ecosystem (besides pushing differentiable programming, which is cool, but it's mostly satisfying a niche requirement).
* Disclaimer: I’m the packager for swift on those platforms.
Perfect doesn’t look like it’s under active development, and if this means Kitura stops being maintained, it’s down to just Vapor as an active project.
I do find Golang has fill microservice space where Kitura couldn’t gain traction.
On the server, the lack of JIT warmup & a smaller overall heap size could be differentiators for Swift, depending on the context.
It took a long time for the machine learning eco-system around Python to develop. I believe that’s the case with Swift as well.
- FluxML[1] for machine learning
- Zygote[2] for differentiable programming
- Turing[3] for probabilistic programming
- Rich support for GPU[4]
https://github.com/tensorflow/swift/blob/master/docs/WhySwif...
Guessing the opposite rarely happens.
As a random example, take the content of this article: https://www.rightpoint.com/rplabs/switch-method-dispatch-tab...
This is something that my less grumpy iOS developer colleagues regularly stumble over, and yet they keep telling me that Swift is super simple.
Also, Apple's tooling for Swift has gotten less crashy, but not more reliable in my experience. Almost every time I command-click a Swift function in Xcode to find its definition/source, Xcode shows me a random C function with the same name in some completely unrelated header file.
I predict/hope that Combine will be peak Swift, and that it will only accelerate the move to Electron and other portable technologies (go Flutter!).
Whereas a language like Haskell is happy to try some absurdly abstract concepts in the interest of promoting computer science.
Swift's complexity feels much less compositional. There are still a lot of situations where I won't really know how certain features interact (especially when it comes to generics, associated types, etc.). Also, the documentation on some edge-cases is basically non-existant.
Swift and Rust are definitely similar in complexity, but Rust actually merits most of its complexity imo. It gives strong guarantees and a strong foundation for the future; I don’t believe that Swift has that. Swift adds a lot of features for the sake of having them, and I think that will catch up with the language quickly (see C++.)
https://news.ycombinator.com/item?id=17278175
I will say that I think the language made compromises in all three of these directions, though.
Been hearing that for a decade now, but somehow I'm not out of work.