Felix Angell

Read this first

An introduction to LLVM in Go

Hacker News Dicussion
Article discussion on Hacker News

 Translations

Some translations of this article:

  • Japanese
  • Russian

 Introduction

LLVM is an infrastructure for creating compilers. It was initially created by Chris Lattner in 2000, and released in 2003. Since then it has evolved into an umbrella project that has a wide array of tools such as the LLVM Linker lld, LLVM Debugger lldb, and so on.

The banner feature of LLVM is its intermediate representation, commonly referred to as the LLVM IR. The idea of LLVM is that you can compile down to this IR, and then this IR can be JIT compiled, interpreted, or compiled into native assembly for the machine it’s running on. The primary target of this IR is compilers, in fact there are many compilers out there that use LLVM: clang and clang++ for C and C++ respectively, ldc2 for the D programming language, the Rust language, Swift, etc...

Continue reading →


Virtual machine in C

Hacker News Dicussion
Article discussion on Hacker News

 Introduction

Here’s the GitHub to show what we’ll be making. You can also compare your code to this repository in case you have any errors: GitHub Repository

I felt like writing an article about building your very own virtual machine in the C programming language. I love working on lower level applications e.g. compilers, interpreters, parsers, virtual machines, etc. So I thought I’d write this article as learning how virtual machines work is a great way to introduce yourself into the general realm of lower level programming!

 Prerequisites & Notices

There are a few things that you need before we can continue:

  • GCC/Clang/.. — I’m using clang, but you can use any modern compiler;
  • Text Editor — I would suggest a text editor over an IDE (when writing C), I’ll be using Emacs;
  • Basic programming knowledge — Just the basics...

Continue reading →