Company
Date Published
Author
Michael Carroll
Word count
3776
Language
English
Hacker News points
None

Summary

The final installment in the Ohm series introduces the completion of the Meow programming language by adding looping constructs and real function calls, achieving a full language implementation in 180 lines of code. Building on previous posts that covered parsing numbers, constructing expression trees, and handling conditionals, this entry explains how to implement a "while" loop, line-based comments, string literals, and function calls, including user-defined functions, using Ohm's grammar and semantic actions. The blog illustrates the process of creating a "while" loop and function calls, showing how Meow can now execute real code with conditionals, loops, and functions. It discusses the intricacies of scope management for user-defined functions and suggests further possibilities for expanding the language, such as experimenting with new syntax or embedding Meow in webpages, highlighting the flexibility and power of Ohm in language creation.