🎁

12 Days of Baddass Courses sale! Get instant access to the entire egghead library of courses and lessons for 58% off.

Runs out in:
15 : 06 : 06 : 51
1×
Become a member
to unlock all features
Autoplay

    Course Overview: Using WebAssembly with Rust

    Nik GrafNik Graf
    webpackwebpack
    rustRust
    javascriptJavaScript

    The goal of this course is to explain how to setup a project using JavaScript and WebAssembly with Rust.

    We start out with building our first WebAssembly module and loading it. Then we gradually build up until to a point where we use wasm-bindgen to invoke functions and pass data between JavaScript and Rust without a hassel.

    Further we explore various tools like wasm-pack to build our Rust code with ease and use them in combination with Node or Webpack.

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss

    Transcript

    Transcript

    Instructor: WebAssembly defines a binary format and a corresponding Assembly-like text format for executable code that can run in web pages, and that with a near-native performance. It is also designed to run alongside Javascript, allowing both to work together.

    WebAssembly's major goal is to allow developers improving the performance of certain parts of their application to, in the end, improve the user experience. The best part, WebAssembly is a standard, and supported by all major browsers.

    While many languages still work out a compilation story to WebAssembly, Rust is ready for prime time. Rust is a relatively new language, and a great replacement for C and C++. In addition to that, the Rust WebAssembly team is working already on sophisticated tools, like wasm-bindgen, to make the interoperability seamless.

    In this course, we start from the beginning, demonstrate how to load a module, and then gradually build up until to a point where we use wasm-bindgen to invoke functions and pass data between Javascript and Rust without a hassle.

    Further, we explore various tools, like wasm-pack, for example, to build our Rust code with ease, and use them in combination with Node or webpack. I hope you enjoy this course, and I would appreciate your feedback.