Skip to main content

dryv-compiler

dryv-compiler is the Python Author compiler/provider for Dryv.

It captures the typed AuthorState snapshot from the project's dryv.app(...) (in the project's own Python, via execution/bootstrap.py), resolves author handles to canonical JSON Pointers, and lowers the states into dryv.ir/v1alpha1. The engine's contract models and validate_runtime_ir are the final authority; the compiler never accepts IR the engine rejects.

Commands

dryv-py doctor ./dryv.py
dryv-py compile ./dryv.py
dryv-py stdio

stdio uses the canonical Dryv Authoring Protocol.

Request example:

{"type":"compile-request","session_id":"build-1","entrypoint":"./dryv.py","protocol_versions":["dryv.authoring/v1alpha1"],"runtime_ir_versions":["dryv.ir/v1alpha1"],"batch_size":64}

Provider messages use canonical types such as:

provider-hello
begin
batch
diagnostic
end
error
cancelled

How lowering works

dryv.app(...).snapshot()        typed AuthorState (dryv_author.state)
    ↓ mapping/index.py          identities → canonical names and pointers
    ↓ mapping/encode.py         states → canonical JSON; query "*" expansion;
                                projection selections → canonical projection fields
    ↓ mapping/compile.py        DryvIR.model_validate + validate_runtime_ir
    ↓ protocol/records.py       one record per registry entry, with author origins

Author states mirror canonical shapes, so lowering is structural. Registry names are group-qualified (group.Name). The app itself is emitted as the application named by its key.

Parity: tests/test_compiler.py compiles tests/fixtures/faidibiz_app.py (a port of the TypeScript faidibiz example) and, when bun is available, asserts the same semantic digest as the TypeScript compiler.

Canonical naming

The compiler must normalize Dryv-owned wire vocabulary regardless of Python Author implementation details:

Dryv-owned object keys     -> lower_snake_case
Dryv-owned fixed values    -> lower-kebab-case
Authored identifiers       -> preserve exactly
Reserved/external tokens   -> preserve governing spelling

Canonical examples include:

session_id
runtime_ir_version
property-primitive
property-generic
provider-hello
$ref

The compiler must never apply a blind recursive case converter because authored names and standards-owned values are opaque.

See .docs/reference/ir/naming.md and .docs/reference/ir/properties.md.

Responsibility boundary

The compiler may:

  • validate Author/compiler compatibility;
  • inspect and execute the Python authoring environment;
  • validate Python Author state;
  • resolve symbolic relationships;
  • classify implementation-specific declarations into canonical concepts;
  • normalize canonical key/value spelling;
  • compile to Runtime-owned IR contracts;
  • stream deterministic Authoring Protocol records;
  • preserve source/provenance diagnostics.

It must not:

  • create a competing semantic model;
  • generate application source code;
  • select template packs;
  • choose output paths;
  • write generated project files;
  • own persisted Runtime serialization.

Equivalent Python and TypeScript authored meaning must converge on equivalent canonical Runtime IR.

Development

uv sync
uv run ruff format .
uv run ruff check --fix .
uv run mypy
uv run pytest
uv build

Release files for dryv-compiler 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dryv-compiler 0.0.1
File Size Uploaded
dryv_compiler-0.0.1.tar.gz 68.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dryv-compiler 0.0.1
File Interpreter ABI Platform
dryv_compiler-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 96.3 kB

Release files / dryv_compiler-0.0.1.tar.gz

Download URL dryv_compiler-0.0.1.tar.gz
Size 68.3 kB
Tags Source
SHA-256 checksum
How to use checksums
76dee900a2ca67d36a1c8eb648c2a7ff7a9b3f653ab48e204f87540f8ba9626d
BLAKE2b-256 checksum
How to use checksums
61aafd3fd0a18184c73580c6ff37b778c38422ed49a1c2718451829700052ec6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / dryv_compiler-0.0.1-py3-none-any.whl

Download URL dryv_compiler-0.0.1-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49e8fa9dac838d5285f77792201bcb17dd7a5ff8809dfe4ff0c5c52628895548
BLAKE2b-256 checksum
How to use checksums
9c4740d07672d633e642caaae19e4da4a50bbda45b180201f832932c94e785f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release 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