Trunk – Build, bundle and ship your rust WASM application to the web
12 comments·May 22, 2022
I love Rust. It's the most I've enjoyed any programming language, barring perhaps Haskell. But the fact that the culture is rife with stuff like this annoys me to no end.
In Python it's the opposite, as we good serious bootstrapping problems, and people complain for different reasons.
In C, people complain because tooling is too complex, in Haskell because 3rd party tools are unreliable, in PHP because it's riddle with security issues, in JS because it breaks compat regularly, etc.
There is always something it seems.
You added a reference without actually adding a reference.
This was enough for me to ignore the rest of your comment.
My understanding is that it provides configurable WASM/HTML/JS/SCSS bundling and a dev server so you can easily edit and live reload your DOM and WASM code that’s being bundled.
It sounds like it could reduce friction around this kind of development a lot. There are probably similar things though, you’re right. I’m not sure how this compares, but I like the sounds of it a lot.
It's for building frontend apps in Rust by compiling to Webassembly, that is still pretty niche compared to using it for the backend, so it's not strange that there isn't a very polished incumbent for that role. Of course, you could just use the tools from the JS ecosystem instead. When I played around with Rust WASM, I used Snowpack and called out to cargo to do the Rust build.
I've recently used trunk for the first time. It is a huge improvement to the current way of building a Rust wasm app. For one of my apps that doesn't use trunk, I'm maintaining these two scripts to set up a system and to compile a wasm bundle:
Trunk allows me to remove these scripts and offers live reloading of changes in my Rust code. It is a great experience. I know that there're similar tools for React etc, but I'm not aware of another tool that works this well with Rust.