Jumping Back and Forth · Crafting Interpreters
The order that our mind imagines is like a net, or like a ladder, built to attain something. But afterward you must throw the ladder away, because you discover that, even if it was useful, it was meaningless. Umberto Eco, The Name of the Rose It’s taken a while to get here, but we’re finally ready to add control flow to our virtual machine. In the tree-walk interpreter we built for jlox, we implemented Lox’s control flow in terms of Java’s. To execute a Lox if statement, we used a Java if statement to run the chosen branch. That works, but isn’t entirely satisfying. By what magic does the JVM itself or a native CPU implement if statements? Now that we have our own bytecode VM to hack on, we can answer that. When we talk about “control flow”, what are we referring to? By “flow” we mean the way execution moves through the text of the program. Almost like there is a little robot inside the computer wandering through our code, executing bits and pieces here and there. Flow is the path that
23 Jumping Back and Forth The order that our mind imagines is like a net, or like a ladder, built to attain something. But afterward you must throw the ladder away, because you discover that, even if it was useful, it was meaningless. Umberto Eco, The Name of the Rose It's taken a while to get here, but we're finally ready to add control flow to our virtual machine. In the tree-walk interpreter we built for jlox, we implemented Lox's control flow in terms of Java's. To execute a Lox if statement, we used a Java if statement to run the chosen branch. That works, but isn't entirely satisfying. B
Explore this link on the map →related reading
- Control Flow · Crafting Interpreterscraftinginterpreters.com
- Control Flow - Circom 2 Documentationdocs.circom.io
- Control Flow - The Rust Programming Languagedoc.rust-lang.org
- Control Flow - The Rust Programming Languagerust-book.cs.brown.edu
- Program Structure :: Eloquent JavaScripteloquentjavascript.net
- A Bytecode Virtual Machine · Crafting Interpreterscraftinginterpreters.com
- Write your Own Virtual Machinejmeiners.com
- Notes on structured concurrency, or: Go statement considered harmful - njs blogvorpus.org
- Writing a C compiler in 500 lines of Pythonvgel.me
- how I think when I think about programming - alice mazalicemaz.com
- The Lox Language · Crafting Interpreterscraftinginterpreters.com
- Decide with ifeducative.io