Add Ord/Hash/Show abilities, ADT auto-derivation, Ordering ADT (v0.0.90)#300
Merged
Conversation
Complete the abilities feature (#60) with full codegen for all four built-in abilities. Register Ordering ADT and Ord/Hash/Show abilities in the type environment. Extend constraint satisfaction to all abilities with per-ability type sets. Implement ADT auto-derivation for Eq via structural equality (tag + field comparison). Add compare rewriting in Pass 1.6 and WASM-level dispatch for show (to_string routing) and hash (FNV-1a for strings, identity/extend/reinterpret for primitives). Fix IfExpr/Block handling in _infer_expr_wasm_type. Add string equality via byte-by-byte comparison. 20 unit tests, extended conformance test with 20 test functions. Version bump to 0.0.90. Documentation updated across spec, SKILL.md, README, ROADMAP, CHANGELOG, and docs/index.html. Closes #60 Co-Authored-By: Claude <noreply@anthropic.invalid>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OrderingADT:data Ordering { Less, Equal, Greater }forcompareresultsforall<T where Ability<T>>fully operational across all four abilitiesCloses #60
What changed
Compiler (8 files, +1862/−129 lines)
vera/environment.pyvera/codegen/registration.pyvera/codegen/monomorphize.pyvera/codegen/core.pycompare(a,b)rewriting to nestedIfExprvera/wasm/calls.pyshow(type-directed) andhash(FNV-1a for strings)vera/wasm/operators.pyvera/wasm/inference.pyvera/codegen/modules.pyTests (2 files)
TestAbilityConstraintscovering all 4 abilities + ADT derivation + unsatisfied constraintch09_abilities.vera(6 → 20 total)Documentation (10 files)
Test plan
pytest tests/ -v— 2375 tests passmypy vera/— cleanpython scripts/check_conformance.py— 55 conformance programs passpython scripts/check_examples.py— 25 examples passpython scripts/check_version_sync.py— version in syncpython scripts/check_doc_counts.py— counts matchpython scripts/check_limitations_sync.py— tables in syncpython scripts/check_spec_examples.py— spec blocks parsepython scripts/check_readme_examples.py— README blocks parsepython scripts/check_skill_examples.py— SKILL blocks parsepython scripts/check_html_examples.py— HTML blocks check + verify🤖 Generated with Claude Code