- Renamed "intrinsic" -> "primitive"
- I thought it was funny, but it's just annoying.
- Rename "Uninferred" -> "Inferred"
- It's a concrete type, but an inferred one.
- Add lifetimes to the Entry API
- Categorize does not care about recursive types. You can't have a recursive AST.
- Added helpful constructors to the inference engine
- Added some overloadable operators to the inference engine
- These are a MAJOR work in progress
- Reorganized the Inference implementation file by functionality.
stdlib:
- Updated standard library.
- Function bind is now one Pattern
- TyRef now allows &Ty (i.e. &[i32], &(char, bool)
- Range patterns (they cannot bind, only check whether a value is in range
- ArrayRep repeat has been reverted to usize, for now, until early consteval is implemented.
cl-ast: No more bare ExprKind: every Expr has a Span
cl-interpret: Give errors a span
cl-repl: Print eval errors in load_file, instead of returning them. These changes are relevant.
This breaks out the pattern matching/unification algorithm from cl-interpret/interpret.rs to cl-interpret/pattern.rs
TODO: pattern destructuring in const, static :^)
- Patterns are no longer parsed with the highest precedence
- Function calls with just a path and a tuple of args can now be transformed into a Pattern
- Deny arbitrary paths in patterns (only one non-keyword identifier allowed!)
- Allow patterns in for-loop binders (literally useless atm, but it's a step toward making patterns the only way to bind names.)
Next: Functions, Tuple Struct Patterns... And solving the stupid syntactic ambiguity of structors.
- Integrate the Match and Pattern nodes into the AST
- TODO: `let x: T` is ambiguous with `let x: {}`. Currently the latter takes precedence in the parser.
- Implement pattern matching through unification in the interpreter.
- It's not fast, but it works!
- Refactor destructuring assignments to use the new pattern functionality
- Smuggle floats as integers to maintain `eq`
- This is bad, but not terrible for spec-compliant floats. Might have issues with NaN.
cl_parser: Smuggle floats
cl_interpret: unpack smuggled floats in float literal node