Technical Blog

Deriving Recursion from First Principles

2 Oct 2023

Or: Approaching the Y Combinator

These are some of my class notes. Learning to derive the Y Combinator from first principles is something I’ve always wanted to do. This isn’t quite the Y Combinator, but it’s very close and it still gets you recursion without relying on recursive structures to begin with.

In the beginning, we write a recursive function to compute the length of a list:

(let* ([len (λ (lst)
             (if (null? lst)
                 0
                 (+ 1 (len (cdr lst)))))])
  (len '(1 2 3)))

The let* syntax allows us to create local variable bindings that can reference themselves. But let’s suppose we don’t have let*—what do we do?

...

My Commitment to Intellectual Integrity

23 Sep 2023

I got a strange email the other day. Here it is, with parts redacted:

Hi there,

My name is G—, I am the main editor at —————.

While browsing your site, I noticed you have an amazing article from this page:

Link to an extremely old post of mine

My team actually just published a comprehensive article on “Semi-related title” which I think your visitors would truly appreciate and add value to your awesome article.

...

Implementing Type Systems as Macros

14 Aug 2023

There’s a neat paper Type Systems as Macros by Chang, Knauth, and Greenman [1] that describes how to implement a typed language using an untyped host language and macro expansion. The paper is neat, but I found the code hard to follow—the paper uses a compact notation that’s convenient for print, but not so much for reproducing on one’s own. This post is my attempt to implement and explain in more accessible terms what’s presented in the paper.

...

Reflections one year into a PhD program

5 Aug 2023

I started my PhD program about a year ago. In my first year I have:

  • Taken 4 “normal” 3-credit-hour classes
  • Participated in 3 seminars
  • Switched advisors
  • Attended 2 conferences (PLDI @ FCRC, JuliaCon)
  • Presented my work at JuliaCon

It’s been a lot of work, and there’s been a lot of stress. I’m in a much better place now than when I started, and over all I’m happy where I’m at and where I’m headed.

...

Warp Factor Refactoring in Emacs

1 Jun 2023

Here’s a nifty Emacs workflow for doing a project-wide search-and-replace on steroids. While I do use refactor tools that come with language servers,1 sometimes those aren’t enough. Consider the case where you not only need to change the name of a function, but also e.g. need to swap the order of two of its arguments. Or you’ve broken one function out into two that need to be chained together. Whatever—there are plenty of ways where the IDE won’t be able to do everything that you need. Enter: Emacs.

...

Hike up Desolation Trail

26 May 2023

I hiked up Desolation Trail with Scott Wiersdorf. It had rained a little bit the night before, so the trail was neither dusty nor muddy—perfect for hiking.

Figure 1: Hike overview

Figure 1: Hike overview

Lots of pretty plants on the way.

Figure 2: This flower is called Arrow Leaf

Figure 2: This flower is called Arrow Leaf

Figure 3: Some pretty ground cover

Figure 3: Some pretty ground cover

Figure 4: A neat old tree that got split

Figure 4: A neat old tree that got split

...

Meta: Update should fix RSS feeds

13 May 2023

I recently made an update to how I build my blog. I like writing my posts with Org-mode because it provides a richer markup language than Markdown. Plus, more Emacs = more good. Hugo has support for Org files, but there was a problem with the RSS feed generation: all of my posts written in Org got truncated at some point. I don’t know if the fault lies with Hugo itself or with some problem in the theme I use—whatever it was, I don’t have the time right now to debug that and submit a good bug report or a fix. Instead, I’m using the ox-hugo org-mode exporter, so I still can write my posts with Org, but then let Emacs export them to Markdown for Hugo to process.

...

The kind of thinking computer science enables

11 May 2023

I believe computer science plays as integral of a part to a well-rounded liberal arts education as does mathematics and linguistics. Why? A liberal arts education is designed to help you think in new and better ways. Computer science teaches novel ways of thinking, reasoning, and approaching problems that are hard to get anywhere else.

I took a class on pedagogy when I encountered this puzzle. I answered the question easily, and I caught myself using reasoning patterns from work in programming coming to the forefront.

...

Using a Real Mail Client with Outlook

3 May 2023

I recently managed to get access to my Outlook email from Emacs. This took some doing as my university had disabled app passwords. I consider Outlook to be harmful, but inasmuch as companies and schools continue to enforce OAUTH-only authentication with email systems, it is good to find workarounds.

This is how I set up email sending/receiving on my computer running macOS with DavMail. I also use mbsync (confusingly also known as isync) to actually fetch my email, and mu/mu4e to index and read mail. Douglas Rumbaugh has an awesome blog post that I followed to get this working. You should read that. This will mostly be my specific configuration settings as well as some tips and tricks.

...

Mastodon