Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Install Binaryen and the WebAssembly Binary Toolkit (WABT)


    In this lesson we cover the install process for Binaryen ( to get the s2wasm binary and WABT ( to get the wast2wasm binary.

    Prerequisites are cmake (, XCode CLI tools on Mac, or Visual Studio on Windows.



    Become a Member to view code

    You must be a Pro 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
    orLog In




    To get the .s to .asm tool, I'm going to clone and build binaryen from GitHub. In the binaryen folder with CMake installed, we then run CMake., and when that's ready, we run CMake -- build. to build the current folder. For Windows users, if you've installed CMake and have the Visual Studio build tools, the same sort of process should work.

    To build the WebAssembly Binary Toolkit, I'm going to clone from GitHub. We need to add this recursive flag, when we do that clone, to make sure we include the sub modules. Once that's downloaded, it's roughly the same build process. Except this time, I'm going to create a build folder, running CMake within it.

    I'm going to add the CMake EXECUTABLE_OUTPUT_PATH flag to output our executable binaries into the out folder. We run that against the lower folder source. Then we run CMake -- build. to complete the build into the output path. The build folder can then be removed afterwards.