Series: Live Code: LLVM Tutorial Walkthrough

1. What is LLVM? I Tell Huiqi About It - Part 1

Jun 20th 202017:03

I've been knee deep in LLVM and in this video I talk to Huiqi about it. LLVM is a compiler infrastructure / framework. It contains a core library which you can use to build your own compiler.

Watch “What is LLVM? I Tell Huiqi About It - Part 1”

2. What is LLVM? I Tell Huiqi About It. Part 2

Jun 20th 202018:45

This is part 2 of 2 of a conversation I had with Huiqi Zhou where I tell her about LLVM and just can't stop talking. In this episode I show some LLVM IR code examples and explain SSA - Static Single Assignment. LLVM is an open source compiler infrastructure / framework. It contains a state of the art C compiler called clang, and if you want to make your own compiler, it can provide you with building blocks that can make your work easier.

Watch “What is LLVM? I Tell Huiqi About It. Part 2”

3. LLVM Tutorial #1: Introduction

Jun 12th 202019:25

I am learning LLVM. In this series I am planning to walk through the introductory tutorial called Kaleidoscope at https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/. Let's see how it goes.

Watch “LLVM Tutorial #1: Introduction”

4. LLVM Tutorial #2: Lexer

Jun 12th 202029:41

I am learning LLVM. In this series I am planning to walk through the introductory tutorial called Kaleidoscope at https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/. Let's see how it goes. In this episode we implement an simple lexer.

Watch “LLVM Tutorial #2: Lexer”

5. LLVM Tutorial #3: AST Nodes

Jun 12th 202025:55

I am learning LLVM. In this series I am planning to walk through the introductory tutorial called Kaleidoscope at https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/. In the last episode we finished making the lexer which supplies us with tokens. This time we start working on the parser that generates the AST. Beginning with creating classes for the various types of AST nodes.

Watch “LLVM Tutorial #3: AST Nodes”

6. LLVM Tutorial #4: Recursive Descent Parser

Jun 12th 202028:34

I am learning LLVM. In this series I am planning to walk through the introductory tutorial called Kaleidoscope at https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/. In the last episode we defined the AST Node classes that we would need. This time we'll make the recursive descent parser.

Watch “LLVM Tutorial #4: Recursive Descent Parser”

7. LLVM Tutorial #5: Operator Precedence Parsing

Jun 12th 202025:18

I am learning LLVM. In this series I am planning to walk through the introductory tutorial called Kaleidoscope at https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/. In the last episode we wrote code to parse identifiers, call expressions and numbers, this time we'll parse binary expressions and handle operator precedence.

Watch “LLVM Tutorial #5: Operator Precedence Parsing”

8. LLVM Tutorial#6: Compilation Trouble

Jun 12th 202031:37

I am learning LLVM. In this series I am planning to walk through the introductory tutorial called Kaleidoscope at https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/. In the last episode we implemented operator precedence. In this one, we attempt to finish writing the parser but ran into some problems compiling the program.

Watch “LLVM Tutorial#6: Compilation Trouble”

9. LLVM Tutorial #7: What is SSA?

Jun 12th 202025:37

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. In the last part, I struggled to compile the parser code. This time I got the fix and I start chapter 3 with a short explanation of SSA (Static Single Assignment Form).

Watch “LLVM Tutorial #7: What is SSA?”

10. LLVM Tutorial #8: CodeGen

Jun 12th 202028:18

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we talked briefly about SSA (Static Single Assignment Form). This time we actually write some code to generate LLVM IR.

Watch “LLVM Tutorial #8: CodeGen”

11. LLVM Tutorial #9: CodeGen for Functions

Jun 12th 202041:17

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we wrote some code to generate LLVM IR code for the first time. This time we continue on generating IR code for function definitions.

Watch “LLVM Tutorial #9: CodeGen for Functions”

12. LLVM Tutorial #10: Getting Out of Trouble

Jun 12th 202035:55

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we finished writing code to generate LLVM IR code, but we hit a snag. In this episode I put my debugging skills to work and get out of trouble.

Watch “LLVM Tutorial #10: Getting Out of Trouble”

13. LLVM Tutorial #11: Playing with REPL

Jun 12th 202010:48

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we had a long grueling debugging session. This episode is a shorter session where I enjoy the fruits of that labor and play with the REPL a bit, and also talk a bit about LLVM.

Watch “LLVM Tutorial #11: Playing with REPL”

14. LLVM Tutorial #12: Optimizers

Jun 12th 202033:55

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we completed chapter 3 where we generated LLVM IR code from the AST. This time we start chapter 4 where we'll be talking about optimizers within LLVM.

Watch “LLVM Tutorial #12: Optimizers”

15. LLVM Tutorial #13: Optimizers Work

Jun 12th 202008:04

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last episode we started work on adding optimizers but had some trouble getting the code to compile. This time I found the fix and we are able to verify that the optimizers are working.

Watch “LLVM Tutorial #13: Optimizers Work”

16. LLVM Tutorial #14: JIT

Jun 12th 202036:55

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we got LLVM optimizers working. This time we make a "JIT". What is a JIT? Watch and find out.

Watch “LLVM Tutorial #14: JIT”

17. LLVM Tutorial #15: Finishing "The JIT"

Jun 12th 202024:24

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we made the JIT and it worked!! This time we extend it to be able to redefined functions.

Watch “LLVM Tutorial #15: Finishing "The JIT"”

18. LLVM Tutorial #16: If Expression Parser

Jun 20th 202030:40

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we made a "JIT"! This time we start implementing if statements, starting with the lexer and the parser.

Watch “LLVM Tutorial #16: If Expression Parser”

19. LLVM Tutorial #17: The Φ (Phi) Function

Jun 20th 202024:55

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we wrote the lexer and the parser for the if statement. This time, we talk more about SSA, and more specifically, about the Φ (Phi) function.

Watch “LLVM Tutorial #17: The Φ (Phi) Function”

20. LLVM Tutorial #18: CodeGen For If Statement

Jun 20th 202036:19

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we talked about the Φ (Phi) function. This time we continue on with the code and implement the code generation for the if statement as prescribed by the tutorial.

Watch “LLVM Tutorial #18: CodeGen For If Statement”

21. LLVM Tutorial #19: "If" It Can Work

Jun 20th 202019:44

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we wrote finished up writing the code for implementing the if statement, but hit a snag at the end. This time we go into full debug mode and try to get it working. Can it work? As a bonus, we also explain a little about the formulation of SSA form in the the output code, and why it isn't non-trivial in our case.

Watch “LLVM Tutorial #19: "If" It Can Work”

22. LLVM Tutorial #20: For loops!

Oct 20th 202031:14

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we finished implementing if statements. This time we continue on to the second half of chapter 5 and implement the parser for the for loop expression.

Watch “LLVM Tutorial #20: For loops!”

23. LLVM Tutorial #21: "For" Expr Codegen

Oct 20th 202040:10

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we implemented the parser for the for loop expression, and this time we'll implement its code generator.

Watch “LLVM Tutorial #21: "For" Expr Codegen”

24. LLVM Tutorial #22: Custom Operators

Oct 22nd 202027:07

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we finished implementing for loops in chapter 5. This time we start 6 chapter where we'll implement custom operators in the language.

Watch “LLVM Tutorial #22: Custom Operators”

25. LLVM Tutorial #23: Codegen for Binary Operators

Oct 22nd 202022:16

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we updated the parser for binary operators to support custom operators. This time we'll work on the code generator part.

Watch “LLVM Tutorial #23: Codegen for Binary Operators”

26. LLVM Tutorial #24: Unary Operators

Oct 22nd 202022:34

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we updated the code for the custom binary operators, this time we'll try to finish up the custom unary operators.

Watch “LLVM Tutorial #24: Unary Operators”

27. LLVM Tutorial #25: Mandelbrot?

Oct 22nd 202042:55

In this series I walkthrough the LLVM "Kaleidoscope" Tutorial, where you follow step by step to create your first programming language frontend using LLVM as the backend. Last time we finished up the code for custom operators but ran into some bugs. This time we spend some time debugging and make an encounter our most beloved mathematician :)

Watch “LLVM Tutorial #25: Mandelbrot?”