Chapter 12: Generating Bytecode

In this chapter, we continue with code generation, taking the intermediate code from Chapter 9, Intermediate Code Generation, and generating bytecode from it. When you translate from intermediate code into a format that will run, you are generating final code. Conventionally this happens at compile time, but it could occur later—at link time, load time, or runtime. We will generate bytecode in the usual way at compile time. This chapter and the following chapter on generating native code present you with two forms of final code that you can choose between.

Translation from intermediate code to bytecode is performed by walking through a list of intermediate instructions, translating each intermediate code instruction ...

Get Build Your Own Programming Language 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.