Skip to content

arya2004/arc

Repository files navigation

arc: A Handwritten Compiler in C#

Welcome to arc, a handwritten compiler built in C#. This project demonstrates fundamental concepts of compiler construction, with a focus on creating a language that integrates well with an IDE by exposing APIs for parsing and type-checking.

The compiler is inspired by Microsoft's Roslyn (the C# and Visual Basic compiler platform), employing similar architectural ideas for parsing, type analysis, and tooling integration.


Features

  • Handwritten Compiler: Built from scratch in C# to illustrate compiler construction.
  • Parsing and Type Checking APIs: Exposes APIs that allow integration with IDEs for enhanced tooling, such as syntax highlighting and error reporting.
  • Educational Value: Aimed at developers interested in understanding how compilers work under the hood and how languages can be "tooled" for modern development environments.
  • Roslyn-inspired Design: Leverages principles from Microsoft's Roslyn platform for clean architecture and extensibility.

Why arc?

arc serves as both a learning tool and a demonstration of compiler design. By following this project, you will:

  1. Learn how to implement a compiler from scratch.
  2. Understand how to build APIs for language tooling in IDEs.
  3. Explore concepts like parsing, syntax trees, and type analysis.

Getting Started

Prerequisites

  • .NET SDK: Ensure you have the .NET SDK installed on your machine. You can download it from dotnet.microsoft.com.

Cloning the Repository

git clone https://github.com/arya2004/arc.git
cd arc

Building the Project

  1. Open the project in your favorite IDE (e.g., Visual Studio, JetBrains Rider, or VS Code with the C# extension).
  2. Restore dependencies:
    dotnet restore
  3. Build the solution:
    dotnet build

Contributing

Contributions are welcome! If you'd like to contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Submit a pull request, ensuring you provide a clear description of your changes.

License

This project is licensed under the MIT License.


About

Custom Compiler written in C#

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Languages