malc icon indicating copy to clipboard operation
malc copied to clipboard

if this can compile to wasm...

Open ctzurcanu opened this issue 4 years ago • 3 comments

It would be very useful to have in the documentation the steps for compiling to wasm. Not a lot of people know/use LLVM IR.

ctzurcanu avatar May 20 '20 09:05 ctzurcanu

LLVM has a wasm backend; so supposedly the .ll files generated by malc can be compiled to wasm instead of to x86_64 assembly. I haven't tried this. However, with wasm you need to properly declare the I/O interface - stat, puts, open, read, etc. There's a wasm library for handling this (WASI) but I haven't tried this yet. Let me know if you succeed compiling with malc to wasm (w/ WASI).

dubek avatar May 20 '20 10:05 dubek

I do not know how to do that and that is why I wanted to learn from your documentation :) If I will get to know before you change the docs, I will get back to this.

ctzurcanu avatar May 20 '20 11:05 ctzurcanu