fools-pyrite

computer toucher; RPG enjoyer


Last year around this time I started writing a toy programming language, and stopped within about a month. This year I picked it back up and have been writing it in much smaller components (eg I have two IRs instead of going basically right from the parser -> backend) and it’s been way more pleasant!

Excited to share once I’ve made a little more progress, not excited to name it though


You must log in to comment.

in reply to @fools-pyrite's post:

I can’t recommend Crafting Interpreters enough; it really takes you through the process of writing a tiny PL.

In a general sense there’s not as much magic to it as one might think: turn an input text into a tree-like data structure (eg 1 + 2 would be represented as the node “+” with the children 1 and 2), manipulate that data structure if you want, and then either…

  1. Walk the tree and execute the code directly. This isn’t usually done in “real” projects but it’s intuitive and good for beginning
  2. Or convert your tree to some executable format (“draw the rest of the owl” if you will). There are lots of options here, and you can go pretty low or high level depending on your preference

Compilers are some of the purest expressions of software to me: they take some input, run various interesting algorithms, and produce some output. That’s what I like about them as a hobby project; they’re logically “clean” in a sense that business software or even video games don’t get to be.

Ty for the link and the high level overview!! I've started reading Crafting Interpreters and it's def up my alley
I also find it v fun how the idea of generating trees to parse the meaning of a statement showed up in a lot of my linguistics classes too - kinda makes me wonder if there was some academic cross-pollination somewhere down the line haha