Skip to main content

IRx

IRx is the semantic-analysis, LLVM-lowering, and native-runtime layer of the ArxLang ecosystem. The PyPI distribution is pyirx; the Python import is irx.

Status: functional experimental backend. It supports substantial compiler and runtime flows but does not lower every ASTx node.

Responsibilities

  • analyze ASTx modules and attach resolved semantic sidecars
  • validate types, calls, imports, templates, classes, and FFI boundaries
  • lower supported nodes to LLVM IR with llvmlite
  • emit objects, link executables with Clang, and run built artifacts
  • report structured semantic, lowering, native-compile, and link diagnostics
  • activate native runtime features only when a compilation unit needs them

Native Apache Arrow runtime

IRx integrates Apache Arrow through native C++ runtime code and opaque C ABI handles. Current layers include:

  • primitive Arrow arrays and Arrow C Data interoperability
  • homogeneous fixed-width arrow::Tensor values
  • DataFrames backed by arrow::Table
  • Series backed by arrow::ChunkedArray
  • RecordBatch schemas, builders, nullable data, and Arrow IPC streams

The RecordBatch API interoperates with PyArrow and supports signed/unsigned integers, floats, booleans, UTF-8 and large UTF-8 strings, dates, timestamps, and times. pyarrow and arx-arrowcpp-sources provide the Arrow C++ build and link metadata.

Install

pip install pyirx

Native builds require an LLVM/Clang-compatible toolchain. Arrow runtime features require a C++ compiler.

Translate ASTx to LLVM IR

import astx

from irx.builder import Builder

builder = Builder()
module = builder.module()

body = astx.Block()
body.append(astx.FunctionReturn(astx.LiteralInt32(0)))
prototype = astx.FunctionPrototype(
    name="main",
    args=astx.Arguments(),
    return_type=astx.Int32(),
)
module.block.append(astx.FunctionDef(prototype=prototype, body=body))

llvm_ir = builder.translate(module)
print(llvm_ir)

translate() returns LLVM IR text without linking. Use build() to emit and link a native artifact, then run() to execute the built program.

RecordBatch API

The direct Python API lives in irx.record_batch. In a source checkout, build its standalone shared library before first use:

python -c "from irx.builder.runtime.record_batch import build_record_batch_shared_library; build_record_batch_shared_library()"
from irx.record_batch import (
    IrxColumnType,
    RecordBatchBuilder,
    RecordBatchSchema,
)

schema = RecordBatchSchema()
schema.add_field("id", IrxColumnType.INT32, nullable=False)

builder = RecordBatchBuilder(schema)
builder.append_int32(0, 42)
batch = builder.finish()

assert batch.get_int32(0, 0) == 42

batch.release()
builder.release()
schema.release()

Runtime features

Registered features include libc, libm, assertions, buffer, list, array, tensor, dataframe, and record_batch. Features may contribute external symbols, C/C++ sources, object files, libraries, and linker flags.

Boundaries

IRx does not parse Arx/AIX source and does not define high-level query or DataFrame language semantics. Arrow C++ stays behind the native runtime; LLVM does not encode Arrow object layouts directly.

Documentation: https://arxlang.org/irx/

License: Apache-2.0.

Download files

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

Source Distribution

pyirx-1.24.1.tar.gz (211.4 kB view details)

Uploaded Source

Built Distribution

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

pyirx-1.24.1-py3-none-any.whl (277.5 kB view details)

Uploaded Python 3

File details

Details for the file pyirx-1.24.1.tar.gz.

File metadata

  • Download URL: pyirx-1.24.1.tar.gz
  • Upload date:
  • Size: 211.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1020-azure

File hashes

Hashes for pyirx-1.24.1.tar.gz
Algorithm Hash digest
SHA256 17b8613cc8027974559b1bdd6c1eaaca7efcf75e7b7e8c6a39a38772104b995d
MD5 41a920f6b1c82883c22f9f4492c982f1
BLAKE2b-256 16db99adcac45f0592b425e16f4a678f512a30c7050458c02511ee63131c82cf

See more details on using hashes here.

File details

Details for the file pyirx-1.24.1-py3-none-any.whl.

File metadata

  • Download URL: pyirx-1.24.1-py3-none-any.whl
  • Upload date:
  • Size: 277.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1020-azure

File hashes

Hashes for pyirx-1.24.1-py3-none-any.whl
Algorithm Hash digest
SHA256 add96105982a3a6170a29c256e62097242fa18df1217d91bd99e1fbf27ff0bfa
MD5 ba6c94c28fc6dc5a6092509baec5412b
BLAKE2b-256 9f0381079216a16e575e1c53025eeb57fe5816f2743fb9ea1f5cba976c439d0e

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 Sentry Error logging StatusPage Status page