I was once a computer science undergraduate student and wrote a lot of code back then. I write less code as a math graduate student, but it still comes in handy now and then. Here are some programs I’ve written over the years.
Literate programs
These programs are written in CWEB, and are meant to be read! I have also included the C and PDF outputs so you don’t have to download a CWEB compiler to read them.
- LLL-ALGORITHM. A program that performs lattice reduction via the famous LLL algorithm (C) (PDF).
- LP-BALLS. A program for experimenting with points in the unit ball of $L^p$. (C) (PDF).
TeX macros
If you wish to compile my sources from TeX, you’ll need to download these macros and typeset using the Plain TeX engine. Feel free to use and modify them for your own purposes as well.
- fontmac.tex (Fonts and document formatting)
- mathmac.tex (Mathematical shortcuts)
- proofmac.tex (Proof figures)
If you use LaTeX and want your documents to kind of look like my Plain TeX documents, I have a LaTeX .sty
file that sort of approximates it.
You can see a demo I prepared (LaTeX/PDF). I’m not going to keep this updated though, so if you like the style you should consider switching to Plain TeX. Terms and conditions apply. GohLaTeX should not be used to typeset machine learning documents.
Exercise solutions
Solutions to exercises in various computer science textbooks.
- Structure and Interpretation of Computer Programs, by H. Abelson and G. Sussman (Scheme)
- The Art of Computer Programming, by D. E. Knuth (MIX Assembly)
Projects
OPythn
A compiler and bytecode interpreter for a sizeable subset of Python, written in OCaml (with the help of Ocamllex and Menhir for lexing and parsing). Created as an individual semester-long software project under the supervision of Adam Dingle at Charles University in Prague. Relevant blog posts: 1, 2.
Alonzo
An interactive lambda-calculus interpreter that performs normal-order beta-reduction and includes support for variable bindings.
Natural-Language Parser
A program that generates syntax trees for English sentences, written in Haskell. A blog post detailing the approach as well as the limitations of the program can be found here.
Miscellaneous Programs
A collection of small programs and scripts I wrote while learning new languages. Many are solutions to coding puzzles and challenges. Some of the most fleshed-out are:
- A calculator, implemented as a stack-based virtual machine (OCaml)
- A program that collects and analyses weather data (Haskell)
- An implementation of some abstract data structures (C)
- A tool for analysing/generating Cayley tables (Haskell)
Hackathons
HackPrague 2019
My teammate and I created Mattoni, a program that allows you to generate and interact with escape-time fractals. We used the SDL2 graphics library and wrote the program in C. I wrote more about it here. (May 2019)
ConUHacks IV
My team implemented Nim, a mathematical strategy game, using the Processing programming language and platform. I wrote more about it here. (January 2019)
HackPrinceton Fall 2018
My team created CourseTalk, a discussion and collaboration platform for students. A blog post describing the process and functionality can be found here. (November 2018)
School
These are my assignment solutions for certain classes. They were made public only after their respective course end dates.
COMP 206 Winter 2018
Assignments from COMP 206 Introduction to Software Systems at McGill University.
COMP 321 Fall 2019
Assignments from COMP 321 Programming Challenges at McGill University.