Building a New Programming Language in Ruby: Wrapping Up
The conclusion to Alex Braha Stoll's 5-part series on how to build a toy programming language in Ruby.
Alex is a software developer that cannot get tired of attempting to write the next line of code at least a little better than the one before it. In his free time, he likes to study and practice Photography.
The conclusion to Alex Braha Stoll's 5-part series on how to build a toy programming language in Ruby.
This article is the next in our series about building a toy programming language in Ruby. Alex Braha Stoll shows us how to implement the interpreter for function definitions, variable declarations, and more.
In earlier installments of this series, Alex Stoll guided us through creating a lexer and a parser. These translated the human-readable source code into data structures. In this article, he begins work on the interpreter - the bit that actually runs our code!
Understanding parsers is like seeing the matrix. You start to understand the tree-like structure of your code. You begin to realize that so many language features are just syntactic sugar concealing a simple core. In this article, Alex Braha Stoll will guide us through the world of parsers. He'll explain basic concepts, then use Ruby to implement a simple parser for his toy language, Stoffle.
Lexers are magical. They take your messy, hand-typed, human text, and convert it into a clean data structure that the computer can process. Every time you run a ruby program, use structured search or type in a date by hand, you'll find a lexer hard at work. In this article, Alex Braha Stoll pulls back the curtain to show us how lexers work and how to implement one for a simple programming language.
Few projects are as enticing or as rewarding as creating your own programming language. It's impractical, sure. But as an exercise, it strengthens muscles that most of us don't get to use very often and makes us better all-around developers. In this article — the first in a series — Alex Braha Stoll shows us how to get started building our own toy language and interpreter from scratch using Ruby.
Do you know how to add concurrency to a Ruby app? Let's open the Ruby concurrency toolbox and learn how each tool works.