8 years ago
p3k dots

Making a Language with JavaScript.

Programming language implementations vary wildly, but the steps are roughly as follows:

  • Parse source code text into abstract syntax tree (AST) such as JSON
  • (Optional) Static analysis of AST to report warnings and errors
  • Depending on whether you want a compiler or an interpreter:
    • Compile to executable, bytecode, JS, etc. OR
    • Evaluate the AST to run the program

Relevant: What programming language should you learn first? ʇdıɹɔsɐʌɐɾ :ɹǝʍsuɐ