Compare commits

...

2 Commits

Author SHA1 Message Date
85274abe52 idea 2026-01-28 12:22:02 -08:00
e59555b3e3 lib 2026-01-28 12:21:46 -08:00
4 changed files with 30 additions and 0 deletions

4
Cargo.lock generated
View File

@@ -813,6 +813,10 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f"
[[package]]
name = "dag"
version = "0.1.0"
[[package]]
name = "ddsfile"
version = "0.5.2"

View File

@@ -7,6 +7,7 @@ members = [
"integration-testing",
"lib/bsp_loader",
"lib/common",
"lib/dag",
"lib/deferred_loader",
"lib/fixed_wide",
"lib/linear_ops",

9
lib/dag/Cargo.toml Normal file
View File

@@ -0,0 +1,9 @@
[package]
name = "dag"
version = "0.1.0"
edition = "2024"
[dependencies]
[lints]
workspace = true

16
lib/dag/src/lib.rs Normal file
View File

@@ -0,0 +1,16 @@
// typestate dag with lazy just-in-time execution
struct States<S1,S2>(S1,S2);
struct Known<T>(T);
struct NeedsRecalculate;
fn a(){
// Construct a DAG such that S2 depends on S1
// let dag=Dag:new();
// Initial state
let state=States(Known(1),Known(1));
// set_state1 changes S2 to NeedsRecalculate
state.set_state1(2);
// get_state2 calculates S2
let s2=state.get_state2();
}