Skip to content

Releases: univrs/dol

DOL v0.8.1

26 Jan 05:40

Choose a tag to compare

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 _i64 suffix, rely on Rust type inference
  • Attribute translation: #[wasm_export]#[wasm_bindgen]
  • Thread-local pattern: Generate thread_local! with RefCell for 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 to effects/ 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

17 Jan 05:14

Choose a tag to compare

Language Changes

New Preferred Keywords

  • gen replaces gene for genome declarations
  • rule replaces constraint for constraint declarations
  • evo replaces evolves for evolution declarations
  • docs replaces exegesis for documentation blocks

Modernized Type Names (Rust-aligned)

  • string replaces String
  • bool replaces Bool
  • i8, i16, i32, i64 replace Int8, Int16, Int32, Int64
  • u8, u16, u32, u64 replace UInt8, UInt16, UInt32, UInt64
  • f32, f64 replace Float32, Float64
  • () replaces Void for unit type
  • Vec<T> replaces List<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 TreeShaking pass for dead code elimination
  • Analyzes dependency graphs to identify unreachable declarations
  • Public declarations and their transitive dependencies are preserved
  • Use --tree-shake flag in dol-parse CLI

CLI Improvements

  • dol-parse --tree-shake - Enable tree shaking
  • dol-parse --roots <names> - Specify additional root declarations
  • dol-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-run flag to preview changes
  • --diff flag to show before/after
  • --modernize flag 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

15 Jan 20:39

Choose a tag to compare

Breaking Change

Replace self. with this. in method bodies for instance self-reference.

Features

  • Add this keyword for instance self-reference (DOL 2.0)
  • Add Expr::This AST 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:

  1. Differentiates DOL from Rust's self conventions
  2. Broader familiarity (JS, Java, C++, C#, TypeScript)
  3. 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

04 Jan 06:29

Choose a tag to compare

Release v0.7.1

DOL v0.7.0

03 Jan 20:00

Choose a tag to compare

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.eq instead of i64.eq after widening)

Sex System Integration (PR #8)

  • Added SexVar declaration variant for mutable global state
  • Fixed WasmImport struct and LocalsTable field definitions
  • Fixed Const type 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 files
  • dol-check - Validation CLI
  • dol-test - Test generator CLI
  • WASM compilation support (45% complete)
  • Sex/Effect system for side-effect tracking

DOL v0.6.0

01 Jan 17:46

Choose a tag to compare

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_layout now copies parent fields first, preserving offsets
  • Added compile_file(&DolFile) for multi-gene file compilation
  • Added register_gene_layouts_ordered() for topological sorting
  • Extended GeneContext to include parent field names

Tests

  • 31 WASM execution tests passing (up from 28)
  • Added 3 new inheritance-specific tests

Installation

cargo install dol

Or add to your Cargo.toml:

[dependencies]
dol = "0.6.0"

v0.5.1-wasm-complete

01 Jan 16:27

Choose a tag to compare

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

01 Jan 17:50

Choose a tag to compare

DOL v0.4.1

29 Dec 05:49

Choose a tag to compare

Phase 3+4: WASM Pipline, Hyphal Network, ENR Foundation

v0.4.0-hir

28 Dec 22:49

Choose a tag to compare