Crate chip_as_code

Crate chip_as_code 

Source
Expand description

§chip_as_code

Semantic Chips — Computation as Text DNA

This crate implements the Chip as Code paradigm: policy logic as compilable, auditable, and evolvable text files.

§Quick Start

use chip_as_code::{Chip, ChipHash};

let chip = Chip::parse(r#"
    CHIP v0
    FEATURES n=2
    GATES m=1
    g0 = AND(f0,f1)
    OUTPUT = g0
"#).unwrap();

let result = chip.eval(&[true, true]).unwrap();
assert!(result);

let hash: ChipHash = chip.hash();
println!("Chip identity: blake3:{}", hash);

§Key Concepts

  • Chip: A boolean circuit defined as text DNA
  • Gate: Atomic operations (AND, OR, NOT, THRESH)
  • GateBox: Constitutional checkpoint (Commit/Ghost/Reject)
  • Evolution: Discrete evolution to learn circuits from data

§Features

  • default — Core parsing, evaluation, and evolution
  • gpu — GPU-accelerated evaluation via wgpu

§Part of the LogLine Ecosystem

All crates by danvoulez:

Re-exports§

pub use chip_ir::Chip;
pub use chip_ir::ChipHash;
pub use chip_ir::EvalError;

Modules§

chip_ir
Chip IR — Intermediate Representation for Semantic Chips
evolve
EvoChip — Discrete Evolution Engine
gatebox
GateBox — Constitutional Checkpoint
zlayer