Questions tagged [webassembly]

For questions about how programming languages target the WebAssembly virtual machine, or the WebAssembly text format itself

Filter by
Sorted by
Tagged with
5 votes
2 answers
369 views

How can I compile closures in WebAssembly?

Consider the following pseudocode: ...
Aster's user avatar
  • 3,065
1 vote
0 answers
109 views

Does WebAssembly have any instructions which don't have analogues in LLVM IR? [duplicate]

I know EMSCRIPTEN can convert from LLVM IR to WebAssembly, but I don't know of any tool that converts from WebAssembly to LLVM IR. Such a tool would come useful to me, as the compiler for my ...
FlatAssembler's user avatar
1 vote
0 answers
249 views

Is it possible to convert WebAssembly to LLVM? [closed]

I've made a compiler for my programming language that outputs WebAssembly Text Format, and it uses the wat2wasm assembler from WebAssembly Binary Toolkit to convert ...
FlatAssembler's user avatar
7 votes
2 answers
266 views

Is it fine to target .wat instead of .wasm and use wat2wasm?

IIRC the WebAssembly text format (.wat) is not able to express everything .wasm can, such as binary (custom) sections. I'm not sure about the current state of WebAssembly text and binary formats now ...
Hydroper's user avatar
  • 919
5 votes
3 answers
484 views

What are some different approaches for inline assembly, and what are their pros and cons?

In my programming language that compiles to WebAssembly, I am using the following syntax for inline assembly: ...
FlatAssembler's user avatar
12 votes
1 answer
200 views

How do I implement coroutines on WebAssembly?

I am building a compiler targeting WebAssembly for a language that makes heavy use of first-class coroutines. WASM doesn't have native coroutine support (yet), so I have to emulate it. Given the ...
Michael Homer's user avatar
  • 12.1k