Crafting Interpreters - Progress 2018-11-04

Tags:
By Max Woerner Chase

As of this writing, I'm most of the way through Chapter 8, stopping just before actually implementing blocks.

Honestly, the biggest points of confusion for me were that I never stripped my "challenge" code out, so the syntax of the language I'm developing has some capabilities that aren't in the book. I made the call to hold the values inside "cells" instead of storing them directly, because checking tables for false and nil is kind of fiddly in Lua, so it's easier to wrap them.

Right now, I'm reading ahead because it's late and I don't want to touch the code. Looking at control flow, I see there's going to be C-style loops, which... does Java have those? Does JavaScript have those? Does Haxe? I'm trying to figure out if I have any point of reference for those things. Like, yeah, they're syntactic sugar, but they're not that sugary? I'd rather duplicate Lua's paradigm, with only numeric for to start with, and iterator form later. Although, there are probably a lot of things I'd like to tinker with.

One thing I've wanted to try in PL stuff is having an operator that applies to a function, an unevaluated expression, and a block, or something along those lines, with the idea that this would allow expressing control flow as library functions with syntactic sugar. Alternatively, a syntax that would support calling functions in that way.

For now, I'm reading ahead, because I want to see what the bytecode interpreter is like, and get some idea of which language I want it to be in. I'll try to get through reading about classes tomorrow, look at the next section, then circle back to chapter 8. For now, it's late.


Oh, hey, I stopped doing the horizontally ruled section dividing stuff for no compelling reason. I'd like to bring those back, but I'm sleepy right now.

So, I'll just say that next time, I'll look back over this week.