Releases: univrs/dol
Releases · univrs/dol
DOL v0.8.1
Codegen Improvements for wasm-bindgen Compatibility
This release adds critical codegen improvements enabling DOL to compile to WASM with proper thread-safe global state management.
Key Changes
- Module path conversion:
.→::for Rust module paths - Integer literal cleanup: Remove
_i64suffix, rely on Rust type inference - Attribute translation:
#[wasm_export]→#[wasm_bindgen] - Thread-local pattern: Generate
thread_local!withRefCellfor sex var declarations
Thread-local Access Patterns
// DOL source
sex var GRID: Option<Grid> = None
// Generated Rust
thread_local! {
static GRID: RefCell<Option<Grid>> = RefCell::new(None);
}
// Reads: GRID → GRID.with(|v| v.borrow().clone())
// Writes: GRID = x → GRID.with(|v| *v.borrow_mut() = x)
// Field access: CONFIG.width → CONFIG.with(|v| v.borrow().width)Game of Life Spirit
- Renamed
sex/directory toeffects/for semantic clarity - Added generated Rust code in
codegen/rust/src/generated/ - Added comprehensive benchmark documentation
- Updated build script with integrated codegen pipeline
Testing
- All 541+ tests passing
- Game of Life compiles and runs successfully in browser
Full Changelog: v0.8.0...v0.8.1
DOL v0.8.0
Language Changes
New Preferred Keywords
genreplacesgenefor genome declarationsrulereplacesconstraintfor constraint declarationsevoreplacesevolvesfor evolution declarationsdocsreplacesexegesisfor documentation blocks
Modernized Type Names (Rust-aligned)
stringreplacesStringboolreplacesBooli8,i16,i32,i64replaceInt8,Int16,Int32,Int64u8,u16,u32,u64replaceUInt8,UInt16,UInt32,UInt64f32,f64replaceFloat32,Float64()replacesVoidfor unit typeVec<T>replacesList<T>for vectors
Deprecated Syntax (warnings in 0.8, errors in 0.9)
The old keywords and types are deprecated but still supported with compiler warnings.
New Features
Tree Shaking
- Added
TreeShakingpass for dead code elimination - Analyzes dependency graphs to identify unreachable declarations
- Public declarations and their transitive dependencies are preserved
- Use
--tree-shakeflag indol-parseCLI
CLI Improvements
dol-parse --tree-shake- Enable tree shakingdol-parse --roots <names>- Specify additional root declarationsdol-parse --shake-analyze- Dry-run to preview eliminations- Output formats (pretty, JSON, compact, debug) show eliminated declarations
Migration Tool
dol-migrate 0.7-to-0.8 <path>- Automatic syntax migration--dry-runflag to preview changes--diffflag to show before/after--modernizeflag for return statement updates
Internal Changes
- Lexer updated with new keywords and type tokens
- Parser supports both old and new syntax
- Deprecation warnings emitted at parse time with source locations
- Type name normalization in codegen
Migration
# Auto-migrate your DOL files to v0.8.0 syntax
cargo run --bin dol-migrate --features cli -- 0.7-to-0.8 src/
# Preview changes first
cargo run --bin dol-migrate --features cli -- 0.7-to-0.8 --diff src/DOL v0.7.2
Breaking Change
Replace self. with this. in method bodies for instance self-reference.
Features
- Add
thiskeyword for instance self-reference (DOL 2.0) - Add
Expr::ThisAST variant with full compiler support - Update all example files to use
this.field/this.method()syntax - WASM compiler stub for
this(full support coming later)
Design Rationale
Chose this over self because:
- Differentiates DOL from Rust's
selfconventions - Broader familiarity (JS, Java, C++, C#, TypeScript)
- Emphasizes genes as domain objects, not implementation structs
Note: Self remains as the type-level self-reference (standard convention).
Migration
- self.value
+ this.value
- self.method()
+ this.method()DOL v0.7.1
Release v0.7.1
DOL v0.7.0
DOL v0.7.0
Bug Fixes
WASM Compiler Fixes (PR #9)
- Fixed duplicate global section bug in
compile_file()that caused "failed to parse WebAssembly module" errors - Fixed enum type comparison using wrong instruction (
i32.eqinstead ofi64.eqafter widening)
Sex System Integration (PR #8)
- Added
SexVardeclaration variant for mutable global state - Fixed
WasmImportstruct andLocalsTablefield definitions - Fixed
Consttype mismatch in AST
Test Results
- All 44 WASM execution tests pass
- Full test suite passes on Ubuntu, macOS, and Windows
- Code coverage maintained
What's Included
dol-parse- Parse and validate DOL filesdol-check- Validation CLIdol-test- Test generator CLI- WASM compilation support (45% complete)
- Sex/Effect system for side-effect tracking
DOL v0.6.0
Features
- Gene Inheritance: Child genes can now extend parent genes with
gene Child extends Parent- Child fields are laid out after parent fields in memory
- Topological ordering ensures parents are registered before children
- Child methods can access inherited parent fields
Changes
compute_gene_layoutnow copies parent fields first, preserving offsets- Added
compile_file(&DolFile)for multi-gene file compilation - Added
register_gene_layouts_ordered()for topological sorting - Extended
GeneContextto include parent field names
Tests
- 31 WASM execution tests passing (up from 28)
- Added 3 new inheritance-specific tests
Installation
cargo install dolOr add to your Cargo.toml:
[dependencies]
dol = "0.6.0"v0.5.1-wasm-complete
What's Changed
- feat(wasm): implement member access, function lookup, and gene methods by @ardeshir in #1
- feat(wasm): DOL to WebAssembly compilation with gene method support by @ardeshir in #2
New Contributors
Full Changelog: v0.4.1...v0.5.1-wasm-complete
v0.5.0-investigation
Full Changelog: v0.4.1...v0.5.0-investigation
DOL v0.4.1
Phase 3+4: WASM Pipline, Hyphal Network, ENR Foundation
v0.4.0-hir
Full Changelog: v0.3.1...v0.4.0-hir