Hi, I'm Sam! I am an iOS developer with an interest in machine learning and computer graphics. Here, I write about my adventures in Swift and mathematics.

Better String Enums in Swift

Swift has a number of great features for improving the way it imports Objective-C code. With NS_SWIFT_NAME you can customize the name of functions imported into Swift, and nullability annotations let you work closer with Swift’s optional system. These features are very useful and pretty well known, but one feature I don’t see talked about as often is NS_STRING_ENUM.

Crafting Interpreters

This is a fantastic guide on the ins and outs of building an interpreter. It’s still in its early stages, but what’s already there is great.

Bayes' Theorem

One of the most useful and interesting theorems in statistics is Bayes’ Theorem. I like it a lot because it can be used to solve interesting problems with very little effort — it boils down to one equation! I wanted to go over it and try to provide some intuition into how it works, and then why you would want to use it.

Rendering Math with KaTeX

The other day, I was looking into how easy it is to render LaTeX via a Markdown document. MathML isn’t yet widespread enough to use reliably, so instead I started looking at some of the third-party libraries available. I had looked at KaTeX from Khan Academy a few times in the past, and was happy to find that it was exactly what I wanted.

Looking for more? Check out the archive!