This Week in Iridium - #3

Summary of what happened in the third week

VM Changes Fixed a bug with some of the opcodes being interpretered as an incorrect one that was one Opcode higher numerically Fixed a bug with the run() function that was causing the execution loop to exit early Added in basic heap memory Started on an Assembler; added directives and segments to the assembler Started defining a bytecode format Website Changes Every tutorial series now has a Previous and Next link at the top and bottom to make it easier to navigate

This Week in Iridium - #4

Summary of what happened in the fourth week

VM Changes Latest version in GitLab fixes all clippy complaints Two-pass assembler is working fairly well, planning to start adding more features directly to the VM now Website Changes Redesigned website to hopefully make navigation easier Made some spaces for non-Iridium projects Old links should still work fine, and will take you to the page at the new URL structure

So You Want to Build a Language VM - Part 12 - Strings

Adds in strings to our VM

What are Strings?

This may shock you, but they are a bit more complicated than they might seem. Since a computer cares about bytes, it has no concept of the letter s, ! or any other letter. These having meaning to us humans. But we want our users to be able to give input and read output without having to do it all in hex. The solution is to use some sort of character encoding. This maps a particular character to a number. You’ll hear two common encodings mentioned these days: ASCII and UTF. I’m not going to go into an exhaustive history of them; for that, check out this article for ASCII and this article for UTF-8. I will cover enough for us to put in support for strings, though.

So You Want to Build a Language VM - Part 10 - Assembler 3: Assemble Harder

Teaches our assembler to recognize more instruction forms

Improving the Assembler

Our assembler right now can recognize one opcode, load. We need to teach it to recognize all the rest. There’s a couple ways we can do that:

  1. We can write a parser for each opcode

  2. We can write a parser that recognizes the letters a-z and then check if they are a valid Opcode.

Let’s go with option #2, since it will require much less copy-paste. It also gives us an excuse to implement From<CompleteStr<_>> for our opcodes! == The From<&str> Trait In instruction.rs, below the block where we implemented From<u8>, put this:

This Week in Iridium - #2

Summary of what happened with Iridium in the second week.

VM Changes Fixed a numbering bug reported by dancing-koala where the opcodes went from 4 → 6 Fixed some inconsistencies in the part 8 tutorial where I had left Op as Opcode Website Changes I’m now posting all the tutorials on Medium for those who like to read them there. You can find them at: https://medium.com/iridium-vm. Experimenting with ads to help offset hosting costs (sorry, I’ll try to put them in non-annoying places)