Let’s build a compiler!

Let’s build a super simple compiler!

In this series, I am going to show you how to build a compiler. This post is going to contain all the metadata for this series, and the next post onwards will explain all the concepts and stuff.

Why shoul…

Let’s build a super simple compiler!

In this series, I am going to show you how to build a compiler. This post is going to contain all the metadata for this series, and the next post onwards will explain all the concepts and stuff.



Why should I care?

  • There are tons of compilers around you, and many important concepts can be taken from them.
  • It’s a fun side project (my reason)
  • You might create a simple language which is faster to code in than javascript and save some time!



But they seem scary!

According to the super tiny compiler

Yes, they are. But that’s our fault (the people who write compilers), we’ve taken something that is reasonably straightforward and made it so scary that most think of it as this totally unapproachable thing that only the nerdiest of the nerds are able to understand.



Ok Ok, I’m in, what exactly are we building?

We are going to build a compiler (basically a function which takes a string as input). The compiler compiles english like syntax into javascript. So if we:

Had to… We would…
Declare a variable let the variable variableName be 12.

This may seem like nothing, but it is enough to show how a compiler works and its major parts. Also, I won’t stop there. I will add more syntax to make it more fully fledged.

That’s all for now, see you in the next part!


Print Share Comment Cite Upload Translate
APA
Siddharth | Sciencx (2024-03-28T16:01:14+00:00) » Let’s build a compiler!. Retrieved from https://www.scien.cx/2021/06/05/lets-build-a-compiler/.
MLA
" » Let’s build a compiler!." Siddharth | Sciencx - Saturday June 5, 2021, https://www.scien.cx/2021/06/05/lets-build-a-compiler/
HARVARD
Siddharth | Sciencx Saturday June 5, 2021 » Let’s build a compiler!., viewed 2024-03-28T16:01:14+00:00,<https://www.scien.cx/2021/06/05/lets-build-a-compiler/>
VANCOUVER
Siddharth | Sciencx - » Let’s build a compiler!. [Internet]. [Accessed 2024-03-28T16:01:14+00:00]. Available from: https://www.scien.cx/2021/06/05/lets-build-a-compiler/
CHICAGO
" » Let’s build a compiler!." Siddharth | Sciencx - Accessed 2024-03-28T16:01:14+00:00. https://www.scien.cx/2021/06/05/lets-build-a-compiler/
IEEE
" » Let’s build a compiler!." Siddharth | Sciencx [Online]. Available: https://www.scien.cx/2021/06/05/lets-build-a-compiler/. [Accessed: 2024-03-28T16:01:14+00:00]
rf:citation
» Let’s build a compiler! | Siddharth | Sciencx | https://www.scien.cx/2021/06/05/lets-build-a-compiler/ | 2024-03-28T16:01:14+00:00
https://github.com/addpipe/simple-recorderjs-demo