About Me

Learn. Make. Blog. Repeat

A blog on all things computer science

Join my newsletter for more content like this!

Email subscribers get exclusive access to the latest posts first!

Google Translate is biased, and here's how we can fix it!

11 April, 2021

8 min read

Adding more models to our pipeline isn't the solution.

I've Started a YouTube Channel

24 February, 2021

3 min read

In case you're wondering why the blog isn't getting as much love. I'll update this post with major milestones.

Generics - adding polymorphism to Bolt

23 January, 2021

4 min read

Generic classes <T> let us reuse the same class with different types. We'll implement generics in Bolt, taking inspiration from C++ templates!

Implementing Concurrency and our Runtime Library

28 December, 2020

9 min read

Let's bootstrap our language's runtime with C library functions. To do this we'll inspect C files' LLVM IR, and dive deeper into LLVM's type system. In the second half of the post, we'll implement Bolt's finish-async concurrency construct.

React From First Principles

30 November, 2020

4 min read

React is a JavaScript library that makes it super easy to create interactive UIs. We'll build it up from first principles.

AI is not a magic sauce

07 November, 2020

2 min read

AI is not a panacea. Deploying AI poses both socio-technical and security risks which we must handle. The solution? We're already doing it elsewhere...

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?


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 2021