Skip to main content

Crate cairn_core

Crate cairn_core 

Source
Expand description

Cairn core.

Owns the model. Every other crate in the workspace is a thin front end over this one and never re-implements or bypasses checking (see docs/design.md Section 7). v0.1 build step 1 — the content-addressed AST store — lives in node and store. Later steps add the checker, renderer, and WASM lowering on top of this.

Re-exports§

pub use check::Checker;
pub use check::Failures;
pub use check::Report;
pub use check::Status;
pub use check::Violation;
pub use edit::EditError;
pub use edit::Editor;
pub use edit::ExprSpec;
pub use edit::FunctionSpec;
pub use edit::HoleInfo;
pub use edit::ModuleSpec;
pub use edit::SignatureInfo;
pub use edit::StepSpec;
pub use edit::TypeDefSpec;
pub use node::BinOp;
pub use node::MatchArm;
pub use node::Node;
pub use node::NodeHash;
pub use node::Param;
pub use node::Produces;
pub use render::node_at;
pub use render::render;
pub use render::render_addressed;
pub use render::Addressed;
pub use render::Span;
pub use scaffold::AppSpec;
pub use scaffold::EntitySpec;
pub use scaffold::FieldKind;
pub use scaffold::FieldSpec;
pub use store::Materialized;
pub use store::Store;
pub use store::FORMAT_VERSION;
pub use live::serve_http_live;
pub use live::LiveHub;
pub use ty::Confidence;
pub use ty::Effect;
pub use ty::Type;
pub use wasm::drain_published;
pub use wasm::drain_resp_headers;
pub use wasm::lower;
pub use wasm::run_effectful_i64;
pub use wasm::run_fallible;
pub use wasm::run_i64;
pub use wasm::serve_http;
pub use wasm::serve_http_db;
pub use wasm::serve_once;
pub use wasm::serve_request;
pub use wasm::serve_request_db;
pub use wasm::serve_request_db_h;
pub use wasm::serve_request_h;
pub use wasm::HttpResponse;
pub use wasm::LowerError;
pub use wasm::RunError;

Modules§

check
The single Core checker.
edit
The transactional authoring API — the substance behind the MCP tool surface (docs/design.md Sections 6 and 9).
json
A JSON value type and codec — authored in Cairn, exactly like the web framework and the stdlib. Json is a nominal recursive variant (Cairn variants are monomorphic — JSON is monomorphic, so this is a natural fit, not the generic-types boundary §9 records).
live
The in-process live hub (design.md §10, slice 4a/4c).
node
The content-addressed AST node model.
render
The projection renderer: a stored tree → the Section 5 text.
scaffold
The structural scaffolder — Cairn’s analogue of Rails generators. Records are nominal and monomorphic, so the mechanical CRUD shell (*_from_rows, save/save_step, table DDL) would otherwise be hand-duplicated per entity. This generates that shell’s AST from one declarative EntitySpec.
stdlib
The standard library — written in Cairn, authored through the one Core API, exactly like the Tier-2 web framework.
store
The content-addressed node store, backed by SQLite.
ty
The value-level model: types, confidence, effects.
wasm
WASM lowering, and running the result under wasmtime.
web
The Tier-2 web framework — written in Cairn, authored through the one Core authoring API (docs/design.md Section 7 symmetry).

Constants§

CRATE
Crate marker. Kept so the front-end crates have a stable symbol to depend on until they call real core API.