Summary
In this chapter, you learned the basics of preprocessors and transpilers. While a preprocessor can be thought of as a transformation that alters code slightly from its input to its output, a transpiler turns source code from one high-level language into another high-level language that is substantially different.
For any new programming language project that you undertake, you may want to first consider the implementation techniques shown in this chapter, either to produce a prototype or as your primary implementation. If you write a transpiler, you will get things working fast, and you will be able to try it out and determine whether your language semantics work the way that you intend. Later on, you may want to write a bytecode interpreter or native code implementation, but even if you do, having the transpiler around will be helpful. You can reuse its frontend code, while switching the backend over to the intermediate code generator from Chapter 9, followed by one of...