Skip to main content

Jupyter kernel wrapper for the ArxLang compiled language

Project description

arxlang-jupyter-kernel

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.

Requirements

  • Python 3.10+
  • Poetry
  • arx CLI available on PATH (or set ARX_BIN)
  • Jupyter Notebook/Lab or Quarto with Jupyter support

Install

poetry install

Register the kernel:

poetry run python -m arxlang_jupyter_kernel.install --user

Validate installation:

jupyter kernelspec list

You should see an arx kernelspec with display name ArxLang.

Execution model

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

Quarto usage

Use the arx kernel id in document front matter:

---
title: "Arx Notebook"
jupyter: arx
---

Environment variables

  • ARX_BIN Default: arx Path/executable for Arx CLI.
  • ARX_COMPILE_ARGS Default: empty Extra compile args, parsed shell-style.
  • ARX_RUN_ARGS Default: empty Extra runtime args, parsed shell-style.
  • ARX_KERNEL_KEEP_BUILD Default: 0 Set to 1 to keep temporary build directories for debugging.
  • ARX_KERNEL_SESSION_FILE Default: unset Optional file path for persisting successful session source.

CLI command assumption and TODO

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

Troubleshooting

  • ArxCompileError with "No such file or directory: 'arx'" Ensure Arx CLI is installed or set ARX_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=1 before launching Jupyter.
  • Kernel installed but not visible Re-run install and verify jupyter kernelspec list output.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arxlang_jupyter_kernel-0.1.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arxlang_jupyter_kernel-0.1.1-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file arxlang_jupyter_kernel-0.1.1.tar.gz.

File metadata

  • Download URL: arxlang_jupyter_kernel-0.1.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.10.20 Linux/6.14.0-1017-azure

File hashes

Hashes for arxlang_jupyter_kernel-0.1.1.tar.gz
Algorithm Hash digest
SHA256 349af926213ad4c167ec524c25b7364db392fe918fa9473705f6bb7e73fb320c
MD5 7206192a39fb6dcd4b0e5a2a42f06933
BLAKE2b-256 5481557e1b7938d40fa3b592d676b8fa9dee904a8ccd7aa5b7bd61017949f2d1

See more details on using hashes here.

File details

Details for the file arxlang_jupyter_kernel-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for arxlang_jupyter_kernel-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 64c73fa2ad79dee4cf381f00f2e64259a66c3a246875f9fb8e52af5013bcbc3f
MD5 6eb23e5197111220af8423451fc8d1da
BLAKE2b-256 75f0a0648a9166f6c62fd4219a4f78747c486c848845e46c82c68e7d08da5ba6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page