Developer

Why using WebAssembly and Rust together

Why using WebAssembly and Rust together

Have you or your team ever run into a situation where application speed and developer productivity were incredibly important, but the business demands were rapidly shifting? I work on the IBM Garage Method team, and my team found ourselves in this exact situation when I was tasked to find a solution and build a proof-of-concept transpiler for our team’s content files.

I needed to find a technology stack that would enable us to deliver on all fronts and, at the same time, be something that integrated well with our existing toolchain. The following article details how I came to decide on using Rust together with WebAssembly and talks about why the combination of those two technologies is so powerful.

Note: The work surrounding this tool is still a work in progress and we have not fully implemented everything that is a business requirement at this point.

The journey to Rust and WebAssembly

Business requirements

First, allow me to elaborate on the business demands that I mentioned earlier. Our team is currently in the process of rewriting and refactoring our entire application that currently uses a domain-specific language (DSL) for all of our content. We have thousands of these files, totaling over a gigabyte of content, and sometimes, we even have multiple templates contained in the same file.

For a successful rewrite, we need to automate how we transpile the content to a new system. We also have to consider that hundreds of our content writers are trained on how to use this DSL, so any change will require them to adapt to the new system. With those requirements, we had to decide between two options:

A command-line tool that we would run one time to mass migrate our existing content. The content writers would learn the new system.

A command-line tool that we could run as a mass migration OR as a means to run on locally changed files for more incremental builds so that the writers could continue using their existing system.