12 Commits

Author SHA1 Message Date
df6089f84a cl-interpret: Print function call backtrace on panic 2025-09-15 00:18:51 -04:00
8b0a122dfc cl-interpret: Environment/stack overhaul + Ref patterns 2025-07-18 05:29:10 -04:00
ae026420f1 conlang: Fix rustdoc warnings 2025-06-17 00:43:21 -04:00
124bb2f680 cl-interpret: Builtins! builtins(), chars(str), and panic(msg) 2025-05-18 11:42:33 -04:00
b09a610c6c interpreter: Include location in error type 2025-04-15 23:42:21 -04:00
dcdb100a8a cl-interpret: Try having separate globals again? 2025-03-11 23:33:49 -05:00
4bc088f277 cl-interpret: Pure value stack v1, references v2
References actually work! :D
They can also be stale :(
2025-03-11 05:01:49 -05:00
7e311cb0ef conlang: RIP THE EXPRKIND BANDAGE OFF
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.
2025-03-11 00:36:42 -05:00
0e3ba342c4 cl-interpret: make the error type smaller (at the cost of a heap allocation) 2025-01-31 03:35:35 -06:00
d95d35268e cl-interpret: Builtin refactor
- Everything is different now
  - Builtins are now built on top of Rust functions, so they can be recursive!
  - TODO: allow macro-defined builtins to call each other?
- The builtins! macro is a lot nicer to work with
  - No redundant return value
  - Maps the result over Into::into, allowing for type inference!
  - Uses explicit pattern syntax instead of weird binding, where possible
  - Does not #[allow(unused)], so you'll get unused variable warnings now!
2025-01-31 03:34:45 -06:00
6ee9bbd72e conlang: PATTERN MATCHING AND DESTRUCTURED BINDINGS WOOOOO
- 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
2025-01-29 04:15:33 -06:00
ecebefe218 cl-interpret: Knock those modules free! 2024-07-27 22:47:46 -05:00