crossposted from https://programming.dev/post/6975282