Get the latest tech news

Rust and WASM for Form Validation


For a very long time, the Rust WASM story wasn't entirely clear to me. In order to use WASM from Rust you had to use Node, Webpack, and all that jazz. This always turned me off using WebAssembly because it felt too heavy of a toolchain to get going. These days, things are much, much better.

With just a handful lines of code we can get access to an incredibly powerful language embedded in our otherwise extremely simple web page. WASM is still relatively heavy, compared to the equivalent JS that would’ve accomplished the same (20KB or so vs a few hundred bytes), but this is also an extremely contrived example case. We’ve built a simple web app that uses Rust for both backend and frontend logic, all powered by Rocket and WebAssembly.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Rust

Rust

Photo of wasm

wasm

Photo of form validation

form validation

Related news:

News photo

A Rust-TypeScript integration

News photo

Muxio: Rust layered stream and RPC toolkit

News photo

AerynOS Tooling Now Written In Rust Rather Than D, New Software Updates