Skip to content

Yet another C# implementation of an Interpreter for the Monkey language from "Writing an Interpreter in Go"

License

Notifications You must be signed in to change notification settings

MandalKoch/MonkeyInterpreter

Repository files navigation

Monkey Interpreter in C# - Learning by Doing

Project Overview:

Welcome to the Monkey Interpreter, a C# implementation inspired by the fantastic book "Writing an Interpreter in Go" by Thorsten Ball. This project empowers you to delve into the fascinating world of interpreter development using a familiar and widely adopted language.

Key Features:

Interprets Monkey code: Execute your Monkey scripts seamlessly within this C# implementation.
Faithful to the book: Adheres to Ball's guidance, ensuring consistency and alignment with the learning journey.
Open-source and collaborative: Welcome contributions and discussions to enhance the interpreter and support fellow learners.

Getting Started:

Prerequisites:
    .NET SDK >= 8 (https://dotnet.microsoft.com/download).
    A text editor or IDE of your choice (e.g., Visual Studio Code, Visual Studio).

Clone the Repository:
Bash

git clone https://github.com/MandalKoch/MonkeyInterpreter.git

Open in IDE:
Open the monkey-interpreter-csharp.sln solution file in your preferred IDE.

Build and Run:
    Select the desired build configuration (e.g., Debug or Release).
    Build the solution.
    Execute the MonkeyInterpreter executable located in the bin folder (e.g., bin/Debug/MonkeyInterpreter.exe).

Usage:

Interactive REPL: Launch the interpreter without arguments to enter an interactive Monkey REPL.
Run Scripts: Provide a Monkey script file path as an argument (e.g., MonkeyInterpreter.exe your_script.mon).

Credits and Learning Resources:

Thorsten Ball: All credit for the original concept and book goes to Thorsten Ball. Thank you for sharing your knowledge!
Official Resource: Explore the book's website for deeper learning: https://interpreterbook.com/

Enjoy the Journey!

This C# implementation provides a stepping stone for you to explore interpreter development and grasp the core concepts covered in the book. Feel free to experiment, build upon this project, and share your findings. Remember, the learning journey is more important than the destination!

Additional Considerations:

Error Handling: Enhance error handling and input validation for robustness.
Testing: Integrate testing framework xUnit to ensure code quality.
Documentation: Consider adding more detailed documentation, tutorials, and examples.
Expand Functionality: If comfortable, delve into advanced features like garbage collection, closures, and advanced data structures.

About

Yet another C# implementation of an Interpreter for the Monkey language from "Writing an Interpreter in Go"

Topics

Resources

License

Stars

Watchers

Forks