Answers

The following answers sketch some possible solutions to the questions at the end of each chapter; these are provided for your reflection.

Chapter 1

  1. It is much easier to generate C code than to generate machine code, but the resulting code may be larger or slower than native code, causing a performance cost. A transpiler depends on an underlying compiler that may be a bit of a moving target, but if the underlying compiler is highly portable, the transpiler will be far more portable than a compiler that generates native code.
  2. Lexical, syntax, and semantic analysis, followed by intermediate and final code generation.
  3. Classic pain points include input/output being overly difficult, especially on new kinds of hardware; concurrency; and making ...

Get Build Your Own Programming Language - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.