3 ms·
lol, this feels surreal. This seems like there could be even more stuff automated. Because Rust is statically typed, a rust-loader could "overload" import() s
by k__ 9y ago
lol, this feels surreal.
This seems like there could be even more stuff automated.
Because Rust is statically typed, a rust-loader could "overload" import() so it initialises and extracts the exported/non-mangled function signatures and create the JS equivalents automatically.
const {add} = await import("./main.rs");
add(2,2)
- Matthias247 9y agoSure. But I think a better way would be a separate build tool and step, which generates the javascript proxy functions. With that way you get code completions and type checking for the remaining javascript/typescript, if the loader does everything dynamically you are more likely dynamically typed.
- k__ 9y agoTrue, I was just thinking about JavaScript, which is dynamically typed :D
- ianjsikes 9y agoThat is a great idea. I expect more usability improvements to come shortly as more people become interested in WebAssembly.