Skip to content

Binaryen C API vs wasm-opt #5106

Answered by tlively
Srinivasa314 asked this question in Q&A
Discussion options

You must be logged in to vote

There are examples of compilers using both of those approaches. The main advantage of using the C API is that you don't need to worry about having to manage multiple binaries. There also might be some performance benefits to constructing Binaryen IR directly via the API rather than parsing the IR from a file. On the other hand, the main advantage of using wasm-opt is that it becomes optional, so for debug builds you can just not run it if you want. Also, if you do use the API, you'll probably still want the ability to print the Wasm module directly from your compiler to help with debugging the compiler.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Srinivasa314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants