Shared Rust/WASM compiler core for Xian contracts
Project description
xian-compiler-core
This crate is the landing zone for the central Rust/WASM compiler described in
../../docs/RUST_COMPILER_CORE.md.
The current slice owns the artifact model, hashing rules, diagnostics, source
units, parser adapter, Xian-owned syntax tree, semantic linting, source
normalization, structural xian_ir_v1 lowering, and compiler fixture loader.
The checked-in compiler fixtures are still generated from the current Python
compiler and act as the parity oracle during the migration.
Current Surface
SourceUnit: validated source/module/profile input wrapperContractArtifact: typedxian_contract_artifact_v1deployment artifactbuild_contract_artifact(...): construct artifact metadata from canonical source and canonical IR bytesvalidate_contract_artifact(...): verify artifact format, profile, hashes, JSON IR, and embedded IR identity fieldsCompilerDiagnostic: stable structured diagnostic payloadparse_source(...): RustPython-backed parser adapter for the current Python-like contract syntax, returning an opaque parsed moduleparse_diagnostics(...): deterministic parser diagnostic adapter with source rangesparse_to_syntax(...): parse source and convert it into a compact Xian-owned syntax treebuild_syntax_tree(...): convert an existing parsed module into Xian syntaxSyntaxModule,SyntaxStatement,SyntaxExpression: Rust-owned syntax data model used by later lint/normalize/lower stageslint_syntax(...): semantic lint rules overSyntaxModulenormalize_syntax(...): deterministic formatter over the Xian syntax treenormalize_source(...): parse, optionally lint, and return canonical sourcelower_syntax_to_ir(...): lower a validated syntax tree into structuralxian_ir_v1lower_source_to_ir(...): normalize, parse, optionally lint, and lower source into structuralxian_ir_v1lower_source_to_ir_json(...): return canonical JSON for the lowered IRcompile_contract_artifact(...): normalize, lower, and build a hash-checkedxian_contract_artifact_v1describe_vm_host_surface(): expose thexian_vm_v1_host_v1host catalogdiagnose_contract(...): first high-level compiler entrypoint; currently validates source/profile, parser diagnostics, unsupported syntax nodes, and semantic lint diagnostics whenlintis enabledcompiler_version(): machine-readable version and schema metadataCompilerFixture: typed representation ofxian.compiler_fixture.v1parse_compiler_fixture_json(...): load a fixture JSON documentCompilerFixture::validate_basic(): deterministic structural checks for accepted and rejected fixture records
Fixtures are generated from the current Python compiler 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xian_tech_compiler_core-0.1.1.tar.gz.
File metadata
- Download URL: xian_tech_compiler_core-0.1.1.tar.gz
- Upload date:
- Size: 68.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b9fb28213529440a1a5bcc90a759058a6b220347487a358907fa1ee9fe3d357
|
|
| MD5 |
ce3415f5ff71727fe6b8b63e848fff54
|
|
| BLAKE2b-256 |
a37bb3ea75ec9652a04c20f939b25ace3b320edd969df518d2ea39b4bd8e9fe5
|
Provenance
The following attestation bundles were made for xian_tech_compiler_core-0.1.1.tar.gz:
Publisher:
release.yml on xian-technology/xian-contracting
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_compiler_core-0.1.1.tar.gz -
Subject digest:
5b9fb28213529440a1a5bcc90a759058a6b220347487a358907fa1ee9fe3d357 - Sigstore transparency entry: 1541987037
- Sigstore integration time:
-
Permalink:
xian-technology/xian-contracting@22c3b12cb2d77d70ed6c3fca7f64cdfea5c61f3e -
Branch / Tag:
refs/tags/compiler-core-v0.1.1 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@22c3b12cb2d77d70ed6c3fca7f64cdfea5c61f3e -
Trigger Event:
push
-
Statement type:
File details
Details for the file xian_tech_compiler_core-0.1.1-cp314-abi3-win_amd64.whl.
File metadata
- Download URL: xian_tech_compiler_core-0.1.1-cp314-abi3-win_amd64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.14+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8659417b928cfa935cd8f234aa41c472810eeb062051dadc9e1609b258423182
|
|
| MD5 |
f80f223ba8daaab17650f4297bb61adb
|
|
| BLAKE2b-256 |
a2815b2e1dfa8db7ab2452d12c23de398bc8ee894e7c947cb7680ebc5b8d8b55
|
Provenance
The following attestation bundles were made for xian_tech_compiler_core-0.1.1-cp314-abi3-win_amd64.whl:
Publisher:
release.yml on xian-technology/xian-contracting
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_compiler_core-0.1.1-cp314-abi3-win_amd64.whl -
Subject digest:
8659417b928cfa935cd8f234aa41c472810eeb062051dadc9e1609b258423182 - Sigstore transparency entry: 1541987355
- Sigstore integration time:
-
Permalink:
xian-technology/xian-contracting@22c3b12cb2d77d70ed6c3fca7f64cdfea5c61f3e -
Branch / Tag:
refs/tags/compiler-core-v0.1.1 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@22c3b12cb2d77d70ed6c3fca7f64cdfea5c61f3e -
Trigger Event:
push
-
Statement type:
File details
Details for the file xian_tech_compiler_core-0.1.1-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: xian_tech_compiler_core-0.1.1-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.14+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b898f4969e1fbc1f86fc0cba5804b53c79c95e5d2407058f77c60881f502dd9
|
|
| MD5 |
846f868d5e76ef817189b234bf660202
|
|
| BLAKE2b-256 |
b7a06746b169ea2b0c8ba65b1b043a1f23e3a2b51675635278ce719b87da98d9
|
Provenance
The following attestation bundles were made for xian_tech_compiler_core-0.1.1-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on xian-technology/xian-contracting
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_compiler_core-0.1.1-cp314-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
2b898f4969e1fbc1f86fc0cba5804b53c79c95e5d2407058f77c60881f502dd9 - Sigstore transparency entry: 1541987444
- Sigstore integration time:
-
Permalink:
xian-technology/xian-contracting@22c3b12cb2d77d70ed6c3fca7f64cdfea5c61f3e -
Branch / Tag:
refs/tags/compiler-core-v0.1.1 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@22c3b12cb2d77d70ed6c3fca7f64cdfea5c61f3e -
Trigger Event:
push
-
Statement type:
File details
Details for the file xian_tech_compiler_core-0.1.1-cp314-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: xian_tech_compiler_core-0.1.1-cp314-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.14+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b78d176ca2b855f34b4d659ce2f4f7369724274ebcdbeda3f4616dadc06b1a7
|
|
| MD5 |
ca8a3144b5a006471d407cd736025e9f
|
|
| BLAKE2b-256 |
2ed1772935bdca1e0b4b6ce56fce2aadeb3159f6993ffe1eab64c10c18e4293a
|
Provenance
The following attestation bundles were made for xian_tech_compiler_core-0.1.1-cp314-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on xian-technology/xian-contracting
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_compiler_core-0.1.1-cp314-abi3-macosx_11_0_arm64.whl -
Subject digest:
2b78d176ca2b855f34b4d659ce2f4f7369724274ebcdbeda3f4616dadc06b1a7 - Sigstore transparency entry: 1541987249
- Sigstore integration time:
-
Permalink:
xian-technology/xian-contracting@22c3b12cb2d77d70ed6c3fca7f64cdfea5c61f3e -
Branch / Tag:
refs/tags/compiler-core-v0.1.1 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@22c3b12cb2d77d70ed6c3fca7f64cdfea5c61f3e -
Trigger Event:
push
-
Statement type:
File details
Details for the file xian_tech_compiler_core-0.1.1-cp314-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: xian_tech_compiler_core-0.1.1-cp314-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.14+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5391a8e0ecbc000a459f3b81c079185162373197f44c27628db31739a273c19
|
|
| MD5 |
a743a98c2fe3ec22c688a29ca700d15e
|
|
| BLAKE2b-256 |
8f93156fb757c3d70eab143c611729420a9a4971c19d552f914d4a48ea88f46f
|
Provenance
The following attestation bundles were made for xian_tech_compiler_core-0.1.1-cp314-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on xian-technology/xian-contracting
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xian_tech_compiler_core-0.1.1-cp314-abi3-macosx_10_12_x86_64.whl -
Subject digest:
d5391a8e0ecbc000a459f3b81c079185162373197f44c27628db31739a273c19 - Sigstore transparency entry: 1541987134
- Sigstore integration time:
-
Permalink:
xian-technology/xian-contracting@22c3b12cb2d77d70ed6c3fca7f64cdfea5c61f3e -
Branch / Tag:
refs/tags/compiler-core-v0.1.1 - Owner: https://github.com/xian-technology
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@22c3b12cb2d77d70ed6c3fca7f64cdfea5c61f3e -
Trigger Event:
push
-
Statement type: