all repos — h3rald @ cf441f3aeb04e45dc263547c044bcc4ec66d845d

The sources of https://h3rald.com

#DecemberAdventure
Fabio Cevasco h3rald@h3rald.com
Wed, 18 Dec 2024 22:08:19 +0100
commit

cf441f3aeb04e45dc263547c044bcc4ec66d845d

parent

8c7c0e9b6b43e2f22ae4c4faef54ce3f708c93d6

1 files changed, 5 insertions(+), 0 deletions(-)

jump to
M contents/articles/december-adventure-2024.mdcontents/articles/december-adventure-2024.md

@@ -512,10 +512,15 @@

I managed to refine the bytecode generation algorithm a little bit *and* implement an interpreter that seems to work as expected! So, for now: + - I implemented variable-length code using the [LEB128](https://en.wikipedia.org/wiki/LEB128) algorithm for sizes, and this makes storing sizes and integers more compact. - Because this algorithm uses little-endian, I have decided to store all integers as little-endians. The resulting bytecode for yesterday's example is now more compact: + +![hbx example](/images/dec-adv-2024/hbx-example.png) + +And here's the breakdown: ```ruby # Header