Ian Henry

ianthehenry.com · Personal blog · on HN since 2014

Ian Henry writes programming posts on Nix, the Janet language, geometry visualizations, and personal tooling and workflows.

What HN saysHN links it for "How to Learn Nix," the Delaunay triangulation visualization, and his Janet game posts, with the Nix guide recommended as an in-depth study.
62HN people shared it
28linked it in comments
66stories submitted
3.1Kstory points
3 months agolast shared
2014people per year2026

Most-shared posts

  1. 1
    How to Learn Nix
    6 people · 347 points · first shared 2021 · 154 comments on HN
  2. 2
    Visualizing Delaunay Triangulation
    5 people · 181 points · first shared 2022 · 23 comments on HN
  3. 3
    Sd: My Script Directory
    5 people · 131 points · first shared 2021 · 21 comments on HN
  4. 4
    Drinking with Datalog
    5 people · 19 points · first shared 2022 · discussion on HN
  5. 5
    How to Learn Nix
    4 people · 154 points · first shared 2021 · 93 comments on HN
  6. 6
    Making a Game in Janet
    4 people · 4 points · first shared 2021 · discussion on HN
  7. 7
    A different kind of keyboard
    3 people · 552 points · first shared 2021 · 147 comments on HN
  8. 8
    Building Bauble
    3 people · 206 points · first shared 2025 · 26 comments on HN
  9. 9
    The Problem with Macros
    3 people · 160 points · first shared 2021 · 69 comments on HN
  10. 10
    My kind of REPL (2023)
    3 people · 88 points · first shared 2023 · 5 comments on HN
  11. 11
    Why Janet?
    3 people · 40 points · first shared 2023 · 6 comments on HN
  12. 12
    How to configure tmux, from scratch
    3 people · 36 points · first shared 2021 · 1 comments on HN
  13. 13
    Generalized Worley Noise
    3 people · 8 points · first shared 2025 · discussion on HN
  14. 14
  15. 15
    The Fibonacci Matrix
    3 people · 1 points · first shared 2023 · discussion on HN

What HN people wrote when they linked it

lemonwaterlime · 2025-08-04
The best way I have found to use tmux is to unbind everything and set only the things I use for my workflow. Then the configuration (.tmux.conf) becomes the docs. I was inspired by the "How to Configure tmux from scratch" post [1]. I came up with my use cases: - I want to create sessions - I want to open and close windows - I want to create split panes - I want to use vim-style text select - etc. Then I made mappings for the things I care about for my workflow specifically. Before this, I would accidentally hit a keybinding while doing something else and not know how I got to that state, taking me out of flow to troubleshoot. Afterwards, only the keybindings I have defined take action. Now tmux fits like a glove. Because tmux is so stable, I haven't had to touch my config in years. It's worth the one time effort. [1] https://ianthehenry.com/posts/how-to-configure-tmux/
robenkleene · 2025-06-23
I love this, I've been iterating on workflows like this for something like a decade now. Over time I've tried to peel back as many of my custom layers as possible, because all of those layers have a maintenance cost. Stock Vim (without `tmux`) can actually do most of what's shared in this post with `rg --vimgrep restore_tool | vim -c cb -` (`vim -c cb -` is my favorite feature in Vim; I find it strange that it's so rarely used or talked about). (Since re-running the `rg` search can be undesirable, and I often like to analyze results in a terminal before opening them in Vim. I use a custom `tmux` command to copy the output of the last command [using this trick that involves adding a Unicode character to your prompt https://ianthehenry.com/posts/tmux-copy-last-command/], then I send that into Vim with e.g., `tmux saveb - | vim -c cb -`.)
Mageek · 2023-08-11
Another very good blog overview here (not mine): https://ianthehenry.com/posts/delaunay/ I love DCELs and have been tinkering with them in my own side projects lately. Very cool data structure!
e3bc54b2 · 2022-05-30
If you're looking to learn Nix start-to-end, there manuals for Nix and NixOS, both are good. This is an extensive study at trying to 'understand' Nix, because is does so many things differently: https://ianthehenry.com/posts/how-to-learn-nix/ If you're just looking to start building your system, follow NixOS manual up until you have a running system, then pace yourself as you will. You can also setup Nix on existing Linux distro or macOS and practice the ropes before plunging into NixOS.
ianthehenry · 2021-10-13
I've been writing about my first impressions of the language here: https://ianthehenry.com/posts/janet-game/ Not a whole lot of content yet, but I plan to keep going with it. I am pretty firmly in the Haskell/OCaml "let me program with types" camp for most development, but it's a great to have a little scripting language to reach for instead of bash or Python or Perl. Using Janet (coming from Python) reminds me a bit of: https://xkcd.com/353/ Except... without the rich standard library :)
shadytrees · 2014-06-30
We use ReactiveCocoa [0] extensively at work and can't recommend it highly enough [1]. (Although admittedly KVO makes Cocoa almost the ideal platform for reactive programming.) [0]: https://github.com/ReactiveCocoa/ReactiveCocoa [1]: http://ianthehenry.com/2014/5/4/kvo-101/
Cu3PO42 · 2023-12-16
I don't think you can ever get Nix as simple as PNPM, simply because native libraries are sometimes annoying, need to be configured at build time to a greater degree and because the problem space it attacks is so much larger than PNPM, which only deals with the JS/Node.js ecosystem. However, I do think that there exist reasonable levels of abstraction that sacrifice some expressive power for simplicity and such systems could maybe expose a PNPM-like CLI. One example that comes to mind is devenv.nix [1]. While it doesn't yet have a CLI, its configuration file is YAML and relatively simple. I think there's more to be done in this space and I hope for tools that are easier to grasp in the future. > Nix package files evaluate down to configuration for the Nix package manager, but I haven’t ever seen a good explanation for the basic essentials underneath all the abstraction. Every guide I’ve learned from and all the package defs I’ve read seem to cargo cult many layers of mysterious config composing config. Without easy to learn essentials it’s difficult to grok the system as a whole. To me it sounds like the essential that you're referring to is the 'derivation' primitive, which is almost always hidden behind the mkDerivation abstraction from nixpkgs. This [2] blog post is an exploration of what exactly that means. I'd also love for the documentation situation to be much better, in particular in terms of official, curated resources. But I'm not convinced that you actually…
jitl · 2022-11-30
You could theoretically use Datalog anywhere you're currently using a SELECT SQL statement - it's a declarative way to produce a set of tuples given some existing sets of tuples. But, Datalog is much better at deductive reasoning compared to SQL. There's a great interactive tutorial here: https://percival.ink/. To see how Datalog and SQL can be equivalent, I have a build of percival.ink that transforms simpler queries to SQLite: https://percival.jake.tl/ You can also see how Souffle itself can be useful in this blog post: https://ianthehenry.com/posts/drinking-with-datalog/ That post describes building a recipe engine that can tell you, given a bunch of recipes + the current contents of your bar cart, what drinks you can make, as well as giving you top ingredients you could buy that would allow you to make new drinks. It's quite a readable walkthrough of a very practical application of Datalog/Souffle in a place where SQL would certainly struggle.
josters · 2025-12-09
This seems to be the article's author's own language Bauble[1], "a toy for composing signed distance functions in a high-level language (Janet), compiling them to GLSL, and rendering them via WebGL"[2]. [1]: https://ianthehenry.com/posts/bauble/building-bauble/ [2]: https://github.com/ianthehenry/bauble
veqq · 2025-11-18
https://ianthehenry.com/posts/janet-game/putting-judge-to-the-test/ also showcases the same library. The same author wrote this textbook for Janet: https://janet.guide/ There's also this example website: https://janetdocs.org/
tempodox · 2025-01-11
No usable line, only a URL: https://ianthehenry.com/posts/bauble/building-bauble/bauble.ac2cd35c75… After that, is shows line number 1 and a column number in the millions, so seems to be megabytes of code in that JS file. For each code box, I get two errors with the same URL, just different column numbers: - TypeError: undefined is not an object (evaluating 'renderer.draw') - Unhandled Promise Rejection: Error: failed to create webgl2 context This is Safari 18.2 on Ventura (Intel), which seems to be a buggy release all around. Even the scroll bars are broken.
bythreads · 2024-08-15
Author's entry on Delaunay triangulation is pretty rad : https://ianthehenry.com/posts/delaunay/
pxc · 2024-08-01
It's not exactly a writeup or review, but Ian Henry's blog series How to Learn Nix captures the surprises, good and bad, that a newbie exploring Nix is likely to encounter. Some of the problems he encounters may be outdated, as Nix and its documentation have both evolved since the start of the series. His experience is also somewhat shaped by his decision to rely solely on the documentation and the software itself for guidance, which he held to for quite a long time-- if you seek help from others earlier on you may get stumped less often. But overall it captures very well what getting to know Nix and its docs is like, including the emotional reactions to sharp edges. https://ianthehenry.com/posts/how-to-learn-nix/
bmacho · 2024-06-02
No janet despite https://ianthehenry.com/posts/janet-game/ (article copyrighted between 1899-1907, but doesn't look vintage that's a shame)
g0xA52A2A · 2023-11-06
Reminds me of similar post with some nice visualisations https://ianthehenry.com/posts/fibonacci/ https://news.ycombinator.com/item?id=36942033
Tajnymag · 2022-12-31
sd actually has tab completion and it was one of the reasons the author made it He explains it on his blog: https://ianthehenry.com/posts/sd-my-script-directory/
danbst · 2022-08-15
There exists `sd` which does the same! Maybe details differ. See intro in https://ianthehenry.com/posts/a-cozy-nest-for-your-scripts/
nixpulvis · 2022-08-05
Nix needs a new porcelain interface for it's CLIs. Moreover, this post sums up one of my biggest issues stopping me from trying Nix for real again: https://ianthehenry.com/posts/how-to-learn-nix/ambiguous-packages/ Finally, needing to rewrite everything in Nix is nice for poorly written configurations or undocumented packages in general, but seems redundant for well maintained software. Has anyone else come up with a sane Nix strategy to avoid the overhead?
FullyFunctional · 2022-04-23
I liked the idea enough to actually buy one of the Cykey devices, but I didn't enjoy the experience; probably because there's actually a lot more finger movement compared to typing on a good keyboard with a good layout. A few years ago I saw this (probably on HN): https://ianthehenry.com/posts/peggi/ which I thought was a much more interesting idea. I still want to try it one day.
lallysingh · 2022-01-24
This post is dead-on. I've been trying nix in different forms for years, and it's been incredibly painful. The way the folks who use it normally talk about it is so different from real-life use by non-experts it feels like gaslighting. I only felt vindicated when reading https://ianthehenry.com/posts/how-to-learn-nix/ -- it's not me it's them. Maybe one day it'll get good enough to be usable. Right now it's a long, long fight to get productive in any non-trivial (e.g., explicitly supported and documented) configuration.
Arcuru · 2021-11-12
I stumbled on this lately, which I've borrowed myself and I'm finding it pretty convenient: https://ianthehenry.com/posts/sd-my-script-directory/ Shell completions are essential for it, so I had to stumble through writing my own for Fish, but now that it's setup it's quite nice.
abathur · 2021-10-10
Ian Henry has, thankfully memorialized the learning process so that we can all readily rediscover it. https://ianthehenry.com/posts/how-to-learn-nix/introduction/
Saser · 2026-05-21
I love Cram tests, they can be so readable! Being essentially shell scripts, though, they can be a bit hard to integrate into any given language's regular testing framework though. I get the sense that "expect tests", also known as "inline snapshots tests", are becoming more and more popular. I think that many, including myself, first learned about it from the Jane Street blog post "What if writing tests was a joyful experience?" (https://blog.janestreet.com/the-joy-of-expect-tests/) because I keep seeing references to it. Indeed, the blog post points to Cram as prior art in this space. I also think Ian Henry's article "My Kind of REPL" (https://ianthehenry.com/posts/my-kind-of-repl/) makes a very convincing case for why expect tests are useful. Jane Street has published their `ppx_expect` library for OCaml and you can use it today: https://github.com/janestreet/ppx_expect. For other languages, here's an incomplete list of similar libraries I'm vaguely aware of: - Rust: expect-test, (https://github.com/rust-analyzer/expect-test, quite old), insta (https://insta.rs/) and k9 (https://github.com/boujeepossum/k9) - JavaScript: Jest has inline snapshot testing: https://jestjs.io/docs/snapshot-testing#inline-snapshots - Python: inline-snapshot (https://15r10nk.github.io/inline-snapshot/latest/). Also discussed in this post from Pydantic: https://pydantic.dev/articles/inline-snapshot - Go: https://github.com/hexops/autogold. I like it and use it daily at work. It has some…
deathanatos · 2024-08-13
In the associated article linked to at "Leaving aside the absurdity of computing Fibonacci numbers recursively,"[1] (which, yes, I agree), we list the various algorithms as (roughly): how to fibonacci space complexity time complexity ------------------------- ---------------- --------------- insane recursion exponential exponential memoized insane recursion linear linear The space complexity of "insane recursion" without memoization is the maximum stack-depth; the worst case stack is, fib(n) fib(n-1) fib(n-2) ... fib(1) Which is n stack frames (and the stack frames are of constant size); the space complexity of the whole thing is thus linear in the size of n. (While the call tree is itself exponential in size, the memory required is only the depth of that tree, since we can't call fib(n-1) & fib(n-2) simultaneously[2]. (The time complexity is, of course, exponential, and I agree with the "insane" moniker. I also like your comment elsewhere in this thread about people hyperfocusing on the example and missing the larger point of the article … and I'm so sorry but I've been sniped by this.) [1]: https://ianthehenry.com/posts/fibonacci/ [2]: the little demons in my mind are now trying to scheme up an insaner recursion that attempts this. Threads maybe?
rayiner · 2023-04-13
The discursion on macros is interesting reading: https://ianthehenry.com/posts/janet-game/the-problem-with-macros/. But it stops at Scheme’s hygienic macros, which address the very problem raised at the beginning of the discussion, in more or less the way Janet seems to work: https://legacy.cs.indiana.edu/ftp/techreports/TR356.pdf (page 4). The issue is not so much that macros are not merely syntactic transformations, but rather than s-expressions alone aren’t sufficiently expressive to represent the syntax of any Lisp with a package system. The scheme macro system solves that by having macros return syntax objects where identifiers used in a macro can carry around a reference to the original context where the macro was defined. So referencing a function in a macro definition will look up the function in the context of where the macro is defined, and return a syntax object that refers to the correct function. To my knowledge, most modern macro systems work this way (Scheme, Dylan, etc.)
Macha · 2022-08-07
I think the problems with nix-env come down to two things: - nix-env -i and nix-env -u will almost certainly eventually do the wrong thing for you if you use them enough (nix-env -iA is ok): https://ianthehenry.com/posts/how-to-learn-nix/ambiguous-packages/ - It's not reproducible as it depends on the state of your nix-channel setup at that time. How much of a problem this is depends on your use case. nix-as-homebrew-replacemnt or nix-as-shared-package-list-across-osx-and-linux users are probably fine with this, as what these users care about is more portability than reproducibility, but nix-as-predictable-dev-environment types will be let down by it. I think the fact that the latter affects different users differently and that the new flake world doesn't offer a "modify your global environment without the tool taking over" option (expecting you to use nixOS or nix-darwin instead) has meant that there's not enough motivation to agree on a replacement that nix-env could tell you to use instead. I guess the eventual replacement will be "nix profile", but while you'll find at least some documentation on "nix develop" and "nix flake", I had to look in the CLI tool docs for this one, which makes me suspect it's even less final than the other two So instead the community will tell you to avoid nix-env, but there's no agreement to have the tool or docs tell you that.
aidenn0 · 2022-03-15
> I disagree, I used it a number of times. It's practical. Sometimes you just want to install software the old-fashioned way. You can argue that isn't the right way to do things, and anyone running Nix will probably agree, but still I found myself wanting this and it served the purpose well enough. The problem is that it lulls you into thinking it serves the purpose well enough and then eventually things break. Then they get more broken. Then you can't figure out which thing you installed is breaking things. Then you finally do and can't figure out how to uninstall the thing that broke things. > aidenn0, could you explain what `-irf` does and what it should do? I'm curious now, even though I don't currently use Nix. I'm pretty sure it sets up the environment from a file; I found it one link away from the link in the comment I replied to here[1] 1: https://ianthehenry.com/posts/how-to-learn-nix/declarative-user-enviro…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close