Vapor is still very good for back-end work and I've heard a lot of success stories for lowering costs due to less cycles being used so a lower power consumption. But even with all that Apple seems to be pushing their own direction with SwiftUI, their support for other operating systems is minimal, support for editors other than Xcode, and having separate frameworks like Metal aren't helping either.
In short I want to use swift for everything, as a Rust or C++ replacement, and I don't think I'm alone in this, but it will never have the momentum within Apple to actually get out of the Apple stratosphere enough to be it's own thing. This is probably exactly what they want, but it's a shame.
As for other platforms? There's work being done, but it's still not terribly useful since so many of the foundational frameworks are iOS and macOS only. (I'm unaware of any major projects doing server side swift for instance.)
Saying you were Obj-C only made some sense a few years ago but I can't imagine many places are doing it any more.
Feels very similar to Kotlin on the whole.
It’s definitely being adopted by Mac and iOS developers for apps (although the only real alternative is Objective-C). And there are a few build tools and the like using Swift -- many with installation instructions for Linux! -- although I think on a very small scale compared to C/C++, Rust, Go, Java and Node.
If anyone’s seriously using Swift on the server, I’d be surprised (but interested to hear about it).
This really needs to be addressed, it's one of the few real bummers about the language which I otherwise love and use everyday. I'm also concerned the way more and more language features (mostly for library and framework authors) are getting piled on, it can't help compilation speed.
When Go first came out, I thought their emphasis on compilation speed was just an overreaction to C++, because a) C compiles plenty fast, b) C++ is only slow if you overuse templates, c) other languages compile faster than C++, right? and d) Moore's law!
But a) hardly anyone uses C now, b) everyone overuses C++ templates, c) other languages compile way slower than C++, d) compilers got slower faster than computers got faster.
Even now, Xcode can feel very slick and fast in a tightly-written C/C++/Obj-C project.
It's okay. It's just a programming language like million others. Gets the job done.
> Is it being adopted by developers in a way Apple was hoping?
Apple does not negotiate, when they make up their mind you have to either adopt or die.
can you share what you find 'brilliant' about it?
What I can tell you though, is that the language is easy to read thanks to the choices they made in the way the syntax is and the language has enough abstraction tools to let me keep the parts of the code that I'm not actively working on away. For example, I like to use the property wrappers and extensions to put away the code that I'm done working on.
I also like that its strongly typed but also gives me enough wiggle room with generics.
I like the concept of protocols to vaguely define the basics of some kind of data structure and be able to pass around different flavours of it as if I'm on a weakly typed language where functions can take whatever you throw at them.
Another thing that I like about swift is that the toolset Apple provides. I used to do JavaScript as my main language but I got sick and tired of the amount of effort to keep the stack together. Endless number of tools that have many alternatives that do the same thing in a slightly different way, hours and days spent in configuring them is something that I don't want to go through anymore.
With Swift and the tools that Apple provide(various frameworks and xCode) starting something new to thinker on is as simple as creating a new Word document. It reminds me of the PHP workflows a bit, where you type your code in a text fil, put it in a folder and see the results immediately.
Essentially, I like the comfort of using Swift.
https://www.swiftbysundell.com/articles/property-wrappers-in...
I think that is a risk that almost invariably comes with being open and popular. I saw the same thing with C# vs Java. In Java, you don’t have a logging API, you have a meta-logging API into which you can plug multiple logging libraries. Similarly, there used to be (maybe still are) zillion of viable options for parsing XML, json, different build systems, etc.
That brings flexibility, but at the price of having to spend time picking the best tool and anxiety about the grass at the other side, maybe, being greener.
Often, eventually, the dust settles and a clear winner emerges, but that’s not a given, and doesn’t help you when you have to make choices before the dust has settled. I don’t follow JavaScript closely, but I think it definitely still is in the “before the dust has settled” phase.
I really enjoy the value types — real structs with copy-on-write behaviour (internally). So there's a lot of freedom to model your application with a single source of truth that can be updated in a transactional way, diffed, unified, intersected, without worrying about any leftover state causing bugs
Protocols and protocol extensions are very powerful. Allowing you to write a generic interface and then add explicit functionality to anything which adopts that interface in a very clear way
In combination with pattern-matching enums which can store uniquely typed data with their cases, it makes it very easy to model complex systems in a readable, maintainable way
The combination of all these things, plus powerful generics and a very thoughtfully designed set of foundation APIs, makes it very pleasurable to write and read Swift code
The new async/await functionality also seems like it was considered for a long time. It manages to stop you from doing stupid things with threading at compile time by being conservative about how you can use structures concurrently
I eventually embraced it and the new App greatly benefitted, hardly any bugs out in the wild compared to our other apps, we mostly just get crashes from Apple code.
Code is reeadable and easy to understand (although there is still some terrible code in the app from when I was still getting my head around it, but it works fine).
It has some frameworks and protocols I've started to use extensively, the codable protocol is especially useful for web interface, combine is coming on in leaps and bounds.
I still don't trust SwiftUI, even Apple's demo projects don't always implement things correctly and don't display properly if you use the wrong device in the wrong orientation. So I still use IB (New swift developers don't like it, it is a pain and hard to use for apps that run on all devices in multiple orientations, but for what it is, I've used worse in my career)
I think the rapid adoption is because you can basically just inherit any Objective-C class in Swift, and then add functionality. And that's just one way of mixing Swift into an existing code base, there are others.