Skip to content

Conversation

@nikomatsakis
Copy link
Member

@nikomatsakis nikomatsakis commented Jan 27, 2026

Summary

This PR consolidates several months of local development work across multiple areas of Dada.

RFC Infrastructure & Specification Workflow

  • Established RFC process with cargo xtask rfc new for creating new RFCs
  • Created RFC-0001 (String Literals) and RFC-0002 (RFC/Spec Workflow)
  • Built dada-mdbook-preprocessor for processing spec paragraphs and RFC annotations
  • Migrated from custom r[...] notation to MyST :::{spec} directive syntax
  • Added dynamic RFC listing page with GitHub-inspired UI and status badges

Testing Infrastructure

  • Added --porcelain flag for structured JSON test output (AI-friendly)
  • Implemented #:spec comment validation linking tests to spec paragraphs
  • Refactored test runner with TestOutputFormatter trait to eliminate code duplication
  • Enhanced test reports with actionable "Next Steps" guidance
  • FIXME tests now fail when they unexpectedly pass

Parser & String Literals

  • Implemented escape sequence processing (\n, \", \\, \t, \r, \{, \})
  • Added TokenText interned struct for processed literal content
  • Comprehensive parser documentation for commitment model and error handling

Type System

  • Documented constraint system for type inference
  • Reworked predicate handling
  • Modified inference variable fallback behavior

Language Features

  • Support standalone statements at module level (desugar to implicit main)

Documentation & Developer Experience

  • Restructured docs into .development/ directory (architecture, patterns, workflows)
  • Streamlined CLAUDE.md with socratic-shell collaboration patterns
  • Added tutorial files demonstrating language features

Code Quality

nikomatsakis and others added 30 commits May 25, 2025 05:57
Establishes .ongoing/ directory for tracking work that spans multiple sessions
and adds detailed documentation of the type inference constraint system.
Also removes unused predicate tracking from inference variables.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
When we require a permission is a given
predicate, we do not put that permission
into a surrounding context
VSCode's ansi preview mode still works.
Refactor test result handling to distinguish between passed tests,
failed tests, and FIXME tests. When a test marked as FIXME passes,
it's now reported as a test failure to alert that the bug may have
been fixed and the FIXME marker should be removed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
They desugar to a main function.
This commit restructures the documentation to provide clearer guidance
for both Claude AI sessions and human contributors:

- **CLAUDE.md**: Streamlined to focus on Claude-specific behavior
  guidelines, emphasizing checking .development/ docs first before
  exploring patterns. Adds instructions for multi-session work tracking.

- **CONTRIBUTING.md**: Rewritten to clarify that Dada is a personal
  experimental project. Sets expectations about PR size and coordination
  needs while remaining welcoming to contributions.

- **.development/**: Added comprehensive documentation structure with:
  - architecture.md: Compiler structure and design
  - patterns.md: Code conventions and established patterns
  - workflows.md: Build, test, and development processes
  - documentation.md: Rustdoc guidelines and standards
  - rfc.md: RFC workflow and specification development

The new structure separates concerns between AI-specific instructions
(CLAUDE.md), human contributor guidelines (CONTRIBUTING.md), and
detailed development documentation (.development/).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Created comprehensive documentation for the dada-parser crate to help
understand its architecture and usage patterns:

- Added components/dada-parser/docs/overview.md with detailed explanation
  of the parser's design, including:
  - Parse trait and its helper methods
  - Parse vs eat method distinction
  - Commitment model for error recovery
  - Practical examples from the codebase

- Included the overview in lib.rs using doc attribute to make it
  discoverable via rustdoc

This documentation will help future development of parser features like
string interpolation by clarifying existing patterns and conventions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit establishes the RFC process for Dada language development
and introduces the first RFC for string literal design:

**RFC Infrastructure:**
- Set up rfcs/ and spec/ directories with mdbook configuration
- Created RFC-0001 for string literals with comprehensive design
- Added ongoing work tracking in .claude/ for multi-session coordination

**RFC-0001: String Literals**
- Defines interpolated string literals as the default syntax using {}
- Supports both single ("") and triple quotes (""") variants
- Includes automatic dedenting for multiline strings starting with newline
- Provides "\" escape hatch to disable auto-dedenting
- Learning from Rust's evolution and JavaScript template literal success

The RFC includes executable examples using assert syntax and addresses
common questions about design choices. Implementation tracking files
(impl.md, spec.md, todo.md) are set up for future development work.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added tutorial files demonstrating various Dada language features,
including string interpolation examples that relate to RFC-0001:

- String interpolation examples (02-hello-world-with-interpolation.dada)
- Permission system tutorials (sharing, leasing, our values)
- Type system examples (owned vs copy types, value type splits)
- Method and trait examples
- WebAssembly compilation examples

Includes corresponding test reports showing current compilation status.
These tutorials serve as both documentation and test cases for language
features as they are implemented.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Create dada-mdbook-preprocessor to handle r[...] label processing
- Replace manual CSS configuration with automated inline injection
- Preprocessor scans chapters for labels and injects styles only where needed
- Add site-url configuration to fix subpath rendering issues
- Update deploy script to build both RFC and spec mdbooks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Document the successful implementation of inline CSS injection approach
and mark CSS consolidation task as completed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add `cargo xtask rfc new` command that auto-finds next RFC number
- Create RFC-0000 template as reusable skeleton for new RFCs
- Update workflow documentation with streamlined creation process
- Fix typo in string literals RFC (dicsable → disable)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Prevents accidentally committing generated documentation files
from RFC and spec book builds.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add populate_rfc_sections() to automatically generate RFC listings
- Simplify SUMMARY.md to use dynamic "All RFCs" page instead of manual sections
- Update RFC templates with minor formatting improvements
- Track implementation progress in ongoing workflow documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add polished table design with status-based categorization
- Implement shields.io status badges for visual RFC status indication
- Create collapsible summary rows with disclosure triangles in number column
- Enable proper markdown rendering in summary content with strategic newlines
- Add comprehensive CSS styling with dark theme support
- Integrate AI memory comment system into CLAUDE.md for persistent knowledge
- Update ongoing task documentation with completion status

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This implements Phase 1-3 of the test-spec linking design from the RFC workflow:

**Core Features:**
- Added `spec_refs` field to `TestExpectations` struct to track spec references
- Created `SpecValidator` module that scans spec mdbook and extracts all `r[...]` labels
- Integrated validation into test runner with clear error reporting
- Added `InvalidSpecReference` failure type for invalid spec references

**Usage:**
Test files can now include `#:spec topic.subtopic.detail` annotations that are validated against actual spec paragraphs. Invalid references are reported as test failures with helpful error messages.

**Implementation Details:**
- Parser recognizes `#:spec` configuration comments in test file headers
- Validator recursively scans `spec/src/` directory for markdown files
- Extracts spec IDs using regex pattern `r\[([^\]]+)\]`
- Validation runs during test execution and reports failures in test reports
- Added dependencies: serde, serde_yaml for future YAML processing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive tokenizer documentation for string literal processing
- Document Parse trait commitment model and error handling patterns
- Document expression parsing and literal integration
- Identify missing escape sequence processing bug
- Update ongoing task tracking with completed documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add TokenText interned struct for processed literal content
- Update TokenKind::Literal to use TokenText instead of &str
- Implement escape sequence processing in tokenizer (\n, \", \\, \t, \r, \{, \})
- Update parser to extract processed text from TokenText
- Add escape sequence test case
- Bless operator precedence test reference for new AST structure

This fixes the bug where escape sequences were validated but never interpreted.
String literals now correctly process escape sequences during tokenization while
keeping tokens Copy through Salsa interned structs.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add design document for --porcelain flag to provide structured JSON test output
that AI assistants can easily parse and act upon. Current test failures only
show "Error: 1 test failure(s)" with no actionable information.

Proposed solution:
- JSON output with test status, failure reasons, and specific suggestions
- Clear categorization of failure types (blessing vs code fixes)
- Structured format for programmatic consumption
- CLAUDE.md documentation for AI assistant parsing instructions

Status: Design phase - needs approval before implementation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Created RFC-0002 using cargo xtask rfc new command
- Documented complete RFC-to-spec integration with rfc[123] annotations
- Designed interactive specification viewer with expandable RFC content
- Compared mdbook vs Sphinx tooling approaches with hybrid recommendation
- Validated RFC process by using it to document itself
- Removed spec.md from RFC template (spec text goes in main spec)
- Updated ongoing task tracking with session progress

Key design elements:
• RFC annotations: rfc[123] or rfc[123, 456] for concurrent development
• Interactive viewer: stable default with visual RFC indicators
• Test integration: prefix matching already implemented
• Tooling: custom Sphinx extension for layered HTML output

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…inability

Major refactoring of the test infrastructure to eliminate significant code
duplication between regular and porcelain test modes while maintaining full
functionality.

Key improvements:
- Created TestOutputFormatter trait with RegularFormatter and PorcelainFormatter
- Unified test execution into single run_test() function that always captures
  timing and annotations
- Eliminated duplicate functions: run_test_detailed, test_regular, test_porcelain
- Added proper Sync + Send trait bounds for parallel execution
- Moved helper functions outside impl block for better organization

All functionality preserved:
- Regular mode: Shows progress bars and "All X tests passed" messages
- Porcelain mode: Outputs structured JSON with timing and annotations
- Verbose mode: Shows individual test progress
- Parallel execution: Works correctly with trait bounds

Architecture improvements:
- More maintainable: Single execution path, clear separation of concerns
- More extensible: Easy to add new output formatters via trait
- Less error-prone: No duplicate logic to keep in sync
- Better tested: Single code path ensures consistent behavior

~100+ lines of duplicate code eliminated with significant maintainability gains.

Two follow-up issues identified for future work:
1. Porcelain output purity: Error messages printed before JSON
2. Failure detail actionability: Assess whether to include test report content

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Simplified analyze_failure() to always return "test_failure" and point to test reports
- Enhanced test reports with "🎯 Next Steps" section providing intelligent guidance
- Added accurate diagnostic annotation format details (#\! syntax with regex support)
- Updated CLAUDE.md with concise test failure handling guidance

This moves complex failure analysis from porcelain JSON into rich test reports,
making the system both simpler and more helpful for AI assistants.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Final status: PRODUCTION READY with simplified porcelain output and enhanced test reports.
All follow-up issues resolved and architecture improvements documented.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Work is complete and documented in git history.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
nikomatsakis and others added 5 commits July 24, 2025 05:34
Remove verbose test output documentation and redundant sections while
preserving essential actionable information. The test command and
suggestion field guidance remain, but detailed JSON schema and separate
failure handling sections are consolidated into a single clear sentence.

Also integrate socratic-shell collaboration patterns for tracking work
and authoring insightful code comments.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
These tracking files have been replaced by GitHub tracking issues dada-lang#255
and dada-lang#256, which provide better visibility and persistence.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The test used `# Surprise!` instead of `#!` for the expected error
annotation, causing the test framework to not recognize it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace custom `r[...]` and `rfc[...]` notation with MyST `{spec}` directive:
- `:::{spec} paragraph.id [rfcN...] [!rfcN...]` carries ID and RFC metadata
- `!rfcN` prefix marks content deleted by an RFC
- Commit to MyST/Sphinx tooling approach

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update spec files and tooling to use the new :::{spec} directive
format as specified in RFC-0002. The mdbook preprocessor now handles
block directives with optional RFC tags for tracking changes.

Closes the first two items in dada-lang#255.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Jan 27, 2026

Deploy Preview for dada-lang failed. Why did it fail? →

Name Link
🔨 Latest commit 1e16524
🔍 Latest deploy log https://app.netlify.com/projects/dada-lang/deploys/697a0a05dd4a310008a006a7

Remove dead code including unused timeout_warning module and
unused RfcInfo fields. Apply clippy auto-fixes for format strings,
Option::map, and other minor issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
nikomatsakis and others added 5 commits January 27, 2026 06:36
Change &PathBuf to &Path and inline format args.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collapse nested if statements with if-let chains per clippy guidance.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Collapse nested if statements (collapsible_if) in multiple components
- Convert loop with let-else break to while let (while_let_loop) in parser
- Remove stable feature flag panic_payload_as_str (stable since 1.91)
- Suppress dead_code warning for Assets struct used by derive macro

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The deploy job uses mdbook to build RFC and spec documentation but
wasn't installing it first.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant