Skip to content

Contributing

Matt Hall edited this page Jul 8, 2022 · 2 revisions

For Potential Contributors

Join the Community

This is a project in the early stages of development with little value in production software, but we're always looking for feedback and contributions! Currently, discussions are held in the http://proglangdesign.net/ Discord community.

Start a Project Using Imp

Soon we'd like to begin dogfooding the project with libraries and applications developed in Imp. The project still has a way to go before that's feasible, but we're getting there!

Contributing Code

We welcome any contributions but may deny PRs if they do not meet the goals of the project. Please communicate with the maintainer before spending time on a feature.

Setup

To contribute to the Imp programming language you'll need to install the following:

  • Git
  • Java/JDK 17
  • An IDE, preferably IntelliJ

Open the project and make sure Maven has installed all dependencies.

File Structure

Java projects are often large, sprawling codebases, so here's an attempt to break it down a bit.

Compiler

  • src/java/org/imp/jvm main package.
    • domain/ useful representations of constructs common to the compiler, e.g. identifiers and mutability.
      • Environment.java describes the variables in a single scope.
    • errors/ compiler error logging and template script.
    • parser/ manually created Pratt-style parser.
      • tokenizer/ tokenizer package.
    • tool/ tooling package.
      • cli/ the imp cli.
      • manifest/ manifest parsing.
      • Compile.java compiler.
    • types/ classes representing types at compile time.
    • visitors/ walk the tree, each visitor implements a single pass on the AST.
    • BytecodeGenerator.java JVM bytecode generators for classes, methods, fields, etc.
    • SourceFile.java maps one-to-one with a single Imp source file at compile time.
    • Util.java utilities!

Runtime Dependencies

  • src/main/java/org/imp/runtime standard library.

Test Suite

  • src/test/java/org/imp/test/ test package.

Running the sample project

The .idea/runConfigurations/CompilerTest.xml run configuration should run the Imp project located in the sample/ directory. It's beneficial to start here. Eventually this will be moved to an external location as we gain contributors.

Running Tests

The src/test/java/org/imp/test/ package should be run through Junit to run all tests. If you're using IntelliJ ( recommended), you can load the run configuration for this class from .idea/runConfigurations/Test_Suite.xml.

Building the Compiler

More to come in this section.

Testing the Tooling

Same here, need more content here.

Pull Requests

When you've completed your changes, open a PR with the main branch on GitHub. Fill out the PR template and provide as much detail as possible. If you've written tests for your code, it's way more likely it'll get merged.

One PR per feature.