arxlang-jupyter-kernel is a wrapper-style Jupyter kernel for ArxLang. Each
cell is compiled with the Arx CLI, executed as a native binary, and its
stdout/stderr is returned to Jupyter.
This first version does not require any changes inside the Arx compiler codebase.
- Python 3.10+
- Poetry
arxCLI available onPATH(or setARX_BIN)- Jupyter Notebook/Lab or Quarto with Jupyter support
poetry installRegister the kernel:
poetry run python -m arxlang_jupyter_kernel.install --userValidate installation:
jupyter kernelspec listYou should see an arx kernelspec with display name ArxLang.
- Each cell is compiled and run in a temporary build directory.
- The kernel keeps a session prelude with all previously successful cells.
- New cells compile as:
session prelude + current cell. - Compilation errors are returned as Jupyter error messages.
- Failed compilations do not update session source.
Use the arx kernel id in document front matter:
---
title: "Arx Notebook"
jupyter: arx
---ARX_BINDefault:arxPath/executable for Arx CLI.ARX_COMPILE_ARGSDefault: empty Extra compile args, parsed shell-style.ARX_RUN_ARGSDefault: empty Extra runtime args, parsed shell-style.ARX_KERNEL_KEEP_BUILDDefault:0Set to1to keep temporary build directories for debugging.ARX_KERNEL_SESSION_FILEDefault: unset Optional file path for persisting successful session source.
Current compile command guess is:
arx build <source> -o <binary> [ARX_COMPILE_ARGS...]Runtime command is:
<binary> [ARX_RUN_ARGS...]If the final Arx CLI differs, update src/arxlang_jupyter_kernel/compile_run.py
in build_compile_command().
ArxCompileErrorwith "No such file or directory: 'arx'" Ensure Arx CLI is installed or setARX_BIN=/full/path/to/arx.- Compiles fail due to CLI mismatch Adjust
build_compile_command()to the finalized Arx CLI syntax. - Need compiler artifacts for debugging Set
ARX_KERNEL_KEEP_BUILD=1before launching Jupyter. - Kernel installed but not visible Re-run install and verify
jupyter kernelspec listoutput.