brik64-core
Rust SDK beta for using BRIK64-style monomer helpers and composition utilities in application code.
Current SDK beta: 0.1.0-beta.18.2
Aligned CLI beta: 0.1.0-beta.18.2
Installation
[]
= "0.1.0-beta.18.2"
# With SHA-256 support:
= { = "0.1.0-beta.18.2", = ["sha2"] }
This crate is an SDK library. The CLI is installed separately:
|
What The SDK Provides
mc: Rust helper functions for BRIK64-style arithmetic, logic, memory, control, string, crypto, and system examples.eva: composition helpers for sequential, parallel, and conditional pipelines in ordinary Rust code.- Optional
sha2support for SHA-256 helpers. - A small API surface suitable for examples, integration tests, and application prototypes.
The crate does not install or invoke the BRIK64 CLI. Workspace inspection, certificate workflows, and CLI release behavior are handled by the separately installed CLI.
Usage
use ;
// Direct monomer use
let sum = add8; // wrapping: 44
let = div8; // (3, 2) — division by zero safe
let s = concat; // "hello world"
// EVA sequential composition ⊗
let pipeline = seq;
let result = pipeline; // add8(7,8)=15 → mod8(15,10)=5
assert_eq!;
// EVA parallel composition ∥
let dual = par;
let = dual;
assert_eq!;
assert_eq!;
// EVA conditional composition ⊕
let transform = cond;
assert_eq!;
assert_eq!;
Monomer Families
| Family | Range | Functions |
|---|---|---|
| Arithmetic | MC_00–07 | add8, sub8, mul8, div8, mod8, abs64, neg64, clamp |
| Logic | MC_08–15 | and8, or8, xor8, not8, shl8, shr8, bool_and, bool_or |
| Memory | MC_16–23 | load, store, push, pop, peek, alloc, free, len_mem |
| Control | MC_24–31 | mc_if, mc_loop, nop, halt, cmp_eq, cmp_lt, cmp_gt, mc_call |
| I/O | MC_32–39 | read_file, write_file, append_file, read_str, write_stdout, write_stderr, file_exists, file_size |
| String | MC_40–47 | concat, substr, trim, len, contains, starts_with, ends_with, char_at |
| Crypto | MC_48–55 | hash_sha256*, hash_hex*, xor_bytes, rotate_left, rotate_right, constant_eq, zero_bytes, bytes_to_hex |
| System | MC_56–63 | time_unix, time_ms, env_get, env_set, pid, args, exit_code, sleep_ms |
* Requires features = ["sha2"]
EVA Algebra
| Operator | Function | Description |
|---|---|---|
⊗ |
eva::seq |
Sequential: B(A(x)) |
∥ |
eva::par |
Parallel: (A(x), B(y)) |
⊕ |
eva::cond |
Conditional: if pred { A(x) } else { B(x) } |
Scope
This SDK provides Rust library helpers. It does not install the CLI or perform workspace certification workflows.
Digital Circuitality
License
See LICENSE.