Ultimately, I think Swift is a hugely underrated language, mainly because of outdated criticism.
There is no issue in being Apple's C#, this is the only way for bringing safety computing forward, having the platform owner making it happen no matter what.
On the other hand a bunch of useful libs (based on said standard lib) for server-side Swift is realistic.
As for knowing the language, you’d gain the two weeks it takes to learn go, but you’ll loose all the ecosystem of quality libraries.
I'm curious as to what these innovations are. I've not looked too deeply into Swift - I've played around with SwiftUI a bit and nothing else - but from what I saw I didn't see any fundamentally novel ways to do things. People talk about protocols/actors etc, but I've seen other languages that do those and (IMO) better. If anything, I thought the emphasis on creating new forms of syntax for things that should've been built as more fundamental, orthogonal concepts (eg. `guard let` etc.) would've made it more distasteful to the PL theory crowd, who love orthogonality IME.
(I'm sorry if I'm coming off as sarcastic/combative, I'm genuinely curious about this!)
Many programming languages list Swift as inspiration: https://www.val-lang.dev/
Rust's optional bindings are inspired by swift: https://doc.rust-lang.org/reference/influences.html (Many people who worked on Rust also worked on Swift, like the creator of rust)
The SwiftUI framework you mentioned uses inspiring syntax, which has been tried do be emulated (Jetpack Compose, Druid). However, nobody got it as magical as Swift did. The way SwiftUI Syntax combines pl theory and developer usability is amazing.
The point on ABI compat is interesting - I guess that's the sort of thing that makes Swift truly an "end to end" language. Though at the same time, the focus on dynamic linking is a source of one common complaint with swift, IIRC - people often complain that the language features they use are tied to OS versions.
> which has been tried do be emulated (Jetpack Compose, Druid). However, nobody got it as magical as Swift did.
That's interesting, too. I'm not a UI programmer by any means, and from what little I tried of SwiftUI and JP Compose (though I have written more server-side Kotlin and found it perfectly pleasant) I didn't see a significant difference. Do you have any further reading I can look into this further?
I was with you till this line. SwiftUI was so half baked for several versions that it took them 3 years to get a respectable navigation API. SwiftUI is great but it still has rough edges.
Dynamic linking in AOT compiled languages exists for decades, other priorities in other ecosystems.
Groovy DSL for Swing was one of the first languages with such approach.
However all in all, it is a great language for the Apple ecosystem.
There are a lot more aspects to dynamic linking than a binary possible / not possible.
But I feel neither did Swift get SwiftUI right, it is hacked on top of the language and would not be reimplementable strictly as a library.
Is that the case? The language started out interesting, but it took a turn for the worse and has become a kitchen-sink with every single feature from any language being found in it, but their interactions are simply not designed well. But what innovation did it have? I can’t think of any one feature that would be novel, as in no other mainstream language would have experimented with it.
That said, I think it really was a great language, and there is a sane subset that is still great, don’t want to start a flame war :D
Considering they hired one of the major akka core developers[0] to work exactly on the Actor model for Swift, I would say they have all the knowledge to nail it.
is this not good enough?
I never again want to see: “Expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions.”
https://stackoverflow.com/questions/33794574/swift-expressio...
For a dumb example see: https://forums.swift.org/t/why-is-swift-so-slow-timeout-in-c...
That said I do enjoy the language.
If would be awesome if the cross compilation support is as good as it is in Go such that you could build your lambda executable with `GOOS=linux GOARCH=amd64 go build -o main main.go`.
Swift:
- Servers
- OS
- Apps with a wonderful SwiftUI framework
- C++ Interop
- Ownership model
- Crossplatform
A recent post of the forum wanted to build a crossplatform working group, but as you can see in OP, it wasn’t met with a lot of enthusiasm by the core team.
Obviously, as long as apple is the only major corp behind swift, it isn’t going anywhere outside apple platforms.
The day rust reaches some kind of ergonomics acceptable to non-system programmers you can be sure swift will only be used for UIKit / Swift interfacing and that’s it.
One illustrative facts is that Rust in practice cares about each individual allocation. Meanwhile Swift has the wonderful value-semantics collection implemented by way of copy-on-write (cow) atomically reference-counted pointers.
Swift is crossplatform, whether you like it or not
Swift's ecosystem is on Apple's platforms, and it is ok, plenty of jobs there.
I hope the hope they do on that feature inspires Rust to follow suit. This is a game-changer in terms of expressiveness.
For instance, if you're writing an ECS manager, you could write something like:
struct SystemManager<...Systems: System> { ... }
// in user code
let my_system: SystemManager<Collisions, 3dModels, PlayerInput, Networking, EnemyAi> = ...
Also, it would make it a lot easier to write some macros; with variadic generics, derive macros could just generate a call to a variadic implementation (thus producing fewer tokens, thus better compile times), and have that implementation handle the bulk of the logic. Unlike a macro body, this macro would be type-checked at the writing site, leading to fewer post-monomorphization errors.1. https://pinboard.in/t:swift/t:linux/
2. https://www.kodeco.com/8325890-a-complete-guide-to-swift-dev... (formerly raywenderlich.com)