Overview

Before we get started discussing why and how we do specific things, we need to come up with a super high level overview of what we want our language to look like.

We should start simple, and evolve our language as we better understand how to build our compiler.

new hello = 'world'
print hello

Above, we have a variable assignment, and then a statement to print it to stdout. This will be the basis of our language.

The equivalent in Javascript would look like:

const hello = "world"
console.log(hello)

DSLs and languages are typically processed in three distinct phases:

  1. Lexing
  2. Parsing
  3. Generation

The Overview section will go over these at a high level, while the following chapters will deep-dive into each one, where we will discuss the how and whys.