New ARTIQ compiler, third iteration
Go to file
pca006132 f43e225845 updated inference_context rules 2021-06-28 16:32:46 +08:00
nac3core updated inference_context rules 2021-06-28 16:32:46 +08:00
nac3embedded nac3embedded: compilation demo 2020-12-19 16:23:12 +08:00
nac3standalone nac3standalone: renames 2020-12-18 22:35:59 +08:00
.gitignore nac3embedded: basic source extraction 2020-12-18 23:45:09 +08:00
Cargo.lock added symbol resolver... 2021-06-28 14:48:04 +08:00
Cargo.toml libnac3 -> nac3core 2020-12-18 10:18:21 +08:00
README.md updated readme 2021-06-25 12:57:43 +08:00
shell.nix enabled clippy 2021-01-04 14:49:14 +08:00

README.md

nac3 compiler

This repository contains:

  • nac3core: Core compiler library, containing type-checking, static analysis (in the future) and code generation.
  • nac3embedded: Integration with CPython runtime.
  • nac3standalone: Standalone compiler tool.

The core compiler would know nothing about symbol resolution, host variables etc. The nac3embedded/nac3standalone library would provide (implement) the symbol resolver to the core compiler for resolving the type and value for unknown symbols. The core compiler would only type check classes and functions requested by the nac3embedded/nac3standalone lib (the API should allow the caller to specify which methods should be compiled). After type checking, the compiler would analyse the set of functions/classes that are used and perform code generation.

Symbol resolver:

  • Str -> Nac3Type
  • Str -> Value

value could be integer values, boolean values, bytes (for memcpy), function ID (full name + concrete type)

Current Plan

  1. Write out the syntax-directed type checking/inferencing rules. Fix the rule for type variable instantiation.
  2. Update the library dependencies and rewrite some of the type checking code.
  3. Design the symbol resolver API.
  4. Move tests from code to external files to cleanup the code.