From 316db429404ba8001c1de751a17f19eb6c386b3e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 27 Sep 2021 10:30:54 +0800 Subject: [PATCH] nac3embedded -> nac3artiq, README cleanup --- Cargo.lock | 22 ++++++------ Cargo.toml | 2 +- README.md | 36 ++++++------------- {nac3embedded => nac3artiq}/Cargo.toml | 4 +-- {nac3embedded => nac3artiq}/demo.py | 0 {nac3embedded => nac3artiq}/device_db.py | 0 {nac3embedded => nac3artiq}/kernel.ld | 0 {nac3embedded => nac3artiq}/language.py | 4 +-- {nac3embedded => nac3artiq}/src/lib.rs | 2 +- .../src/symbol_resolver.rs | 0 nac3embedded/nac3embedded.so | 1 - 11 files changed, 28 insertions(+), 43 deletions(-) rename {nac3embedded => nac3artiq}/Cargo.toml (90%) rename {nac3embedded => nac3artiq}/demo.py (100%) rename {nac3embedded => nac3artiq}/device_db.py (100%) rename {nac3embedded => nac3artiq}/kernel.ld (100%) rename {nac3embedded => nac3artiq}/language.py (94%) rename {nac3embedded => nac3artiq}/src/lib.rs (99%) rename {nac3embedded => nac3artiq}/src/symbol_resolver.rs (100%) delete mode 120000 nac3embedded/nac3embedded.so diff --git a/Cargo.lock b/Cargo.lock index b2bc5d26..95760bf7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -421,6 +421,17 @@ dependencies = [ "autocfg", ] +[[package]] +name = "nac3artiq" +version = "0.1.0" +dependencies = [ + "inkwell", + "nac3core", + "parking_lot", + "pyo3", + "rustpython-parser", +] + [[package]] name = "nac3core" version = "0.1.0" @@ -437,17 +448,6 @@ dependencies = [ "test-case", ] -[[package]] -name = "nac3embedded" -version = "0.1.0" -dependencies = [ - "inkwell", - "nac3core", - "parking_lot", - "pyo3", - "rustpython-parser", -] - [[package]] name = "nac3standalone" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index fc88f147..4aa4bf22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ members = [ "nac3core", "nac3standalone", - "nac3embedded", + "nac3artiq", ] [profile.release] diff --git a/README.md b/README.md index 00f7dcaf..c36dc1f9 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,20 @@ -# nac3 compiler +# 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. +- nac3core: Core compiler library, containing type-checking and code + generation. +- nac3artiq: Integration with ARTIQ and implementation of ARTIQ-specific + extensions to the core language. +- nac3standalone: Standalone compiler tool (core language only). -The core compiler would know nothing about symbol resolution, host variables -etc. The nac3embedded/nac3standalone library would provide (implement) the +The core compiler knows nothing about symbol resolution, host variables +etc. nac3artiq and nac3standalone 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 +unknown symbols. The core compiler only type checks classes and functions +requested by nac3artiq/nac3standalone (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 +compiler analyses the set of functions/classes that are used and performs code generation. value could be integer values, boolean values, bytes (for memcpy), function ID (full name + concrete type) - -## Current Plan - -Type checking: - -- [x] Basic interface for symbol resolver. -- [x] Track location information in context object (for diagnostics). -- [ ] Refactor old expression and statement type inference code. (anto) -- [ ] Error diagnostics utilities. (pca) -- [ ] Move tests to external files, write scripts for testing. (pca) -- [ ] Implement function type checking (instantiate bounded type parameters), - loop unrolling, type inference for lists with virtual objects. (pca) - - - diff --git a/nac3embedded/Cargo.toml b/nac3artiq/Cargo.toml similarity index 90% rename from nac3embedded/Cargo.toml rename to nac3artiq/Cargo.toml index 2f218122..a814fcdd 100644 --- a/nac3embedded/Cargo.toml +++ b/nac3artiq/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "nac3embedded" +name = "nac3artiq" version = "0.1.0" authors = ["M-Labs"] edition = "2018" [lib] -name = "nac3embedded" +name = "nac3artiq" crate-type = ["cdylib"] [dependencies] diff --git a/nac3embedded/demo.py b/nac3artiq/demo.py similarity index 100% rename from nac3embedded/demo.py rename to nac3artiq/demo.py diff --git a/nac3embedded/device_db.py b/nac3artiq/device_db.py similarity index 100% rename from nac3embedded/device_db.py rename to nac3artiq/device_db.py diff --git a/nac3embedded/kernel.ld b/nac3artiq/kernel.ld similarity index 100% rename from nac3embedded/kernel.ld rename to nac3artiq/kernel.ld diff --git a/nac3embedded/language.py b/nac3artiq/language.py similarity index 94% rename from nac3embedded/language.py rename to nac3artiq/language.py index 2d3457ff..77d79b2a 100644 --- a/nac3embedded/language.py +++ b/nac3artiq/language.py @@ -1,13 +1,13 @@ from inspect import isclass from functools import wraps -import nac3embedded +import nac3artiq __all__ = ["extern", "kernel"] -nac3 = nac3embedded.NAC3() +nac3 = nac3artiq.NAC3() allow_object_registration = True diff --git a/nac3embedded/src/lib.rs b/nac3artiq/src/lib.rs similarity index 99% rename from nac3embedded/src/lib.rs rename to nac3artiq/src/lib.rs index 1df6f236..4dec48ad 100644 --- a/nac3embedded/src/lib.rs +++ b/nac3artiq/src/lib.rs @@ -197,7 +197,7 @@ impl Nac3 { } #[pymodule] -fn nac3embedded(_py: Python, m: &PyModule) -> PyResult<()> { +fn nac3artiq(_py: Python, m: &PyModule) -> PyResult<()> { Target::initialize_all(&InitializationConfig::default()); m.add_class::()?; Ok(()) diff --git a/nac3embedded/src/symbol_resolver.rs b/nac3artiq/src/symbol_resolver.rs similarity index 100% rename from nac3embedded/src/symbol_resolver.rs rename to nac3artiq/src/symbol_resolver.rs diff --git a/nac3embedded/nac3embedded.so b/nac3embedded/nac3embedded.so deleted file mode 120000 index 9459220f..00000000 --- a/nac3embedded/nac3embedded.so +++ /dev/null @@ -1 +0,0 @@ -../target/release/libnac3embedded.so \ No newline at end of file