joshradin / jodin-rs

A rust reimplementation of Jodin
GNU General Public License v3.0
0 stars 0 forks source link

Incremental compilation #74

Closed joshradin closed 2 years ago

joshradin commented 2 years ago

The compiler should allow for incremental compilation.

The compiler should allow for directories to be specified that contains compiler jodin code that can be used by later compilation units. This should allow for incremental compilation as well. Unsure how to fully implement this yet.

Implementation

The output file type should be .jobj, and should output based on namespace and not declaration file. Precompiled units can either be given as individual .jobj files, or as zip files using DEFLATE with the extension .jdp.

All .jobj files should contain a magic number at the beginning of the file that:

  1. Confirms that this is a jodin object file
  2. Can be interpreted by the target Jodin Virtual Machine.

The compiler should be given directories or .jdp files as inputs for compilation.

Considerations

When a file already exists that is being used for compilation, the compiler should rewrite the target file.

joshradin commented 2 years ago

/cib

github-actions[bot] commented 2 years ago

Branch feature/74-incremental_compilation created!

joshradin commented 2 years ago

I think that namespaces will have to be a per-file basis to make incremental work. In addition, everything must be in some namespace.

in tests;

public fn factorial(n: unsigned int) -> unsigned int {
    if (n==0) return 1;
    return n * factorial(n-1);
}
joshradin commented 2 years ago

Namespaces should be made into directories, and translation units should be individual files.