December 10th, 2003

  • evan

linguistic side effects programming language

I spent a bunch more time last night reading the cognition book, and then I returned to this linguistic side effects paper.
I’ve been wanting to try to implement a language that involved some sort of continuations, so I just sat down and tried the one from the paper. Just to make it extra-hard, I implemented it using small-step, which also means I can print the entire program out as it transforms itself to its result. I’m pretty proud of the result--I’ve never really used lex and yacc for a real project yet. And I managed to verify his examples, something I was often even unable to do on my whiteboard because I kept getting confused (this shift stuff really turns code over on its head).

I’m a little tired of typing, so I’ll just include my sample program’s output below. (There's also a bit of linguistic quantification output!) There’s two layers of parsing, which means that you can intermix normal text and expressions and it interprets the expressions inline. So all of the text below is from the sample program’s code, not in the interpreter.
Collapse )