Skip to content

C++ implementation of the Tree-Walk Interpreter inspired by the book Crafting Interpreters by Robert Nystrom

License

Notifications You must be signed in to change notification settings

bhanuprakasheagala/litecode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

litecode

C++ implementation of the Tree-Walk Interpreter inspired by the book Crafting Interpreters by Robert Nystrom.

Crafting Interpreters Book

"Crafting Interpreters" is a book written by Robert Nystrom that explores the development of interpreters for programming languages. The book is divided into two parts: the first part focuses on building a simple interpreter for a toy programming language called "Lox," while the second part delves into more advanced topics such as bytecode, optimization, and garbage collection.

Throughout the book, Nystrom takes a hands-on approach, guiding readers through the process of designing and implementing an interpreter from scratch. He covers fundamental concepts such as lexical analysis, parsing, abstract syntax trees, and semantic analysis, gradually building up to more complex topics.

One of the notable features of "Crafting Interpreters" is its use of Java for implementation, making it accessible to readers with a basic understanding of the language. However, the principles discussed in the book are applicable to a wide range of programming languages and platforms.

Why to Write the same in C++

This is an attempt to write the same using C++ language, optimizing as much as possible. So, why rewrite it in C++? Simply put, it's for learning and fun! While the original book provides a fantastic foundation in interpreter construction using Java, embarking on a rewrite in C++ offers several advantages:

Learning Opportunity: Working on the same project in a different language is an excellent way to deepen my understanding of both the project itself and the basic concepts behind the programming language implementation. And to gain insights into language-specific features, idioms, and performance considerations.

Exploration of Language Differences: C++ and Java have distinct characteristics, paradigms, and performance profiles. By porting the project to C++, I'll definitely encounter unique challenges and opportunities for optimization and efficiency that may not have been present in the Java version.

Having Fun!!: Let's face it—programming is about more than just building practical applications. It's about the joy of creation, the thrill of problem-solving, and the satisfaction of seeing your ideas come to life. Rewriting "Crafting Interpreters" in C++ is an exciting endeavor that promises to be both educational and enjoyable.

I'm deeply passionate about coding and building projects at System level programming. It's not just about learning; it's about having a blast while delving into the world of technology. Every project is a thrilling adventure where I get to experiment, learn, and push the boundaries of my learning capabilities.

About

C++ implementation of the Tree-Walk Interpreter inspired by the book Crafting Interpreters by Robert Nystrom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages