Given the simplest of the fast files:
println("lol")
It is trivial to run this on the command line using xcrun swift -i lol.swift or to compile the executable using xcrun swift lol.swift -o lol , but what about a simple proof of concept for emscripten?
I haven't used emscripten before, but got a welcome example using C ++ working from http://kripken.imtqy.com/emscripten-site/docs/getting_started/Tutorial.html , and wanted to compile my Swift code too.
I tried
xcrun swift lol.swift -emit-bc -o lol.bc emcc lol.bc
But we get
Value: %1 = call { i8*, i64, i64 } @_TFSS37_convertFromBuiltinUTF16StringLiteralfMSSFTBp17numberOfCodeUnitsBw_SS(i8* bitcast ([4 x i16]* @0 to i8*), i64 3) LLVM ERROR: Unrecognized struct value Traceback (most recent call last): File "/Users/glen/Downloads/emsdk_portable/emscripten/1.16.0/emcc", line 1540, in <module> shared.Building.llvm_opt(final, link_opts) File "/Users/glen/Downloads/emsdk_portable/emscripten/1.16.0/tools/shared.py", line 1267, in llvm_opt assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output AssertionError: Failed to run llvm optimizations:
Thoughts?
javascript swift llvm emscripten
geelen
source share