forked from M-Labs/nac3
1
0
Fork 0
New ARTIQ compiler, third iteration
Go to file
z78078 8f95b79257 nac3artiq: throw error message when constructor use rpc decorator (#306)
Co-authored-by: z78078 <cc@m-labs.hk>
Co-committed-by: z78078 <cc@m-labs.hk>
2022-07-11 15:55:55 +08:00
nac3artiq nac3artiq: throw error message when constructor use rpc decorator (#306) 2022-07-11 15:55:55 +08:00
nac3ast nac3ast/parser/core: use i128 for u64 constants 2022-03-08 18:21:14 +08:00
nac3core nac3standalone: allow classes without explicit init (#221) 2022-07-07 10:36:25 +08:00
nac3ld nac3ld: replace unsafe code 2022-06-06 14:41:14 +08:00
nac3parser fix warnings 2022-03-26 18:52:08 +08:00
nac3standalone nac3standalone: allow classes without explicit init (#221) 2022-07-07 10:36:25 +08:00
nix update dependencies 2022-07-02 19:04:19 +08:00
runkernel indentation 2022-03-23 10:45:28 +08:00
.gitignore build LLVM with Wine + MSYS2 2022-03-22 18:03:25 +08:00
Cargo.lock work around random segmentation fault (#275) 2022-07-04 18:06:36 +08:00
Cargo.toml add nac3ld 2022-06-06 14:40:13 +08:00
README.md README: call for Nix 2.8 (older versions have flake bugs) 2022-06-06 18:14:21 +08:00
flake.lock update dependencies 2022-07-02 19:04:19 +08:00
flake.nix update dependencies 2022-07-02 19:04:19 +08:00
nac3.svg add icon 2022-04-18 15:07:53 +08:00
rustfmt.toml move rustfmt.toml upper 2022-01-09 11:31:06 +08:00

README.md

icon

NAC3

NAC3 is a major, backward-incompatible rewrite of the compiler for the ARTIQ physics experiment control and data acquisition system. It features greatly improved compilation speeds, a much better type system, and more predictable and transparent operation.

NAC3 has a modular design and its applicability reaches beyond ARTIQ. The nac3core module does not contain anything specific to ARTIQ, and can be used in any project that requires compiling Python to machine code.

WARNING: NAC3 is currently experimental software and several important features are not implemented yet.

Packaging

NAC3 is packaged using the Nix Flakes system. Install Nix 2.8+ and enable flakes by adding experimental-features = nix-command flakes to nix.conf (e.g. ~/.config/nix/nix.conf).

Try NAC3

Linux

After setting up Nix as above, use nix shell git+https://github.com/m-labs/artiq.git?ref=nac3 to get a shell with the NAC3 version of ARTIQ. See the examples directory in ARTIQ (nac3 Git branch) for some samples of NAC3 kernel code.

Windows

Install MSYS2, and open "MSYS2 MinGW x64". Edit /etc/pacman.conf to add:

[artiq]
SigLevel = Optional TrustAll
Server = https://lab.m-labs.hk/msys2

Then run the following commands:

pacman -Syu
pacman -S mingw-w64-x86_64-artiq

Note: This build of NAC3 cannot be used with Anaconda Python nor the python.org binaries for Windows. Those Python versions are compiled with Visual Studio (MSVC) and their ABI is incompatible with the GNU ABI used in this build. We have no plans to support Visual Studio nor the MSVC ABI. If you need a MSVC build, please install the requisite bloated spyware from Microsoft and compile NAC3 yourself.

For developers

This repository contains:

  • nac3ast: Python abstract syntax tree definition (based on RustPython).
  • nac3parser: Python parser (based on RustPython).
  • nac3core: Core compiler library, containing type-checking and code generation.
  • nac3standalone: Standalone compiler tool (core language only).
  • nac3ld: Minimalist RISC-V and ARM linker.
  • nac3artiq: Integration with ARTIQ and implementation of ARTIQ-specific extensions to the core language.
  • runkernel: Simple program that runs compiled ARTIQ kernels on the host and displays RTIO operations. Useful for testing without hardware.

Use nix develop in this repository to enter a development shell. If you are using a different shell than bash you can use e.g. nix develop --command fish.

Build NAC3 with cargo build --release. See the demonstrations in nac3artiq and nac3standalone.