Skip to content(if available)orjump to list(if available)

C compiler for Web Assembly (c4wa)

pyrolistical

Zig can also compile to free standing wasm

comex

In the comparison with Emscripten using wasm-decompile [1], the author appears to have forgotten to turn on optimization. Yes, if you run emcc with no -O option then you will get extremely bad generated code quality, similar to most C compilers. Add -O and you get nice and tight code similar to what c4wa outputs.

[1] https://github.com/kign/c4wa/blob/master/etc/doc/comparison....

lioeters

> c4wa needs Java 11 or above

It sounded good until this part. Would have been nice if it were written in the subset of C that it supports, so it could compile the compiler to Wasm.

apitman

This is actually pretty compelling to me. I think the more support for freestanding wasm modules the better.

I'm working on a custom wasm app runtime and I don't want to have to implement the entire API surface of Emscripten or WASI. The new component model is even more complex. I wish there was more tooling available for using C/Rust stdlib functions for things like reading files or opening a socket, but being able to define your own API to handle the actually operations in the host/module interface.