Design your own language in C# 9: a tutorial series

Programming languages are some of our fundamental tools, and many different languages for many different purposes. In this tutorial series, you will learn how to design and implement your own language, starting out from simple expressions and their evaluation, later adding variables, functions and lambda expressions. You may ask yourself why… why would you create your own languages? why not use C#, python, JavaScript or whatever? you are probably right, for most purposes your favorite language will do fine. But sometimes, the solution is not just a program, but a language along with an interpreter or compiler. The language in this tutorial is designed for my own need: a language for relatively simple mathematical problems, such as calculating interest rates with many varying parameters. Problems you would normally solve using spreadsheets, calc, or when forced, some graphical calculator program. Actually, I strive for a new take on the terminal calculator apcalc or calc, but with variables, functions, lambdas, and preferably Date and Time-calculations as well – if it will fit the language

Part 1 is about lexical analysis, or scanning, and is already available

Part 2: Parsing — is on its way

Leave a Comment