Skip to content

Instantly share code, notes, and snippets.

Rust/Wasm without npm

A couple weeks ago, I saw Rachel's Rust generative art app and since then, I've been gunning to make a Rust web app of my own. Like most Rust documentation, the go to web app tutorial is informative and easy to follow. However, it assumes use of npm and a Javascript bundler whereas I wanted to avoid installing extra stuff. If for whatever reason that resonates with someone, maybe this post will be helpful.

If not, skip to the bottom to see the thing!

Some notes

The point of all this is to write performant stuff in Rust, compile it into webassembly (Wasm) using wasm-pack, and have your regular, bloated Javascript call on the Wasm to do heavy lifting. In order to expose Rust/Wasm functions so that they can be called from Javascript, we use the Rust crate [wasm-bindgen](https://crates.io/crates/wasm-bindg

Writing for an Imagined Audience

I’m going to write this again from scratch.

I originally wrote about how RC is an idea swamp where I’m exposed to things I’ve never even dreamed of. About how little I’ve done in the last week. About random fun things I came across… Maybe I’ll post some of that eventually, but when I read it, I hated it.

So I’m trying again with pen and paper and rambling and crossing stuff out. By typing up the Markdown for a blog post with the expectation that other Recursers will see it in their Blaggregator-Zulip feed, I feel like I’m trying to force my writing to be funny or eye-catching or profound in a way that I apparently hate.

There seems to be a part of me hoping that a bunch of people will read my posts and think I’m really cool. This is perfectly vain and human and understandable, but I dislike having these thoughts.

Making a personal website

I've spent the past couple days brainstorming and building this website. At least for this first iteration, I wanted to keep it old-school and only use HTML and CSS. In case it's useful to anyone else, I'll describe the experience and provide tips for newbs like me.

Learning by example

Since most websites aren't "handmade" these days, I went through dozens of personal websites and blogs to find a few that I could use as examples. Sites using frameworks have a gazillion <div>s and CSS rules which isn't super helpful for learning from.

The first good resource I found was this repo for a minimalist art website by eviau. The repo has only 7 CSS rules that are easy to follow. Her own personal site only has 15 rules!

By looking at Wesley Aptekar-Cassels's blog, I learned about normalize.css which is intended to remove st

Sweet Beginnings at Recurse

One week at the Recurse Center means I've got lots of dreams and little concrete progress. But lots of dreams comes with lots of fun!

Inspiration from others:

  • Woody's sound-based pong game
  • Blogging recommendations from Edith (Iron Blogging group): "Focus on what you blog, not where you blog. You can always just put it in a GitHub Gist." (paraphrased)
  • Music recommendations from Music Consumption Group
  • Bug Driven Development/Art talk from from Rachel, mold-inspired art from Moishe
  • Witnessed my first Rust plus WebAssembly site, also from Rachel. Mind BLOWN