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

Nathan Gray n8gray at n8gray.org
Sun Jun 25 18:50:47 CDT 2017


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.
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-build-dev/attachments/20170625/9e42de8b/attachment.html>


More information about the swift-build-dev mailing list