About Me
Blog
moon indicating dark mode
sun indicating light mode

Learn. Make. Blog. Repeat

A blog on all things computer science

Latest posts:

Do technical mechanisms for building ‘trust’ help people trust systems?

21 November, 2020

7 min read

They're the bedrock of e-commerce and sharing economies, but do they really work and have they crossed a line?

A Protobuf tutorial for OCaml and C++

03 October, 2020

8 min read

We have our lovely type definitions and language data structures in OCaml, but we want to use them in our C++ backend. The solution? Serialise them using Protocol Buffers, a language-independent binary format.

Desugaring - taking our high-level language and simplifying it!

01 July, 2020

6 min read

So far we've talked about checking our Bolt program is correct, but now we're moving on to actually running it. One problem though, a lot of our high-level constructs like objects and methods don't exist in LLVM IR - we need to map them to simpler constructs.

Writing a Lexer and Parser using OCamllex and Menhir

01 June, 2020

9 min read

The first stage of a compiler is to represent our Bolt program in a structured format. In this post, I explain how lexing and parsing work, and how we use OCamllex and Menhir to generate the lexer and parser for Bolt. I'll also cover how to fix cases in Menhir where there are ambiguous parses.

So how do you structure a compiler project?

25 May, 2020

6 min read

It's one thing to understand how a compiler works. It's another to set up the project repo - in this post we'll talk about which languages to use, what the design tradeoffs are, and how the Bolt repository is structured.

Why write your own programming language?

10 May, 2020

6 min read

Writing your own programming language helps you build the right mental models when programming. I introduce the fundamental concepts behind compilers and explain where Bolt fits in.

OCaml Testing and CI

17 January, 2020

5 min read

We'll cover 3 different testing libraries - Alcotest, QCheck and PPX Expect, each with different styles of testing - unit tests, property-based tests and expect-tests respectively. We then look at how you'd integrate them and compute test coverage in a CI workflow.

The Ultimate Git Beginner Reference Guide

27 January, 2019

16 min read

A one-stop guide with the most useful commands in Git explained with diagrams and animated code gifs - whether you're a beginner looking to get started, or want to learn more advanced techniques to manage your Git history.

Backpropagation through, well, anything!

17 September, 2018

5 min read

How we can generalise Backprop to any neural network - see how TensorFlow and Keras compute their partial derivatives! We'll use the LSTM cell as an example

Recurrent Neural Networks

17 September, 2018

6 min read

Neural networks optimised for NLP and sequences - the RNN, GRU and LSTM networks

Debugging the Learning Curve

02 September, 2018

5 min read

Training, validation and test error - is our model really learning or is it just memorising?

Backpropagation

31 August, 2018

6 min read

The magic sauce behind neural networks - how they learn!

What is a neural network?

28 July, 2018

4 min read

There are a lot of different neural networks out there. We start the series by breaking down commonly used terminology.

© Mukul Rathi 2020