About Me
Blog

Learn. Make. Blog. Repeat

My thoughts on computer science, software engineering and beyond.

Welcome to my blog! This blog is a digital garden of ideas and tutorials.

These ideas can really be separated into buckets, in increasing order of “completeness”. I guess one way of viewing this blog is as a learn-in-public incubator of ideas.

  • Snippets: one-off ideas or tweets, could be later combined to form posts.
  • Notes: a combination of ideas, taking shape but still rough around the edges.
  • Posts: “complete” tutorials / opinion pieces, may revisit them from time to time.
  • Featured: these are the posts I’m really happy with.

I’ve also written two series of posts: on understanding the maths behind deep learning and writing your own programming language

My best ideas, curated for you in a newsletter.

Enjoy early access to posts, before I make them public!

Check out previous issues!

By subscribing, you agree with Revue’s Terms of Service and Privacy Policy.

How do I get into Cambridge Computer Science?

Category: Snippet

07 September, 2021

4 min read

5 years ago, in 2016, I asked myself the same question. Here's briefly what I'd suggest, based on my personal experiences.

My Facebook Bootcamp Experience

Category: Note

01 September, 2021

5 min read

What joining Facebook as a new software engineer is like, including bootcamp, team selection and relocating to London

I've Started a YouTube Channel

Category: Note

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.

Adding Inheritance and Method Overriding to Our Language

Category: Post

25 January, 2021

7 min read

You can't have a proper Java-style object-oriented programming language without inheritance and overriding. We'll augment the type-checker and implement overriding using vtables in LLVM IR.

Generics - adding polymorphism to Bolt

Category: Post

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!

Write It and They Will (Eventually) Come

Category: Post

31 December, 2020

3 min read

A review of the blog in 2020. No, the blog hasn't taken off (yet) but that's fine - let me tell you why it's still a success!

Implementing Concurrency and our Runtime Library

Category: Post

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

Category: Post

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

Category: Note

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++

Category: Post

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!

Category: Post

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

Category: Post

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?

Category: Post

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.

How I wrote my own "proper" programming language

Category: Post

10 May, 2020

7 min read

No, this isn't one of those toy languages. In this series we'll cover objects, concurrency, generics and inheritance, amongst other more complex language features.

OCaml Testing and CI

Category: Post

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.

What it's REALLY like to intern at Facebook!

Category: Post

06 October, 2019

9 min read

Thinking of interning at Facebook? This post will give you a better insight of what it is like as well as some advice on how to do well in the internship!

The Ultimate Git Beginner Reference Guide

Category: Post

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!

Category: Post

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

Category: Post

17 September, 2018

6 min read

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

Debugging the Learning Curve

Category: Post

02 September, 2018

5 min read

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

Optimising Learning

Category: Post

01 September, 2018

5 min read

How we can make gradient descent even better.

Backpropagation

Category: Post

31 August, 2018

6 min read

The magic sauce behind neural networks - how they learn!

What is a neural network?

Category: Post

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