Eight months after Apple debuted Swift, a new third-party implementation is extending the programming language beyond iOS onto Android and .NET.
As new programming languages experience rapid spikes in popularity and adoption, the development communities around them often emerge to fill gaps in the tool chain the creators hadn’t yet addressed. It’s a natural cycle in language ecosystems that’s birthed companies like Xamarin, whose Mono implementation filled the gap in cross-platform .NET and C# tooling, and the same process resulting in Silver: a compiler and development environment for writing code in Apple’s Swift language on Android, Java, Mono, .NET and the OS X Cocoa APIs.
Developed by RemObjects Software, Silver is currently in beta, but the free compiler and tool chain are built on existing RemObjects infrastructure, such as its Oxygene language and C# compiler tool chain, both currently at version 8.0. According to RemObjects chief architect and CEO Marc Hoffman, the idea for Silver materialized soon after Swift said “Hello, World.”
“We were intrigued and excited by Swift pretty much the moment that Apple announced it last June,” he said. “Given the kind of adoption Objective-C has seen in the past purely by being Apple’s language of choice, often in spite of many people not liking it as a language, it was clear to us that Swift would be important and take off.”
RemObjects has been developing cross-platform languages and compiler technology since 2002, and Silver represents the third language implementation in the company’s Elements compiler tool chain, which integrates with Visual Studio 2013 and 2015 for Windows developers. Silver comes with RemObjects’ custom Fire IDE for Mac developers.
In a similar light to Mono, Hoffman said Silver allows developers to focus on one language and one development environment that they can use beyond Apple’s platform alone.
“Apple’s Swift tool chain is great if you’re developing for Apple’s ecosystem only,” he said. “These days, many developers need to target multiple platforms in some shape or form, whether they’re also building an Android or Windows app, or have an iOS app that needs a back-end service. And for their non-Apple projects, developers need to learn a different language, and a different IDE and tool chain.”
A cross-platform implementation that’s not cross-platform
The Silver website makes a point of stating that while the implementation supports multiple platforms, it is “decidedly not cross-platform.” Hoffman said that in addition to being a rich, full-featured language, Silver would be especially interesting to developers who want to leverage shared code between applications for different platforms.
“While we explicitly discourage people from writing ‘cross-platform apps’—that is, one single app that just gets built for each platform and runs everywhere—there’s still a lot of ‘business logic’-type code that can be shared when building dedicated apps,” he said. “For example, if you are writing a mobile app for iOS, Android and maybe Windows Phone, Silver would encourage you to design each app from the ground up for the respective platform. But back-end code, for example for communicating with your servers, modeling your internal data, or performing calculations—depending on the purpose of your app—can easily be shared between the apps. You don’t need to rotate between different programming environments. For example, you might be writing an iOS app and the back-end server in ASP.NET—both using Swift, both in the same IDE.”
In Visual Studio, Silver acts as a Swift language option within the existing code editor, but extends Swift code capabilities with additional tooling. Silver integrates deployment support to Android devices, iOS devices and Mac OS X machines from within Visual Studio, and provides debugging support for Android, Java and native Cocoa.