forked from M-Labs/nac3
1
0
Fork 0

nac3embedded -> nac3artiq, README cleanup

This commit is contained in:
Sebastien Bourdeauducq 2021-09-27 10:30:54 +08:00
parent 64404bba20
commit 316db42940
11 changed files with 28 additions and 43 deletions

22
Cargo.lock generated
View File

@ -421,6 +421,17 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "nac3artiq"
version = "0.1.0"
dependencies = [
"inkwell",
"nac3core",
"parking_lot",
"pyo3",
"rustpython-parser",
]
[[package]] [[package]]
name = "nac3core" name = "nac3core"
version = "0.1.0" version = "0.1.0"
@ -437,17 +448,6 @@ dependencies = [
"test-case", "test-case",
] ]
[[package]]
name = "nac3embedded"
version = "0.1.0"
dependencies = [
"inkwell",
"nac3core",
"parking_lot",
"pyo3",
"rustpython-parser",
]
[[package]] [[package]]
name = "nac3standalone" name = "nac3standalone"
version = "0.1.0" version = "0.1.0"

View File

@ -2,7 +2,7 @@
members = [ members = [
"nac3core", "nac3core",
"nac3standalone", "nac3standalone",
"nac3embedded", "nac3artiq",
] ]
[profile.release] [profile.release]

View File

@ -1,34 +1,20 @@
# nac3 compiler # NAC3 compiler
This repository contains: This repository contains:
- nac3core: Core compiler library, containing type-checking, static analysis (in - nac3core: Core compiler library, containing type-checking and code
the future) and code generation. generation.
- nac3embedded: Integration with CPython runtime. - nac3artiq: Integration with ARTIQ and implementation of ARTIQ-specific
- nac3standalone: Standalone compiler tool. extensions to the core language.
- nac3standalone: Standalone compiler tool (core language only).
The core compiler would know nothing about symbol resolution, host variables The core compiler knows nothing about symbol resolution, host variables
etc. The nac3embedded/nac3standalone library would provide (implement) the etc. nac3artiq and nac3standalone provide (implement) the
symbol resolver to the core compiler for resolving the type and value for 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 unknown symbols. The core compiler only type checks classes and functions
requested by the nac3embedded/nac3standalone lib (the API should allow the requested by nac3artiq/nac3standalone (the API should allow the
caller to specify which methods should be compiled). After type checking, 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. code generation.
value could be integer values, boolean values, bytes (for memcpy), function ID value could be integer values, boolean values, bytes (for memcpy), function ID
(full name + concrete type) (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)

View File

@ -1,11 +1,11 @@
[package] [package]
name = "nac3embedded" name = "nac3artiq"
version = "0.1.0" version = "0.1.0"
authors = ["M-Labs"] authors = ["M-Labs"]
edition = "2018" edition = "2018"
[lib] [lib]
name = "nac3embedded" name = "nac3artiq"
crate-type = ["cdylib"] crate-type = ["cdylib"]
[dependencies] [dependencies]

View File

@ -1,13 +1,13 @@
from inspect import isclass from inspect import isclass
from functools import wraps from functools import wraps
import nac3embedded import nac3artiq
__all__ = ["extern", "kernel"] __all__ = ["extern", "kernel"]
nac3 = nac3embedded.NAC3() nac3 = nac3artiq.NAC3()
allow_object_registration = True allow_object_registration = True

View File

@ -197,7 +197,7 @@ impl Nac3 {
} }
#[pymodule] #[pymodule]
fn nac3embedded(_py: Python, m: &PyModule) -> PyResult<()> { fn nac3artiq(_py: Python, m: &PyModule) -> PyResult<()> {
Target::initialize_all(&InitializationConfig::default()); Target::initialize_all(&InitializationConfig::default());
m.add_class::<Nac3>()?; m.add_class::<Nac3>()?;
Ok(()) Ok(())

View File

@ -1 +0,0 @@
../target/release/libnac3embedded.so