So You Want to Build a Language VM — Part 12
What are Strings?
Right now, we have one place to store data: registers. These are great, but we only have 32 of them, and they only store i32s. What if we want to store, say, strings…
Our assembler right now can recognize one opcode, load. We need to teach it to recognize all the…
load
We’ve written basic parsers. Now we can take a step up on the abstraction ladder and create a parser that…
Our current REPL doesn’t do a ton, so let’s fix that. In this post, we’ll be adding some commands to look at the…
We could torture ourselves by writing all our programs in hex, and if that’s your thing, this section is…
REPL stands for Read, Evaluate, and Print Loop. It is also referred to as the interactive interpreter for a language. For example, if you open up Terminal or iTerm, we can look at Python’s REPL:
REPL
Hey, you’ve made it this far! Congrats! I wish I could say we’re near the end to give you some hope, but, well…sorry. =)
Right now, our VM can do one thing: halt. An important feature to be sure, but we should probably add in more opcodes to do things like, oh, load, add, multiple, etc.
When we last left our intrepid reader (that’s you), they had gotten to the point of writing an opcode. Let’s pick up from there.