[PDF/ePUB] Writing A Compiler In Go

Writing A Compiler In Go image

DOWNLOAD PDF

Writing A Compiler In Go - Version 1.2 - Find out more at https://compilerbook.comThis is the sequel to Writing An Interpreter In Go. We're picking up right where we left off and write a compiler and a virtual machine for Monkey.Runnable and tested code front and center, built from the ground up, step by step — just like before. But this time, we're going to define bytecode, compile Monkey and execute it in our very own virtual machine. It's the next step in Monkey's evolution. It's the sequel to … a programming language.Writing A Compiler In Go is the sequel to Writing An Interpreter In Go.It starts right where the first one stopped, with a fully-working, fully-tested Monkey interpreter in hand, connecting both books seamlessly, ready to build a compiler and a virtual machine for Monkey. In this book, we use the codebase (included in the book!) from the first part and extend it. We take the lexer, the parser, the AST, the REPL and the object system and use them to build a new, faster implementation of Monkey, right next to the tree-walking evaluator we built in the first book.The approach is unchanged, too. Working, tested code is the focus, we build everything from scratch, do baby steps, write tests firsts, use no 3rd-party-libraries and see and understand how all the pieces fit together.It's a continuation in prose and in code. Do you need to read the first part before this one? If you're okay with treating the code from the first book as black box, then no. But that's not what these books are about; they're about opening up black boxes, looking inside and shining a light. You'll have the best understanding of where we're going in this book, if you know where we started.Learn how to write a compiler and a virtual machineOur main goal in in this book is to evolve Monkey. We change its architecture and turn it into a bytecode compiler and virtual machine.We'll take the lexer, the parser, the AST and the object system we wrote in the first book and use them to build our own Monkey compiler and virtual machine … from scratch! We'll build them side-by-side so that we'll always have a running system we can steadily evolve.What we end up with is not only much closer to the programming languages we use every day, giving us a better understanding of how they work, but also 3x faster. And that's without explicitly aiming for performance.Here's what we'll do:We define our own bytecode instructions, specifying their operands and their encoding. Along the way, we also build a mini-disassembler for them.We write a compiler that takes in a Monkey AST and turns it into bytecode by emitting instructionsAt the same time we build a stack-based virtual machine that executes the bytecode in its main loopWe'll learn a lot about computers, how they work, what machine code and opcodes are, what the stack is and how to work with stack pointers and frame pointers, what it means to define a calling convention, and much more.We alsobuild a symbol table and a constant pooldo stack arithmeticgenerate jump instructionsbuild frames into our VM to execute functions with local bindings and arguments!add built-in functions to the VMget real closures working in the virtual machine and learn why closure-compilation is so tricky

✔ Author(s):
✔ Title: Writing A Compiler In Go
✔ Rating : 4.9 out of 5 base on (79 reviews)
✔ ISBN-10: 398201610X
✔ ISBN-13: 9783982016108
✔ Language: English
✔ Format ebook: PDF, EPUB, Kindle, Audio, HTML and MOBI
✔ Device compatibles: Android, iOS, PC and Amazon Kindle

Readers' opinions about Writing A Compiler In Go by Thorsten Ball

/
Thea Bell
The depth of character development was astounding. I felt like I knew each person intimately, understanding their hopes, fears, and dreams. It made the story so much more meaningful.
/
Sarah Franklin
I couldn't stop raving about this book to my friends and family. It's a literary gem that deserves all the praise. I can't wait to dive into more works by this talented author.
/
Polly Hurlbutt
The rich historical context of the book added a layer of depth that I found fascinating. It was like stepping back in time and experiencing history firsthand.


Super Easy Keyboard for Kids. Learn How to Transpose: Learn to Play 22 Simple Songs in Different Keys (Super Simple Songs for Keyboard or Piano), Screenprinting, Conundrum, Borderlands / La Frontera: The New Mestiza: The Critical Edition, Sorry I’m Late, I Didn’t Want to Come: One Introvert’s Year of Saying Yes, Mieruko-chan, Vol. 8 (Volume 8) (Mieruko-chan, 8), Financial Accounting: Tools for Business Decision Making, 9e WileyPLUS NextGen Card with Loose-Leaf Print Companion Set, Honeysuckle Season, Anxious Attachment Recovery: Become Confident & Secure in Your Relationships, Discover the Different Attachment Styles & Start Your Healing Journey, Readings in American Politics: Analysis and Perspectives, Click the button to get Writing A Compiler In Go pdf new book ... Click to read / download Writing A Compiler In Go Thorsten Ball PDF ... This site currently has over a thousand free books available for download in various formats Writing A Compiler In Go best book ... Download ebooks Writing A Compiler In Go Thorsten Ball pdf free ... Click the Download or Read Online button Writing A Compiler In Go Thorsten Ball pdf free download ... Writing A Compiler In Go full download ... Writing A Compiler In Go epub downloads ... [download] book Writing A Compiler In Go format PDF ... Writing A Compiler In Go Thorsten Ball online ... Writing A Compiler In Go book online for free ...