[swift-dev] [swift-build-dev] Cross-compiling Swift to WebAssembly

Daniel Dunbar daniel_dunbar at apple.com
Tue Jun 27 11:06:08 CDT 2017


Hi Nathan,

This is probably best brought up on swift-dev (CC'd), since this is (initially) mostly a compiler problem and not related to the build tools (the package manager).

 - Daniel

> On Jun 25, 2017, at 4:50 PM, Nathan Gray via swift-build-dev <swift-build-dev at swift.org> wrote:
> 
> Hello,
> 
> Is anybody else out there excited by the idea of cross-compiling Swift to WebAssembly?  My impression is that almost all of the pieces are in place and that the remaining challenges are likely build related.  For example, the Clang that ships with Xcode 9 includes support for wasm32 as a compilation target.  Has anybody thought about this or pursued it?
> 
> If you're unfamiliar with WebAssembly take a look at http://webassembly.org <http://webassembly.org/>.  In essence, they're defining a VM that runs in the browser, and all the major browsers are supporting it.  We're talking about being able to code for the web without Javascript.  Imagine being able to write Swift libraries that could be compiled for iOS, Android, Linux, *and* the web!  It's currently possible with C and C++, and Swift is a promising candidate.
> 
> As I understand it, the first obstacle is getting a version of the Swift standard library that's compiled to llvm bitcode using the "wasm32" target.  Does that sound achievable?
> 
> Thanks,
> -Nathan
> 
> -- 
> Functional Programmer, iOS Developer, Surfs Poorly
> http://twitter.com/n8gray <http://twitter.com/n8gray>_______________________________________________
> swift-build-dev mailing list
> swift-build-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-build-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170627/c9aec8ba/attachment.html>


More information about the swift-dev mailing list