RSSAmplifier

Blog

Ian Henry

Ian Henry's blog.

ianthehenry.comRSS feed ↗10 posts

Latest posts

Keyboardion

I had another idea for a musical instrument, and I think it worked out pretty well. It’s sort of a cross between a chromatic button accordion and a keytar . Or maybe it’s a digital Chapman Stick … except that it’s more polyphonic and tuned completely differently. I don’t know. It’s kind of a new thing, I think. The chromatic button accordion is probably the…

Periodic Spaces

One of my favorite SDF techniques is domain repetition : (def eye-center [35 82 62]) (def eyes (ball 39 | move eye-center | mirror x :r 10)) (def eye-angle [0 0 0]) (defn pupils [target] (def left-pupil (ball 15 | shade black | move [39 0 0] | align x target | move eye-center )) (def right-pupil (ball 15 | shade black | move [39 0 0] | align x target | move [-1 1 1 * eye-center] )) (union…

Generalized Worley Noise

Worley noise is a type of noise used for procedural texturing in computer graphics. In its most basic form, it looks like this: (color r2 (worley q 50 :oversample true)) That’s ugly and boring, but it’s a quick way to see what the effect looks like. If we use Worley noise to distort a 3D shape, we can get something like a hammered or cratered texture: (def s (osc t 5 | ss 0.2 0.8 * 30…

Building Bauble

I made something that I think is pretty neat, and I want to tell you about it. This is a little hot air balloon made out of alternating layers of brass and bronze that stack together with these angled facets: It’s 3D printed, sort of, but it really is solid metal – it’s not a metallic filament. It’s made by “lost wax casting,” where you 3D print a model out of…

Quote-unquote "macros"

You&rsquo;ve probably seen this Python 101 thing before: @memoized def fib ( n ): if n <= 1 : return n return fib ( n - 1 ) + fib ( n - 2 ) Leaving aside the absurdity of computing Fibonacci numbers recursively , it&rsquo;s a common first introduction to Python decorators and higher-order functions. fib is just a function, and memoized takes that function and returns a new function (or something…

How to Learn Nix, Part 49: nix-direnv is a huge quality of life improvement

The reason I discovered an ancient blog post the other day was that I had something new to say about Nix for the first time in over two years. The thing I want to say is this: nix-direnv is great. It fixes roughly every problem that I&rsquo;ve had with nix-shell , and does so in a much nicer way than my previous ad-hoc solutions. This is important because I mostly just use Nix to document and…

How to Learn Nix, Part 48: Installing (single-user) Nix on macOS

Note: I wrote the vast majority of this post on August 24, 2022, but I decided that it was a whiny rant that I didn&rsquo;t want to publish. I came across the draft in January 2024, remembered that this entire series is a whiny rant, and decided to publish it anyway. I&rsquo;ve been a happy Nix user for about 18 months now, and&ndash; well, not happy happy, but satisfied&hellip; no&hellip; not…

The Fibonacci Matrix

When you think about the Fibonacci sequence, you probably imagine a swirling vortex of oscillating points stretching outwards to infinity: Okay, no, obviously you don&rsquo;t. Yet . When you think about the Fibonacci sequence, you probably flush with a latent rage when you remember that it is, more often than not, the way that we introduce the concept of &ldquo;recursive functions&rdquo; to new…

My Kind of REPL

I want to tell you about an idea that has had a huge influence on the way that I write software. And I mean that in the literal sense: it&rsquo;s changed the way that I write software; it&rsquo;s re-shaped my development workflow. The idea is this: you can write programs that modify themselves. And I don&rsquo;t mean macros or metaprogramming or anything fancy like that. I mean that you can write…

Generalized Macros

I&rsquo;ve been writing a lot of Janet lately, and I&rsquo;ve been especially enjoying my time with the macro system . Janet macros are Common Lisp-flavored unhygienic gensym -style macros. They are extremely powerful, and very easy to write, but they can be pretty tricky to get right . It&rsquo;s easy to make mistakes that lead to unwanted variable capture, or to write macros that only work if…