<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>James Fennell</title>
    <link>https://jpfennell.com/</link>
    <description>Recent content on James Fennell</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 07 Apr 2025 18:05:40 -0400</lastBuildDate><atom:link href="https://jpfennell.com/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>A surprising enum size optimization in the Rust compiler</title>
      <link>https://jpfennell.com/posts/enum-type-size/</link>
      <pubDate>Mon, 07 Apr 2025 18:05:40 -0400</pubDate>
      
      <guid>https://jpfennell.com/posts/enum-type-size/</guid>
      <description>Enums are one of the most popular features in Rust. An enum is type whose value is one of a specified set of variants.
/// Foo is either a 32-bit integer or character. enum Foo { Int(u32), Char(char), } Values of type Foo are either integers (e.g. the variant Foo::Int(3) with a payload of 3) or characters (e.g. the variant Foo::Char(&#39;A&#39;) with a payload of &#39;A&#39;). If you think of structs as being the and combination of their fields, enums are the or combination of their variants.</description>
    </item>
    
    <item>
      <title>Migrating Transiter from Python to Go</title>
      <link>https://jpfennell.com/posts/transiter-python-go/</link>
      <pubDate>Sat, 22 Oct 2022 22:05:40 -0400</pubDate>
      
      <guid>https://jpfennell.com/posts/transiter-python-go/</guid>
      <description>Transiter is a backend web service that subscribes to transit data feeds and provides an HTTP API for querying the data (e.g., &amp;ldquo;when are the next trains at Times Square?&amp;quot;). Transiter was originally written in Python, but over the course of the last year I rewrote it in Go. This article is my contribution to the &amp;ldquo;porting X from Python to Go&amp;rdquo; genre, which is admittedly well-trodden, but I hope it’s interesting nonetheless.</description>
    </item>
    
    <item>
      <title>Non-reproducible builds in Python</title>
      <link>https://jpfennell.com/posts/python-dependencies/</link>
      <pubDate>Wed, 22 Jun 2022 22:05:40 -0400</pubDate>
      
      <guid>https://jpfennell.com/posts/python-dependencies/</guid>
      <description>For the last four or five years I’ve worked on-and-off on a sizable enough Python side project. By far the most frustrating aspect of maintaining it has been that if I leave it alone for a few months and then come back to add some small feature, I cannot in general rebuild the project. Something simple like executing pytest to run all the unit tests just does not work.
Instead, I have to first spend a non-trivial amount of time debugging error messages like the one that appeared when I tried to build the project earlier this week:</description>
    </item>
    
    <item>
      <title>Another token peeking side effect in TeX</title>
      <link>https://jpfennell.com/posts/tex-peek-cat-codes/</link>
      <pubDate>Fri, 24 Sep 2021 20:05:40 -0400</pubDate>
      
      <guid>https://jpfennell.com/posts/tex-peek-cat-codes/</guid>
      <description>When processing a stream of tokens in a language parser, we generally assume that peeking at the next token does not have any side effects. In a previous post I described how this is not the case in TeX.
In that post we had a token whose expansion rules were changed after the token was peeked at but before it was fully consumed. In TeX, the peek operation has the side effect of expanding tokens it encounters, and TeX never undoes this expansion.</description>
    </item>
    
    <item>
      <title>A time-traveling edge case in TeX</title>
      <link>https://jpfennell.com/posts/tex-expansion-edge-case/</link>
      <pubDate>Thu, 08 Jul 2021 20:05:40 -0400</pubDate>
      
      <guid>https://jpfennell.com/posts/tex-expansion-edge-case/</guid>
      <description>Suppose you have the following raw TeX (not LaTeX) file first.tex:
\def\month{\relax The month is May.} \input second.tex \month This defines a custom macro, inputs a second file, and then prints the output of the custom macro. Suppose that second.tex contains:
June has begun. \def\month{\relax The month is now June.} What&amp;rsquo;s the output of pdftex first.tex? It&amp;rsquo;s what you&amp;rsquo;d expect:
June has begun. The month is now June. The custom macro \month is first defined, then the second file is processed during which the macro is redefined, so when \month is expanded it has the second definition.</description>
    </item>
    
  </channel>
</rss>
