C-like -> wasm as a crate?

Is there a crate that does (subset of C) -> wasm and then returns a function we can call? I'm looking for a function of type signature:

fn compile_at_runtime(code: &str) -> Result<MyFunc, Err>;
type MyFunc = Rc<dyn Fn(int n, void **); // n args, each is a void *

I would prefer to do this using Rust crates (i.e. not making a shell call to gcc / llvm).

That is called a compiler :wink:

C is not a terribly difficult language and wasm is not that difficult either.
You could probably write one in a few weeks.

no results on lib.rs.

maybe look at


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.