[Compiler Construction] Control Flow Graph, Liveness Analysis, Dataflow Analysis and Interference Graph, Implemented in OCaml

I am super busy, but I want to spend some time talking about how to write a compiler in ocaml that has liveness analysis, and can generate interference graph from CFG and liveness analysis, which is fundamental to doing correct, if not efficient, register allocation.

PeterYaoNYU/CompilerInOCaml

A compiler for a ML-ish Languange, with a ML->Scheme->C->CFG->MIPS Pipeline, Register Allocation and Garbage Collection.

The Code can be found under the folder ps7, if not restructured after the writing of this post.

This is part of the NYU graduate level capstone project, with Prof. Joseph Tassarotti.

Read more

[Compiler Construction in Ocaml] Hindley-Milner Type Inference System Implementation

I want to spend some time talking about implementing Hindley-Milner type inference system in Ocaml for a ML-ish langauge. The code is available at my Github, under ps6/mlish_type_check.ml.

PeterYaoNYU/CompilerInOCaml

A compiler for a C-ish language, implemeted in OCaml

This is part of the project for NYU graduate level capstone course by Prof. Joseph Tassarotti.

Read more

[Database] Implementation of an Entendible Hash Index

This blog documents how I went about implementing an exntendible hash index for a database, from scratch in modern C++. Hash table sits in the core of many ascpects of a database, from building index for fast lookup to effecient implementation of the hash join executor.

Per CMU policy, Bustub solution should not be made public. Hence, only code snippets and basic logic are shown here. If you need to see the code for a specific reason, email me: yy4108@nyu.edu.

Read more

[Consensus] Raft from Scratch: Leader Election

In this series, I will try to implement the Raft protocol in Golang, using the RPC as a building block. Source code available at https://github.com/PeterYaoNYU/mit-distributed-sys.

PeterYaoNYU/mit-distributed-sys

Distributed System Related Projects in GO: MapReduce, Raft, KV-Storage
Read more

Implementing a MapReduce Framework with Golang RPC from scratch

I just finished one small piece of work this morning, a MapReduce framework, implemented wit Golang RPC. Before I forget everything, I will document the design and code here. For original source code, it is available at https://github.com/PeterYaoNYU/mit-distributed-sys .

PeterYaoNYU/mit-distributed-sys

Distributed System Related Projects in GO: MapReduce, Raft, KV-Storage
Read more

CMU15-213 Attack Lab

It’s been a while since I wrote posts about CMU’s renowned system course 15-213. Last month, I was primarily devoted to my research on SmartNICs and ML for failure detection, and traveling.

Let’s begin phase by phase.

Read more

Bomb Lab CMU 15-213

May 18th, 2023.

I have just finished all my final yesterday. Farewell my sophomore year! After playing the new Zelda: Tears of the Kingdom for the whole evening, which was released just a few days ago (and without any doubt, the best game ever made in human history), I decided to do something a little bit more meaningful and fulfilling.

Read more

Higher-order Functions

A higher order function is technically any function that takes another function as an argument.