Skip to content

Repository files navigation

ALUX Rust

Build and Test License

Reusable Design by Meaning infrastructure for typed programs and their interpreters.

ALUX expects many independently published specification crates. This workspace provides the common operation and interface-program vocabulary without centralizing their domain algebras. Each crate has one role: it either defines a meaning, or interprets that meaning for a particular purpose.

Specifications

What a surface means, with no interpreter in it. These depend only on alux-ext and sit at the top level of the repository. The attribute or derive that goes with one is a separate crate, because a procedural macro has to be, and those live under macros/.

Crate Responsibility
alux-http crates.io docs.rs HTTP programs and server, no web framework
alux-jsonrpc crates.io docs.rs JSON-RPC programs, no RPC framework
alux-shape
alux-shape-macros
crates.io docs.rs
crates.io docs.rs
Data shapes, no encoder
The derive reading one out of a layout
alux-ext
alux-ext-macros
crates.io docs.rs
crates.io docs.rs
First-order operations and context handles
The ext attribute and its macros
alux-sdk
alux-sdk-macros
crates.io docs.rs
crates.io docs.rs
Transformations kept as expressions
The macros it exports
alux-traversable crates.io docs.rs traverse over Option and iterators
alux-bench crates.io docs.rs What a benchmark measures, no harness

Interpretations

These crates are interpreters, or implementations, of the specifications above. They consume a specification and interpret its meaning for a concrete target, such as a web framework, a document, or a client. Each is published separately under crates/, so specifications can be used without any particular interpreter and the same specification can have several implementations.

Of an HTTP program

Framework-backed execution:

Crate Interprets a program as
alux-http-axum crates.io docs.rs executable axum routes
alux-http-actix crates.io docs.rs executable Actix Web routes
alux-http-rocket crates.io docs.rs executable Rocket routes
alux-http-warp crates.io docs.rs executable warp filters
alux-http-poem crates.io docs.rs executable Poem routes
alux-http-salvo crates.io docs.rs executable Salvo routes

Framework-free execution:

Crate Interprets a program as
alux-http-hyper crates.io docs.rs a hyper service around the direct interpretation
alux-http-direct crates.io docs.rs direct request and response handling

Documentation and clients:

Crate Interprets a program as
alux-http-typescript crates.io docs.rs a TypeScript client module
alux-http-openapi crates.io docs.rs an OpenAPI document
alux-http-text crates.io docs.rs documentation or metadata

Shared HTTP support:

Crate Provides
alux-http-parts crates.io docs.rs shared multipart reading
alux-http-conformance crates.io docs.rs shared HTTP scenarios

Of a JSON-RPC program

Crate Interprets a program as
alux-jsonrpc-typescript crates.io docs.rs a TypeScript client module
alux-jsonrpc-jsonrpsee crates.io docs.rs jsonrpsee Methods
alux-jsonrpc-direct crates.io docs.rs a message handler, no framework

Of a data shape

Crate Interprets a shape as
alux-shape-rust crates.io docs.rs a Rust layout
alux-shape-typescript crates.io docs.rs TypeScript declarations
alux-shape-json crates.io docs.rs a decision about a JSON value
alux-shape-jsonschema crates.io docs.rs a JSON Schema document
alux-shape-text crates.io docs.rs a readable description
alux-shape-term crates.io docs.rs the term itself
alux-shape-morph crates.io docs.rs another shape

Of a benchmark

Crate Measures a stated bench with
alux-bench-criterion crates.io docs.rs criterion groups and functions
alux-bench-direct crates.io docs.rs its own runner, saying each case as it finishes

Other interpretations

Crate Interprets a value as
alux-tokio crates.io docs.rs bounded Tokio channels

Semantic shape

published domain spec
    -> tiny capability traits and derived extensions
    -> first-order operations
    -> portable HTTP / JSON-RPC programs
    -> separately published interpreter crate

Domain specifications depend on alux-ext and whichever transport program crates they expose. Applications add the interpreter crates they run and configure them.

Documentation

The ALUX programming guidelines teach the method this workspace follows: designing programs by meaning first, in the style of Conal Elliott's Denotational Design, with a concrete path into Rust. Read them for the reasoning behind the rules below.

Development

just ci

That runs, in order, just fmt, just build, just clippy, just doc, just test, and just package. Each is also runnable on its own during development. The Justfile holds the full command every recipe stands for.

Publication

Packages are licensed under MIT. Publish and verify them in this order, allowing the crates.io index to update between dependent packages:

  1. alux-ext-macros, alux-sdk-macros, and alux-shape-macros in any order
  2. alux-ext
  3. alux-bench, alux-http, alux-jsonrpc, alux-shape, and alux-traversable in any order
  4. alux-sdk, alux-shape-json, alux-shape-text, and alux-shape-typescript in any order
  5. alux-shape-jsonschema, alux-http-parts, alux-http-text, alux-http-direct, alux-http-conformance, alux-http-poem, alux-http-actix, alux-http-axum, alux-http-hyper, alux-http-openapi, alux-http-rocket, alux-http-salvo, alux-http-typescript, alux-http-warp, alux-jsonrpc-jsonrpsee, alux-jsonrpc-direct, alux-jsonrpc-typescript, alux-shape-rust, alux-shape-term, alux-shape-morph, alux-bench-direct, alux-bench-criterion, and alux-tokio in dependency order where needed

Cargo cannot fully package later steps against crates.io until the preceding package version is available there.

Releases

Contributors

Languages