-
Notifications
You must be signed in to change notification settings - Fork 15
Elements of Computing Systems Chapter 8
Murray and Paul kindly brought refreshments and snacks (I think we have a kitty now) to keep everyone energised.
There was some talk of looking at some of the side projects that people have been putting together between meetings, for example Chris's javascript HDL, but most people were keen to get on with implementing the exercises because we'd have a complete VM translator if we could implement label
, goto
, if-goto
, function
, return
and call
.
The specs that Tom wrote for the VM translator depend on Ruby 2.2 so there was a slight delay while Leo installed Ruby 2.2.2 locally (and was introduced to ruby-install and chruby along the way).
We began by looking at label
, goto
, and if-goto
because these seemed much simpler than functions and we could use BasicLoop and FibonacciSeries as an acceptance tests.
We implemented
There was some discussion about us prefixing '$' to labels when translating which was recommended by the book seemed ugly and unnecessary to some. This is looking forward to handling multiple files where we will need a way to identify labels from different files.
We tried to steer clear of too much refactoring during the meeting, to try to focus on more immediate progress, with the suggestion that if anyone wants to do this outside the meeting (and share the results) then that would be appreciated.
We then moved onto function
, call
and return
which are a little more involved in that between the three of them they take responsibility for recording the current frame on the stack and moving to a new one, and then back again at the end of the function. We spent sometime making sure we all understood exactly how the stack changed in these operations and found page 165's pseudo code for these helpful and also Tom's step by step guide to the calling convention.
We found implementing these more challenging, and still find ourselves both regularly being caught about by whether we have correctly dereferenced values or not and also running before we could walk but we got these working in this series of commits.
This didn't complete the project for chapter 8 because we still needed to handle multiple files but it seemed like a reasonable place to stop and we thought we might start the following meeting by completing this.
Thanks to Leo for his infinite patience channeling the group via vim.
- Home
- Documentation
- Choosing a Topic
- Shows & Tells
- Miscellaneous
- Opt Art
- Reinforcement Learning: An Introduction
- 10 Technical Papers Every Programmer Should Read (At Least Twice)
- 7 More Languages in 7 Weeks
- Lua, Day 1: The Call to Adventure
- Lua, Day 2: Tables All the Way Down
- Lua, Day 3
- Factor, Day 1: Stack On, Stack Off
- Factor, Day 2: Painting the Fence
- Factor, Day 3: Balancing on a Boat
- Elm, Day 1: Handling the Basics
- Elm, Day 2: The Elm Architecture
- Elm, Day 3: The Elm Architecture
- Elixir, Day 1: Laying a Great Foundation
- Elixir, Day 2: Controlling Mutations
- Elixir, Day 3: Spawning and Respawning
- Julia, Day 1: Resistance Is Futile
- Julia, Day 2: Getting Assimilated
- Julia, Day 3: Become One With Julia
- Minikanren, Days 1-3
- Minikanren, Einstein's Puzzle
- Idris Days 1-2
- Types and Programming Languages
- Chapter 1: Introduction
- Chapter 2: Mathematical Preliminaries
- Chapter 3: Untyped Arithmetic Expressions
- Chapter 4: An ML Implementation of Arithmetic Expressions
- Chapter 5: The Untyped Lambda-Calculus
- Chapters 6 & 7: De Bruijn Indices and an ML Implementation of the Lambda-Calculus
- Chapter 8: Typed Arithmetic Expressions
- Chapter 9: The Simply-Typed Lambda Calculus
- Chapter 10: An ML Implementation of Simple Types
- Chapter 11: Simple Extensions
- Chapter 11 Redux: Simple Extensions
- Chapter 13: References
- Chapter 14: Exceptions
- Chapter 15: Subtyping – Part 1
- Chapter 15: Subtyping – Part 2
- Chapter 16: The Metatheory of Subtyping
- Chapter 16: Implementation
- Chapter 18: Case Study: Imperative Objects
- Chapter 19: Case Study: Featherweight Java
- The New Turing Omnibus
- Errata
- Chapter 11: Search Trees
- Chapter 8: Random Numbers
- Chapter 35: Sequential Sorting
- Chapter 58: Predicate Calculus
- Chapter 27: Perceptrons
- Chapter 9: Mathematical Research
- Chapter 16: Genetic Algorithms
- Chapter 37: Public Key Cryptography
- Chapter 6: Game Trees
- Chapter 5: Gödel's Theorem
- Chapter 34: Satisfiability (also featuring: Sentient)
- Chapter 44: Cellular Automata
- Chapter 47: Storing Images
- Chapter 12: Error-Correcting Codes
- Chapter 32: The Fast Fourier Transform
- Chapter 36: Neural Networks That Learn
- Chapter 41: NP-Completeness
- Chapter 55: Iteration and Recursion
- Chapter 19: Computer Vision
- Chapter 61: Searching Strings
- Chapter 66: Church's Thesis
- Chapter 52: Text Compression
- Chapter 22: Minimum spanning tree
- Chapter 64: Logic Programming
- Chapter 60: Computer Viruses
- Show & Tell
- Elements of Computing Systems
- Archived pages