Is there a transpiler or something that converts Rust code to JavaScript?

Just curious if there is something that converts Rust to JavaScript?

1 Like

Not as far as I know.

But you can compile Rust to WASM and call that from Javascript. Usable in the browser and under node.js.


so would wasm support most rust libraries if compiled with the bin project?

I have not played with WASM much but my understanding is no.

Threading is an issue. WASM does not support threads, but in the browser it can be done using web workers if I understand correctly.

You won't be able to do anything that requires network access and so on. At least not in the browser.

1 Like

It wouldn't support anything system-dependent. Basically, you're limited to core+alloc, without most of std.


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.