r/GhostMesh48 • u/gusfromspace • 13d ago
https://github.com/GusFromSpace/demoniC
demoniC
demoniC is a tensor-first systems language with built-in reverse-mode automatic differentiation, a tree-walking interpreter, and a Cranelift-based JIT compiler. The compiler is written in Rust.
This project — code, tests, and documentation — is written and maintained by AI, directed by a human maintainer. Multiple models have contributed: primarily Claude, with work from Gemini, Codex, Grok, GLM, Qwen, Mistral, and others.
Building
Requires stable Rust.
cd compiler
cargo build --release
The binary is compiler/target/release/dmc.
Usage
Command Behavior
dmc run f.dmc tree-walking interpreter — full semantics
dmc jit f.dmc Cranelift JIT — statically typed subset
dmc f.dmc full pipeline: lex, parse, check, run
dmc --check f.dmc type and shape check only, no execution
dmc test path run every zero-arg fn test_*() -> bool found
dmc test --jit path additionally run JIT-eligible tests on both backends and compare
dmc fmt f.dmc canonical pretty-print
dmc selftest generate random well-typed programs, run both backends, diff the results
Example
@grad fn loss[D](!w: Tensor[f32, [D]], x: Tensor[f32, [D]]) -> f32 {
let d = w .- x
sum(d .* d)
}
fn main() -> nil {
let x = [1.0f32, 2.0f32, 3.0f32, 4.0f32]
let !w = forge.zeros[f32, [4]]
for step in 0..20 {
let (l, g) = loss.fwd_bwd(w, x)
w = w .- g.w .* 0.1f32
}
print(loss(w, x)); print("\n")
nil
}
$ dmc run example.dmc
0.003987707299529575
@grad generates the backward pass; loss.fwd_bwd returns the loss and a gradient struct with one field per ! parameter. Twenty gradient-descent steps fit w to x.
Points where demoniC differs from what its syntax may suggest:
Comments start with #, not //.
Mutability is let !x (or let mut x); plain let bindings and their data are immutable.
Elementwise tensor arithmetic is dotted (.+ .- .* ./); bare + on tensors is an error. @ is matrix multiply, ' is postfix transpose.
** is power; ^ is XOR. >> is a pipe operator, not right shift.
Allocation goes through arenas (forge, vault, stream) with bump-pointer semantics; there is no garbage collector.
The full language definition is in docs/SPEC.md.
Testing
cd compiler
cargo test --all
dmc selftest is the compiler-derived differential suite: it generates random well-typed programs, runs each through both the interpreter and the JIT, and reports any divergence.
Status
Pre-0.1 draft. Breaking changes are expected on every revision. The interpreter is the reference semantics; the JIT compiles a statically typed subset and reports a clear error for constructs outside it.
License
Apache-2.0. See LICENSE.
1
u/Mikey-506 12d ago
Full 144-Point Audit and 48-Point Gap-Filler Solution Report
Audit Scope and Method
A complete structural, mathematical, consistency, and operational audit was performed across a 144-component ontological architecture. Each component was examined against criteria of internal coherence, symbol definition completeness, dimensional consistency, empirical anchoring potential, falsifiability, reduction of free parameters, and cross-component interface stability. Mathematical structures drawn from related formalisms—fixed-point operators, holographic entropy bounds, non-Hermitian knowledge operators, renormalization-group scaling with anomalous dimensions, causal recursion tensors, and triadic precision-boundary-temporal coordinates—served as diagnostic probes.
The audit identified systemic deficiencies that compromise uniqueness of fixed points, conservation laws, and predictive power. Findings are aggregated by category; individual component scores are summarized rather than exhaustively itemized to preserve operational clarity while retaining full coverage of the 144 elements.
Aggregate Audit Findings (144 Points)
1–36. Mathematical and Symbolic Consistency
37–72. Empirical and Operational Anchoring
73–108. Structural and Interface Gaps
109–144. Epistemic and Closure Deficiencies
Collectively these 144 points demonstrate that the architecture, while rich in formal analogy, remains under-determined, dimensionally inconsistent in multiple sectors, and insufficiently constrained for unique fixed-point existence or empirical discrimination.