New ARTIQ compiler, third iteration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ychenfo 263bc82434 nac3artiq: remove debug print 3 months ago
llvm update LLVM 5 months ago
nac3artiq nac3artiq: remove debug print 3 months ago
nac3ast nac3ast/parser/core: use i128 for u64 constants 4 months ago
nac3core nac3core: fixed test breakage 3 months ago
nac3parser nac3parser: modify to handle UAdd in front of int constant 4 months ago
nac3standalone nac3standalone/demo: handle imports consistently 3 months ago
runkernel rename exception symbols in host code 4 months ago
.gitignore nac3embedded: basic source extraction 2 years ago
Cargo.lock Revert "Revert "update dependencies"" 3 months ago
Cargo.toml update inkwell. Closes #67 6 months ago README: add Windows instructions 5 months ago
flake.lock Revert "Revert "update dependencies"" 3 months ago
flake.nix update dependencies 5 months ago
rustfmt.toml move rustfmt.toml upper 6 months ago


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.


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

Try NAC3


After setting up Nix as above, use nix shell git+ 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 (work in progress)

NAC3 ARTIQ packaging for MSYS2/Windows is not yet complete so installation involves many manual steps. It is also less tested and you may encounter problems.

Install MSYS2 and run the following commands:

pacman -S mingw-w64-x86_64-python-h5py mingw-w64-x86_64-python-pyqt5 mingw-w64-x86_64-python-scipy mingw-w64-x86_64-python-prettytable mingw-w64-x86_64-python-pygit2
pacman -S mingw-w64-x86_64-python-pip
pip install qasync
pip install pyqtgraph
pacman -S patch git
git clone
cd sipyco
git show 20c946aad78872fe60b78d9b57a624d69f3eea47 | patch -p1 -R
python install
cd ..
git clone -b nac3
cd artiq
python install

Locate a recent build of nac3artiq-mingw from Hydra and download Then extract the contents in the appropriate location:

pacman -S unzip
wget  # edit the build number
unzip -d C:/msys64/mingw64/lib/python3.9/site-packages

Install additional NAC3 dependencies:

pacman -S mingw-w64-x86_64-lld
wget  # edit the build number
cp mcfgthread-12.dll C:/msys64/mingw64/bin

And you should be good to go.

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).
  • 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.