IBM may have counter-balanced this.
What do other think is the reason for the slow backend adoption of Swift?
IBM may have counter-balanced this.
What do other think is the reason for the slow backend adoption of Swift?
I don't see how IBM will push for Swift in the future. They already pulled out (?) of the swift server working group, and didn't have the kind of pull to begin with.
IMO the most important reasons for the slow adaptation is lacking cross platform functionality (currently no upstream windows support + poor linux tooling) and questionable API design. Both make it difficult for new developers to give swift a try. Luckily, windows supportis supposed to come with the next version in a few months.
The API design is probably very subjective, but comparing the example in the blog post I don't understand how anyone could prefer:
import Foundation CFAbsoluteTimeGetCurrent()
over:
import time time.time()
The python way is much more intuitive IMO.
C# was successful because at the time it appeared people wanted an alternative to Java.
Now I do business web apps, but previously I did games. Which we published on all app stores + web. I'm also doing web sites. I did cross platform mobile apps with Xamarin. I can do even frontend web thanks to Blazor. I can use C# for embedded work - but that's not my thing. And you can use C# for machine learning, too.
With Swift I would be restricted. Which may be fine for some people who like to work only on certain kind of apps, but not for me.
Only Rust tempts me to learn and use as a new language.
I don't expect it to takeover the world, I just want it to have enough success to keep me earning money and be kept up to date. Which kind of happens. :)
For web related work some other languages with their frameworks might yield better productivity: C#, PHP, Python, Java, Ruby.
In latest web framework benchmarks by Techempower, Java, C#, Kotlin beat it by a large margin.
It doesn't do very good against Java even in The Computer Language Benchmarks Game, where each wins in 5 tests.
It's not different enough. All the demos I've seen of it, felt like it was mostly an "also ran" language that modernised it to be a significant improvement over Obj-C.
But I've never seen any argument for it being a huge enough improvement over C#, Kotlin or others to be worth it to switch ecosystems.
More radical languages all tend to look a bit "read only" to me but I am aware that might just be unfamiliarity on my part.
C# and Kotlin both have nice features but they are more conservative Java-likes than Swift. Swift had enough modern features and syntax to feel like it would be reward the effort learning.
But I don't own an iOS device so I'm still waiting for a use case!
So while Swift is a welcomed improvement over Objective-C, hardly brings anything worthwile to dump either the Java or .NET ecosystems.
The only ones that are similar are iOS and TVOS, but there's a few differences in the way that you structure apps.
What does it have that Kotlin doesn't?
(As a Scala programmer, Swift and Kotlin look pretty much the same to me; as far as I can see they're both polished but conservative languages that don't fundamentally offer anything that wasn't in OCaml)
I don't think Kotlin has any form of the "ugly C" API Swift has.
Swift is a bit more secure in terms of "it compiles, it works" than Kotlin, but Kotlin is definitely a huge improvement over Java.
Disagree. Reified generics let you write functions that do different things based on the runtime type of an object, but such functions are confusing to a reader and best avoided.
> Swift has associated values with enums
Java/Kotlin style enums are my favourite from any language, since they're first-class objects; you can give them a value in a field if that's what you want, but you can also have them implement an interface etc.
> ARC is simpler to predict but can induce a performance penalty.
In the general case ARC has the same pause problems as traditional GC, since you can't tell when one reference is the last living reference to an arbitrarily large object graph.
> Swift is a bit more secure in terms of "it compiles, it works" than Kotlin
How so? If anything I'd have expected the opposite.
It's quite powerful, once you get your head around it.
I write about that here: https://littlegreenviper.com/miscellany/swiftwater/enums-wit...
And here: https://littlegreenviper.com/miscellany/swiftwater/writing-a...
But they don't make sense as enums. If you have to look "under the hood" to get a reasonable model of a feature, it's a bad design.
> It's quite powerful, once you get your head around it.
> I write about that here: https://littlegreenviper.com/miscellany/swiftwater/enums-wit....
Like I said, you can write the same kind of thing very easily in Kotlin by using a sealed class - your example would translate line-for-line. It's a useful feature. But it's very confusing to call it a kind of enum rather than as a kind of class; as your other post acknowledges, it means Swift essentially has two different things that are differently implemented but both called "enum".
In contrast, Swift has done an excellent job of making a real clean break from its Obj-C predecessor, despite sporting full Obj-C interop. It has for most practical purposes none of Obj-C’s quirks for pure Swift code, which is great.
I frequently find myself wishing that Kotlin shared Swift’s level of independence from its predecessor, or that I could just use Swift instead. While Kotlin isn’t a bad language, its ties to Java leave me less than enamored.
What necessary modern features do you feel Swift has and C# doesn't?
These guys are great: https://www.objc.io
I'm pretty sure their site is a Vapor server.