Josh Munn's Website

Hi there!

As I’m not really engaging with social media, I want to share some basic personal info for friends and family that might find this page.

I’m living near London with Ed (we got married in 2020) and our cats Prax and Amos.

I work as a software engineer at Torchbox.

I play the bass guitar for fun, and occasionally record parts for friends (I’m set up to do this at home, reach out).

You can reach me at public at elysee dash munn dot family.

This website contains some blog posts, mostly about areas of computer programming that I find interesting. I write to enjoy the process and share things I’ve learned.

Posts

Rewriting a recursive Python function as an abstract machine

Silhouette of a person standing by a tree on a hill

The miniKanren paper (Will Byrd’s thesis) describes walk*, which is used to deeply walk some term with regards to a substitution. That means that if a given term is not atomic (e.g. it’s a list), it will walk all of its sub-terms, recursively. Here’s a naive translation to Python:

2023 Talk: Infinite Pizza

In November 2023 I gave a talk at a Torchbox internal tech team conference day. The talk was titled “Infinite Pizza”, and was an introduction to logic programming, using Python.

The slides can be viewed at https://microkanren-talk.joshuamunn.com/.

TIL: Emacs Repeat Maps

I learned about Emacs’ repeat-mode from the dape docs. It’s explained effectively in this blog post by Karthinks. It turns out repeat-mode has recently been added to Emacs core — I’m using 30.0.91, which has a bunch of my favourite recent packages included. It’s a very convenient package. I’m using it with dape, smerge, and flymake, and it really helps cut down on repeated modifiers.

Why I'm Rewriting Microkanren

I’m rewriting my Python microkanren implementation. I’ve always wanted to add tabling, have tried a few times, but stopped due to lack of time, and subtle errors. I’m taking a few steps to simplify the core implementation, and get tabling done.

Henry Moore Gardens

Ed and I spent a warm, sunny Autumn afternoon at the Henry Moore Gardens and Studios in Hertfordshire. Amazing place. This figure in particular was mind-bending.

Josh in front of a large, polished brass, abstract sculpture on a small hill. This image has been dithered for stylistic effect.

Emacs Lisp in Haskell

Since first migrating from OSX to Linux, I have been a user of the dwm tiling window manager. It is great software, my thanks to the authors. Lately, however, I’ve had an itch to change things up. I’ve been spending some time learning Haskell, so Xmonad is an obvious choice.

Microkanren, Cons and Python

I’ve been implementing µKanren in Python. One challenge so far has been creating a sequence abstraction with semantics similar to Lisp lists. This is important as it’s necessary to be able to decompose sequences into parts for unification, such that:

A Minikanren Quine

Here’s a miniKanren quine that runs on the miniKanren implementation from The Reasoned Schemer:

((lambda (_)
   (run* x
     (conde
       (( x _))
       (( x (list 'quote _))))))
 '(lambda (_)
    (run* x
      (conde
        (( x _))
        (( x (list 'quote _)))))))

A Python Quine

Here’s a Python 3 quine I wrote:

(q:='(q:={q!r},print(f{q!r}))',print(f'(q:={q!r},print(f{q!r}))'))