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.
As a Ruby developer you probably use tools like Sidekiq that rely on concurrency. But would you know how to build your own sidekiq, or add concurrency to an existing app? This article will open Ruby's concurrency toolbox and show you how each tool works. It shows you how to solve the same problem in multiple ways, so you can compare tools. And it looks at new tools that might possibly ship with future versions of ruby.