3 ms·
They mention C++ quite often, it seems like they plan to become more than an Apple-first language. If Swift had been designed to be cross platform first and the
by zeotroph 4y ago
They mention C++ quite often, it seems like they plan to become more than an Apple-first language. If Swift had been designed to be cross platform first and then had optional, but well supported and official "ObjcInterop" and "ApplePlatform" modules it could have taken a serious portion of Go and Rust's market share. But as it is nobody outside the Apple ecosystem is even considering it.
As to "Val", there is inout (and sink set) which Herb Sutter also suggested for C++ to replace all the &ref, const ref&, *ptr, and value parameter mess which to a degree Rust also inherited.
The default let parameters (const ref&) is also what Carbon defaults to. And with explicit copies there are now destructive moves as in Rust. They write "Our goals overlap substantially with that of Rust and other commendable efforts, such as Zig or Vale" - a wasted opportunity to mention "Rust" in the title here!
I just think the fun keyword is silly and the wrong width, just use fn already! But I like any language where reference and value semantics are not hidden behind compiler magic.
- coldtea 4y ago>But as it is nobody outside the Apple ecosystem is even considering it. You'd be surprised. There are communities using Swift on Linux and elsewhere...
- theplumber 4y agoI could bet 99,9% of them are ios developers "forced" to make a website for the app
- programmarchy 4y agoYou might be surprised. Check out Vapor [1] and Soto [2], which are built on Apple's SwiftNIO (non-blocking I/O) [3]. It's actually a very nice ecosystem. All the tools are in place to build web servers, Lambdas, etc. [1] https://vapor.codes https://vapor.codes [2] https://github.com/soto-project/soto https://github.com/soto-project/soto [3] https://github.com/apple/swift-nio https://github.com/apple/swift-nio
- frou_dh 4y agoI think the point they are trying to make is that unless someone already has history as Mac/iOS app developer, they are in practice not even considering Swift when doing a project that targets Linux, regardless of how good the libraries are or are not. If we exclude the aforementioned group, then adoption of Swift for non-Apple platforms seems like an almighty bust (close to nonexistent?) compared to the lofty goals the Swift team were mentioning in the early days.
- programmarchy 4y agoFor server and system code, Swift is mostly competing with Rust and Go, as people consider fast, compiled, type safe languages. If you look at Docker downloads, Swift has 10M, Rust has 50M, and Go has 1B+. Compared to Go, yeah, it's nowhere close. But compared to Rust, I wouldn't quite call it a bust, and could see teams choosing it for the easier learning curve. So yeah, it's a relatively small niche at this point, but I also think it's fair to say the effort to make Swift a contender on the server has been more than just iOS developers being forced to make web apps.
- ragnese 4y agoI agree. I've assumed that once Lattner left as Swift lead, that Apple basically decided that Swift would be Apple-only. That's the only reasonable explanation for them adding Combine, result builders, etc into the language.