News for hackers. Stuff that matters.
Re:Get Started with Rust, WebAssembly, and Webpack by k__ on Tuesday June 27, 2017 @12:12PM (#14646704)
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)
Re:Get Started with Rust, WebAssembly, and Webpack by Matthias247 on Tuesday June 27, 2017 @01:57PM (#14647635)
Sure. 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.
Re:Get Started with Rust, WebAssembly, and Webpack by k__ on Tuesday June 27, 2017 @03:07PM (#14648284)
True, I was just thinking about JavaScript, which is dynamically typed :D
Re:Get Started with Rust, WebAssembly, and Webpack by ianjsikes on Tuesday June 27, 2017 @02:01PM (#14647663)
That is a great idea. I expect more usability improvements to come shortly as more people become interested in WebAssembly.