Working Notes: a commonplace notebook for recording & exploring ideas.
Home. Site Map. Subscribe. More at expLog.

2023-10-29

In some ways, this week's letter is a little bit sparser: I've been heads down at work, and haven't really been able to focus as much on learning new things as I would have liked. Looking back at last week's letter, I see that I ended up mostly abandoning the books I was actively reading in return for focusing on things I'm working on, and looking for small pieces of novelty.

Talks

As both a replacement, in addition to Netflix, I continued catching up on Strange Loop videos:

  1. Building Distributed Systems was a great talk on different, new languages that can make it significantly easier to build and reason about consistency and distributed systems. What really stood out to me was a quote: "The speed of light is roughly 4 inches per clock cycle", building much better intuition on cpu speeds than I'd had before.
  2. Metrics for preventing security incidents is an interesting take on building metrics for something I would generally consider impossible to measure. Personally, I've been very skeptical on building false precision by introducing numbers where none exist, but I'm coming to understand the value of having something like this.

Books

I treated myself to a physical book as well, thinking about adding a design to this site: a book by Dieter Rams on design. The 10 commandments are fascinating, and resonate strongly -- particularly Good design is as little design as possible. Sadly enough, the book's format is not as friendly to read as I would like -- there are thin columns of text with German and English translations next to each other, making it somewhat unweildy to read.

Python

Python's wheel building has been wonderfully inconsistent, and I've slowly been learning more -- sometimes with a growing sense of terror as I consider the sheer number of options. Pypa has some excellent documentation, with a small page on editable installs. The Setuptools page on Development Mode is significantly more detailed and useful; with corresponding PEPS: PEP660. There's also a library to build editable wheels. In practice, I often see libraries installed with a custom .pth file in site-packages, with a pointer to a custom data loader.

ZSH

I've been wanting to have a ZSH prompt that split the terminal, to make it very obvious when the screen is moving from one command to the next. All of the mechanisms I've been seeing involved using live calculations, but a simpler trick has been relying on prompt truncation; documented in the ZSH docs on Prompt Expansion.

Simply using a very long line of unicode box characters and having them truncated by using %<< has worked very well. The documentation is a little bit hard to pass, but as a simplified, real example:

export PROMPT="# %~ %-2< #<───<... snipped ...>───"

will end up generating a line that ends with the characters # (which I appreciate for symmetry).

# ~ ───────────────────────────────────────────── #

The prompt also explicitly starts with a # character so if I copy paste my terminal into a script, it simply turns into a comment without breaking anything. I remember seeing someone use ; which may be an even more elegant way to achieve this.

Building my own transformer

Inspired by Andrej's videos, I've been slowly iterating on a custom implementation in Hy & Jax. I expect to fill that out with time.

Kunal