6 ms·
But why? Sure, there are people who want to tinker with it for fun, but outside of that what is the point in having Swift on Linux and Windows? You can't use
by sime2009 6y ago
But why?
Sure, there are people who want to tinker with it for fun, but outside of that what is the point in having Swift on Linux and Windows?
You can't use it to build mac or iOS apps on Linux because the important libraries aren't there. There is no cross platform UI and Apple isn't likely to port and support theirs from macOS. If you are into servers then you have plenty of better languages options with established ecosystems. Maybe there are some command line apps on macOS which can now be ported to Linux/Window, but beyond that, what is the point? Where is Apple trying to go with this?
- skohan 6y agoI use it for all kinds of things, like computer graphics and various tools in my CLI-driven workflows. I find it nice to work with, because it has a lot of the nice features Rust does, like affine types, 1st class optional handling, decent single-threaded safety guarantees, and it has a very nice, ergonomic interface. Generally the performance characteristics are not what you would get with Rust, but I am generally more productive in Swift because I don't have to worry about the low level details. There's definitely some downsides - cross platform support being one of them - but if I'm just working on a tool for me myself to use, I will generally reach for Swift because it's pleasant to work with. I would be happy if I could use it for projects which need to be deployed across different platforms.
- HacklesRaised 6y agoI was not aware that swift had affine types. Never been a big fan of Swift, I loved objective-c, so there is some built in bias there.
- ElFitz 6y agoIt's a fully fledged programming language. An open-source programming language, at that, with a lot of community input and involvement. Not a macOS or iOS app creation DSL. It's also quite pleasant to use, and has already seen a few uses beyond macOS and iOS apps, including some backend development (Vapor, Kitura, SwiftNIO, probably others). So you could use it to write command line tools. To write Linux or Windows apps. Or to write servers. Just like any other programming language.
- jbverschoor 6y agoI'd say swift is currently probably the best languages out there. Language features, standard library, performance, memory management.
- seanparsons 6y agoJust checking my notes...and the answer is no.
- zapzupnz 6y agoDismissive responses like this are frowned upon by the HN community guidelines. Give your reasonings, not a snide remark.
- seanparsons 6y agoOK then: - Slow compilation, I think even now immutably concatenating a handful of strings makes the compile time exponential. - Over reliance on keywords and special case syntax, magic doesn't compose. A bunch of it just supports Optional for example. - Xcode, nuff said. - Equatable and Hashable for tuples were implemented with invisible compiler magic, so they wouldn't work with generics. - Variance is hot garbage, it has variance, but no way to control it. - No higher kinded types, so useful FP abstractions become a chore to implement. - I regularly had compiler crashes on comparatively simple code. - Sometimes absolute nonsense compile errors pointing at random parts of my code. - SourceKit didn't handle basic stuff like type aliases. Going on the various things I've seen since we switched our project to JavaScript from Swift it looks like the keyword soup has gotten worse.
- dep_b 6y agoSounds like you describe the state of Swift at least three years ago. SourceKit just doesn't crash anymore on me anymore, ever. Compile times are quite good for me nowadays, still not as fast as Objective-C but then again you don't get compile time guarantees for free.
- mfDjB 6y agoI've begun using Swift for Linux to build sites on Publish (https://github.com/JohnSundell/Publish https://github.com/JohnSundell/Publish) on my CI.
- manmal 6y agoApple has to ensure that Swift is adopted as widely as possible to ensure that enough people in the world are theoretically able to submit apps to their store.
- MattDamonSpace 6y agoThey’re looking to build demand over time by making Swift available in as many places as possible. And this is the Swift Open Source team, not Apple specifically. It’s not an Apple business decision (aside from lowering the learning hurdle for new iOS projects) Not to mention there’s Swift for TensorFlow, would be nice if you could handle your code locally on a Windows machine: https://github.com/tensorflow/swift/blob/master/docs/WhySwiftForTensorFlow.md https://github.com/tensorflow/swift/blob/master/docs/WhySwif...
- jmull 6y ago> But why? This is basic foundation building. It's true there aren't too many good use-cases for Swift on Windows or Linux now. But that can't really start to change until Swift has decent support for Windows and Linux. Of course, it will take a lot more than this for Swift to catch on outside of its home territory. This is just one necessary step. More broadly, I think we're still in the middle of the language wars, where the limitations of the historically dominant languages (like C, C++, Java, Javascript) have created openings for one or more newer languages. I think Apple and other Swift proponents would like Swift to become one of those newer established languages and take steps like these to at least keep it in the running.
- m463 6y agoExactly. Why would you buy into a language that is controlled by apple? Apple's behavior with open source is kind of "throw it over the wall" which isn't really good leadership. The good stuff at apple is frameworks and apps, none of it released. For examples of this, look at Darwin on https://opensource.apple.com https://opensource.apple.com They provide some sources, but they are not complete and are more to look at than to use. I figure this got through the approval process because it could plausibly get developers to pay attention to apple without letting others exit the apple ecosystem.