3 ms·
Compiling Rust to WebAssembly and building https://github.com/koute/stdweb https://github.com/koute/stdweb Rust is a powerful enough language where you can do
by kouteiheika 9y ago
Compiling Rust to WebAssembly and building https://github.com/koute/stdweb https://github.com/koute/stdweb
Rust is a powerful enough language where you can do crazy stuff like write inline JavaScript inside of your Rust code, and freely pass data in and out of those JS snippets, and compile the whole thing to WebAssembly.
- pohl 9y agoIt's nice that Rust has a macro facility to make this possible. It reminds me of the delightful way that Google Web Toolkit lightly abused the "native" keyword (which marks FFI methods in Java) to do inline javascript.
- topspin 9y agoIn my mind Rust macros are easily the least appreciated feature of the language. Nearly every non-trivial library I've had any contact with use macros in some manner to enhance their API and usually the result is very good. For me one of the most compelling things about Rust when I first learned of the language was print!() and how it comprehensively solves the type-safe string interpolation problem better than anything that has ever been provided in C and C++.
- deleted 9y ago[deleted]