xkcd's "Machine" comic today is the 15th annual April Fool's project I've made with them. We made a giant collaborative rube goldberg machine!

https://xkcd.com

xkcd: Push Notifications

xkcd
@chromakode No controls seem to work on Firefox/iOS, is it a known issue?
@richlv Could you please send me a screenshot?
@chromakode Looks like this, no tapping anywhere does anything.
@richlv Fixed, I think! Thanks for the report.
@chromakode The Javascript and DOM look extremely clean. Did you use any engine for graphics, interface or physics?

@netaction Thank you! https://rapier.rs for the physics, with custom React rapier bindings to render DOM nodes with attached rigid bodies and colliders.

I hope to write about this soon; lots of interesting trade-offs to build this in 2 weeks. React hot refresh was very useful!

We'll open source this after catching up on sleep -- though sourcemaps are up if you feel like exploring. 😁

Rapier physics engine | Rapier

Fast and cross-platform physics engine

@chromakode Thanks for the detailed reply! Very impressive results for "just" some libraries rather than a full game engine using Canvas.
After you are that much into open source and quality and justice and somehow sarcasm, may I ask what you do for a living? Might be hard to find a job for someone who has some moral standards.

@netaction I considered pulling in PixiJS or writing a canvas renderer, but since we had a lot of UI and drag and drop interactions, I decided to try to push the limits of DOM only.

I wanted to see if React could act as an entity graph of sorts, because one of the core technical challenges is loading and unloading physics objects as the slippy map scrolls around. The ideas was to reduce this problem to React DOM diffing, using the component mount/unmount to manage physics engine data...

@netaction This worked beautifully once a few small perf optimizations were in place. I spent the first half of development extremely concerned that I'd reach the end of my rope performance-wise when it was too late to change, but once I had 1.5-2k balls being simulated (rendered literal DOM nodes!!) my fears were allayed.

I once heard this idea that as browsers engines have matured, they've converged to resemble modern game engines, with highly optimized GPU-based rendering paths.

@netaction I do software engineering for a living. So far (about 15 years), I've worked in small and medium sized companies, including reddit, Keybase, Patreon, and most recently Discord.

On a run recently I was reflecting on a similar question about how to find ethical work. Obv a very deep topic. I started my career with a desire to avoid negative externalities of my work. I've aimed for products I feel can make a positive impact, but if you look at the totality of the industry and world...

@netaction There are so many negative effects and trade-offs in the software and broader tech startup space. If one tried to avoid all of them, there'd be very few possibilities left.

In engineering, it's often possible to abstract that away into someone else's problem -- a manager, founders, board, VC funds, etc -- but that only obscures the impacts, and also isolates from deciding which trade-offs to make.

@netaction Overall, these days I still try to work on products I feel are mostly positive in the balance, and strive to take a more active role in choosing how those trade-offs are made.

Because having moral standards demands actively participating, and actively participating on most important things involves moral hazard.

@chromakode I like your explanation why you are responsible for your work no matter who decides what it is used for.

> Because having moral standards demands actively participating, and actively participating on most important things involves moral hazard.

This is what I thought about the last days. Sounds motivating as in "doing nothing helps nothing". But also could justify everything just because it might be for good. Seems a balance is key.