The Complexity of Counting

I recently held a presentation about the complexity of counting problems as part of a university course. Below you can find a recording of that presentation.

Adding Types to a Logic Program

Say you’re given the following statements: Tom is a bat. All bats are mammals. Bats usually can fly. Mammals usually can not fly. What can you infer about Tom? It’s...

LLVM's Kaleidoscope in Swift - Part 3: IR Generator

Last post we implemented a parser that assembles the output of the lexer into a more meaningful abstract syntax tree, i.e. into expressions, function definitions and external declarations. In this...

Value Type Hierarchies via Composition in Swift

When creating types that have similar or overlapping functionality, it can be hard to come up with a scheme that avoids duplication without creating leaky abstractions. The tools we usually...

LLVM's Kaleidoscope in Swift - Part 2: Parser

Last post we implemented a lexer to turn plain text into meaningful tokens. This post will deal with the parser. The job of the parser is similar to that of...

Simple Beat Detection in Real-Time Audio - Part 1

In this series of posts we will attempt to build some kind of algorithm that can be used to detect beats in real-time streams of audio - so basically without...

10 Steps to Earning Awesome Grades (While Studying Less) - Summarized

I’ve recently finished reading Thomas Frank’s 10 Steps to Earning Awesome Grades (While Studying Less). The book is really about what it says on the cover - and since I’ve...

LLVM's Kaleidoscope in Swift - Part 1: Lexer

As we saw in the last post, our compiler frontend will be split into a lexer, parser and IR generator. This post will deal with the lexer. The lexer is...

LLVM's Kaleidoscope in Swift - Part 0: Prelude

When deciding to write this story I was expecting to start by saying something along the lines of “I know there are already many tutorials for writing Kaleidoscope in Swift,...