Official tailored Swift for Windows support promised in 5.3

Swift on more platforms – provided you do not need a GUI

The team working on the Swift programming language has said its goals for the upcoming version 5.3 will include "adding support for Windows and additional Linux distributions".

Swift is a programming language developed by Apple and first released in September 2014. It won immediate popularity as an alternative to Objective-C that is both safer and more productive to use. Apple open-sourced Swift in December 2015, sparking immediate interest in porting it for other platforms. Currently only Apple platforms (MacOS, iOS, iPadOS, tvOS, watchOS) and Linux are officially supported, though Apple has said there are "community members actively working to port to even more platforms."

IBM sponsored the Kitura framework for server-side swift, but withdrew much of its support in December 2019 thanks to disappointing take-up. That said, there is still an official Swift Server Work Group and projects include Swift NIO (an event-driven network framework). Vapor is a web development framework that runs on macOS and Ubuntu.

taylor swift

IBM tailors Swift relationship after 'review of open source priorities'


What about Windows, though? There have been several efforts to support Swift development. RemObjects has a proprietary Swift compiler which targets numerous platforms (.NET, Android, Java, Windows, Linux and WebAssembly), but compatibility is not perfect.

There is an open source Swift for Windows but it seems moribund. You can use Windows Subsystem for Linux (WSL) to run the Swift compiler, though the REPL (Read Eval Print Loop), an interactive command-line, does not work in WSL 1.0. Running the Swift toolchain in a Docker container is also a possible solution for developers wishing to code on Windows.

The good news for would-be Windows Swift developers is that an official route to native Swift for Windows is well advanced. The project is called swift-build rather than swift-windows, because it covers Linux and Docker as well as native Windows. The minimum Windows 10 version is 10.0.17763.0 (October 2018 update). Developing and building for Windows is a little fiddly but no doubt this will be smoother when there is a fully supported release.

The key announcement came back in January when "expand the number of platforms where Swift is available and supported" was stated as a goal for Swift 6, and Saleem Abdulrasool, described as "the primary instigator behind the port of Swift to Windows", was added to the core team. Now, in the announcement of the process for Swift 5.3, "adding support for Windows and additional Linux distributions" is specifically noted.

A better supported Swift on Windows and Linux will help adoption, but this will be primarily for server-side or non-visual code. Windows Swift for Tensorflow, used for working with ML models, is a good use case alongside projects like Vapor.

Here we GUI

What about GUI applications though? This is a problem because SwiftUI is tied to Apple operating systems. There will be solutions, but unfortunately the idea of taking your Swift application for macOS and/or iOS and recompiling it for Windows will not fly.

Another issue is whether the open source Swift community can build enough momentum for cross-platform Swift to achieve production-quality releases. Apple made Swift open source, but has little incentive to invest in platforms other than its own. Swift was invented in order to make developers more productive coding for Apple platforms. Progress in cross-platform Swift has been slow.

Proceed with caution therefore, but Swift on Windows will still be a milestone for a language which is well liked. Swift won praise recently from an unlikely source: Microsoft's Miguel de Icaza, who has worked for years on taking C# cross-platform. "There is plenty to love about Swift technically, and I will not enumerate all of those features, other people have done that. But I want to point out a few interesting bits that I had missed because I was not a practitioner of the language, and was more of an armchair observer of the language," he said last week. Perhaps cross-platform Swift will encourage others to take a look. ®

Other stories you might like

  • Boeing's Starliner capsule corroded due to high humidity levels, NASA explains, and the spaceship won't fly this year

    Meanwhile Elon's running orbital tourist trips and ISS crew missions

    Boeing’s CST-100 Starliner capsule, designed to carry astronauts to and from the International Space Station, will not fly until the first half of next year at the earliest, as the manufacturing giant continues to tackle an issue with the spacecraft’s valves.

    Things have not gone smoothly for Boeing. Its Starliner program has suffered numerous setbacks and delays. Just in August, a second unmanned test flight was scrapped after 13 of 24 valves in the spacecraft’s propulsion system jammed. In a briefing this week, Michelle Parker, chief engineer of space and launch at Boeing, shed more light on the errant components.

    Boeing believes the valves malfunctioned due to weather issues, we were told. Florida, home to NASA’s Kennedy Space Center where the Starliner is being assembled and tested, is known for hot, humid summers. Parker explained that the chemicals from the spacecraft’s oxidizer reacted with water condensation inside the valves to form nitric acid. The acidity corroded the valves, causing them to stick.

    Continue reading
  • Research finds consumer-grade IoT devices showing up... on corporate networks

    Considering the slack security of such kit, it's a perfect storm

    Increasing numbers of "non-business" Internet of Things devices are showing up inside corporate networks, Palo Alto Networks has warned, saying that smart lightbulbs and internet-connected pet feeders may not feature in organisations' threat models.

    According to Greg Day, VP and CSO EMEA of the US-based enterprise networking firm: "When you consider that the security controls in consumer IoT devices are minimal, so as not to increase the price, the lack of visibility coupled with increased remote working could lead to serious cybersecurity incidents."

    The company surveyed 1,900 IT decision-makers across 18 countries including the UK, US, Germany, the Netherlands and Australia, finding that just over three quarters (78 per cent) of them reported an increase in non-business IoT devices connected to their org's networks.

    Continue reading
  • Huawei appears to have quenched its thirst for power in favour of more efficient 5G

    Never mind the performance, man, think of the planet

    MBB Forum 2021 The "G" in 5G stands for Green, if the hours of keynotes at the Mobile Broadband Forum in Dubai are to be believed.

    Run by Huawei, the forum was a mixture of in-person event and talking heads over occasionally grainy video and kicked off with an admission by Ken Hu, rotating chairman of the Shenzhen-based electronics giant, that the adoption of 5G – with its promise of faster speeds, higher bandwidth and lower latency – was still quite low for some applications.

    Despite the dream five years ago, that the tech would link up everything, "we have not connected all things," Hu said.

    Continue reading

Biting the hand that feeds IT © 1998–2021