You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At ExportWebAssembly, I've prototyped a package for converting Julia code to WebAssembly. It uses the awesome LLVM package, and much of this code is straight from CUDAnative. This approach works much better than my previous efforts of trying to get julia --output-bc incantations to work.
Right now, it works fine for code using StaticArrays and other immutables. Nothing works that uses ccall's, though. Using Emscripten, I've gotten big chunks of libjulia and libuv compiled to bitcode, so if I can get the ccall's to link with that bitcode, that will open up much more Julia code that will compile to WebAssembly/JavaScript.
llvmcall's are handled fine by this package. In llvmcall's, you can include calls to functions that are declared but not defined. So, it may be possible to convert a ccall to an llvmcall with a declared function and let the linking happen later.
Supporting ccall may require changes to codegen in Julia. So, would it be appropriate to add another hook or two to those added by @maleadt (#19290, #23581)? To get at the ccall's before they are converted to calls to memory addresses, it looks like I need a hook earlier in the codegen process (here?).
If hooks aren't the way to go, are there any other suggestions?
The text was updated successfully, but these errors were encountered:
I played around with it enough to find something that worked for my application, but it wasn't very general. I changed focus to try implementing codegen in Julia: https://github.com/tshort/CodeGen.jl
At ExportWebAssembly, I've prototyped a package for converting Julia code to WebAssembly. It uses the awesome LLVM package, and much of this code is straight from CUDAnative. This approach works much better than my previous efforts of trying to get
julia --output-bc
incantations to work.Right now, it works fine for code using StaticArrays and other immutables. Nothing works that uses
ccall
's, though. Using Emscripten, I've gotten big chunks of libjulia and libuv compiled to bitcode, so if I can get theccall
's to link with that bitcode, that will open up much more Julia code that will compile to WebAssembly/JavaScript.llvmcall
's are handled fine by this package. Inllvmcall
's, you can include calls to functions that are declared but not defined. So, it may be possible to convert accall
to anllvmcall
with a declared function and let the linking happen later.Supporting
ccall
may require changes to codegen in Julia. So, would it be appropriate to add another hook or two to those added by @maleadt (#19290, #23581)? To get at theccall
's before they are converted to calls to memory addresses, it looks like I need a hook earlier in the codegen process (here?).If hooks aren't the way to go, are there any other suggestions?
The text was updated successfully, but these errors were encountered: