Archive for June, 2015
Making a toy programming language in Lua, part 4
This is part four of my series on writing a toy programming language using LPeg. You should start with part one here.
Last time, we used the new AST generation to make conditionals and loops. Now, we’re going to add the ability to define functions, complete with lexical scoping.
Making a toy programming language in Lua, part 3
This is part three of my series on writing a toy programming language using LPeg. You should start with part one here.
Last time, we added variables and arrays to the language. Assigning to arrays was starting to strain our design some, so this time we’ll refactor it a lot, and add two features that would be impossible without that refactoring: conditional statements and loops.
Making a toy programming language in Lua, part 2
This is part two of my series on writing a toy programming language using LPeg. You should first read part one here.
Last time, we made an interpreter for a simple calculator: it would read in mathematical expressions and evaluate them, printing the result. This time, we’re going to add two new features: variables and arrays. First though, we’ll refactor our parser some.
Read the rest of this entry »