Skip to main content

xian-compiler-core

This crate is the Rust/WASM compiler core described in ../../docs/RUST_COMPILER_CORE.md.

The crate owns the artifact model, hashing rules, diagnostics, source units, parser adapter, Xian-owned syntax tree, semantic linting, source normalization, structural xian_ir_v1 lowering, bounded compile admission, and compiler fixture loader. The checked-in accepted and rejected fixtures are the shared parity oracle for Rust, Python, WASM/JavaScript, linter, and node admission surfaces.

Current Surface

  • SourceUnit: validated source/module/profile input wrapper
  • ContractArtifact: typed xian_contract_artifact_v1 deployment artifact
  • build_contract_artifact(...): construct artifact metadata from canonical source and canonical IR bytes
  • validate_contract_artifact(...): verify artifact format, profile, hashes, JSON IR, and embedded IR identity fields
  • CompilerDiagnostic: stable structured diagnostic payload
  • CompilerLimits: consensus defaults for source bytes, syntax nodes/depth, total tokens, and logical-line tokens
  • parse_source(...): RustPython-backed parser adapter for the current Python-like contract syntax, returning an opaque parsed module
  • parse_diagnostics(...): deterministic parser diagnostic adapter with source ranges
  • parse_to_syntax(...): parse source and convert it into a compact Xian-owned syntax tree
  • build_syntax_tree(...): convert an existing parsed module into Xian syntax
  • SyntaxModule, SyntaxStatement, SyntaxExpression: Rust-owned syntax data model used by later lint/normalize/lower stages
  • lint_syntax(...): semantic lint rules over SyntaxModule
  • normalize_syntax(...): deterministic formatter over the Xian syntax tree
  • normalize_source(...): parse, optionally lint, and return canonical source
  • lower_syntax_to_ir(...): lower a validated syntax tree into structural xian_ir_v1
  • lower_source_to_ir(...): normalize, parse, optionally lint, and lower source into structural xian_ir_v1
  • lower_source_to_ir_json(...): return canonical JSON for the lowered IR
  • compile_contract_artifact(...): normalize, lower, and build a hash-checked xian_contract_artifact_v1
  • describe_vm_host_surface(): expose the xian_vm_v1_host_v1 host catalog
  • diagnose_contract(...): authoritative high-level compiler entrypoint; validates the complete source-to-IR path and returns stable diagnostics
  • compiler_version(): machine-readable version and schema metadata
  • CompilerFixture: typed representation of xian.compiler_fixture.v1
  • parse_compiler_fixture_json(...): load a fixture JSON document
  • CompilerFixture::validate_basic(): deterministic structural checks for accepted and rejected fixture records

Fixtures are refreshed through the authoritative Python binding with:

uv run python scripts/generate_compiler_fixtures.py \
  packages/xian-compiler-core/tests/sources

Run the Rust fixture checks with:

cargo test --manifest-path packages/xian-compiler-core/Cargo.toml

Check the optional binding layers with:

cargo check --manifest-path packages/xian-compiler-core/Cargo.toml \
  --features python-extension
cargo check --manifest-path packages/xian-compiler-core/Cargo.toml \
  --features wasm

Build the Python package locally with:

uv run python -c "import xian_compiler_core"

Build the WASM package from packages/xian-compiler-core/npm with:

npm run build

The WASM build requires wasm-pack and a Rust toolchain with the wasm32-unknown-unknown standard library installed. The generated npm package is consumed by browser apps such as xian-ide-web and by JS callers that want to compile source locally.

Download files

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

Source Distribution

xian_tech_compiler_core-0.2.0.tar.gz (77.4 kB view details)

Uploaded Source

Built Distributions

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

xian_tech_compiler_core-0.2.0-cp314-abi3-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.14+Windows x86-64

xian_tech_compiler_core-0.2.0-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.14+manylinux: glibc 2.17+ x86-64

xian_tech_compiler_core-0.2.0-cp314-abi3-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

xian_tech_compiler_core-0.2.0-cp314-abi3-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.14+macOS 10.12+ x86-64

File details

Details for the file xian_tech_compiler_core-0.2.0.tar.gz.

File metadata

  • Download URL: xian_tech_compiler_core-0.2.0.tar.gz
  • Upload date:
  • Size: 77.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xian_tech_compiler_core-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3d4e385d09327b7c3cf8616b4543f1d7db4e7e2bbbd0b89c9ac3ec9fcb4fae09
MD5 377006e52370f8c2389e30f63aa49b22
BLAKE2b-256 5f67b81fec8b73ff1a06bb5eacf7b1ccf06572a00d48f124bc9a5a320fc970df

See more details on using hashes here.

Provenance

The following attestation bundles were made for xian_tech_compiler_core-0.2.0.tar.gz:

Publisher: release.yml on xian-technology/xian-contracting

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xian_tech_compiler_core-0.2.0-cp314-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for xian_tech_compiler_core-0.2.0-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1cd71a53e31bdb026b3d977cf391be5cba269115f21655be4edd3e68626bf133
MD5 fcb84dce6157a9a5a2f6fbe0f5f74dc5
BLAKE2b-256 986afda39f8b432a2c75947e8afb3449501ada278c55fd1a4161c531e4260da2

See more details on using hashes here.

Provenance

The following attestation bundles were made for xian_tech_compiler_core-0.2.0-cp314-abi3-win_amd64.whl:

Publisher: release.yml on xian-technology/xian-contracting

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xian_tech_compiler_core-0.2.0-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xian_tech_compiler_core-0.2.0-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 83688195267d9eb128aede6991d94f05cb8d61e1ceeb859420adc201c779d34a
MD5 c5f5f934b429b4db4c9ae7c21a4e753a
BLAKE2b-256 5973451104961819a1d40b651734231ef9c610996e0f5daa2a51858aaf930107

See more details on using hashes here.

Provenance

The following attestation bundles were made for xian_tech_compiler_core-0.2.0-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on xian-technology/xian-contracting

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xian_tech_compiler_core-0.2.0-cp314-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for xian_tech_compiler_core-0.2.0-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e6bbab2d9f6bed207dd5d81bfc5a3ebbbd114167c60cd6ba3c5b60670090a319
MD5 b274b667d1ab5775e7293fb9ce3d62aa
BLAKE2b-256 70fd885a9e00e7c32357fbe2e39669369790aae43561c74b070b15d2297b8eab

See more details on using hashes here.

Provenance

The following attestation bundles were made for xian_tech_compiler_core-0.2.0-cp314-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on xian-technology/xian-contracting

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xian_tech_compiler_core-0.2.0-cp314-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for xian_tech_compiler_core-0.2.0-cp314-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 045aea4b6aee9e1411ce4b10913a52b6a6e27b8df50e7fe39da9d544f837cfdf
MD5 eb79959a3c4efc08a789f44aade8472d
BLAKE2b-256 b408c63e2f4a27de90372e5f40b8d582b171c2afaff1f5f4828225d37a2c7f82

See more details on using hashes here.

Provenance

The following attestation bundles were made for xian_tech_compiler_core-0.2.0-cp314-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on xian-technology/xian-contracting

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

5 files

0.1.3

5 files

0.1.2

5 files

0.1.1

5 files

0.1.0

5 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page