19 Commits

Author SHA1 Message Date
f9864b8361 REPL namespaces; lib function for pattern matching
All checks were successful
Test, Build, and Release / test (push) Successful in 1m52s
Test, Build, and Release / build (push) Successful in 1m20s
Adds support for REPL namespacing, primarily to avoid `main` collisions.
Also adds a library function for an ergonomic pattern matching function
that I've been noodling on. I might explore ways to make list syntax
less annoying specifically for pattern matching like this.
2025-02-02 10:56:40 -06:00
1a9a4494e0 Caller-relative imports; smart deduping in imports
All checks were successful
Test, Build, and Release / test (push) Successful in 1m35s
Test, Build, and Release / build (push) Successful in 1m13s
2025-01-30 17:56:46 -06:00
a16a24a808 Replace placeholder xor? library function 2025-01-30 17:17:07 -06:00
bf1000d174 Rework module system
All checks were successful
Test, Build, and Release / test (push) Successful in 1m37s
Test, Build, and Release / build (push) Successful in 1m14s
Don't require/allow naming a module, instead require that the importer
names it. Allow importing into the local scope with the name !Local.
Simplify namespacing logic. Updates all tests to reflect these changes.
2025-01-30 13:56:09 -06:00
09eedfb609 Better handling of interrupts in REPL 2025-01-27 16:46:41 -06:00
4a4b09e898 # Modules
Basic implementation of a module system including tests.
2025-01-27 16:04:04 -06:00
c9d0d04630 # File eval mode now relies on main function
To encourage organizing code in a way that helps in understanding, I
have implemented the common idiom of requiring a `main` function. In
tricu and other functional languages, it is usually placed near the top
of the module. The evaluator gracefully handles the situation of passing
multiple files where the intermediary "library" files do not have main functions.
2025-01-26 15:33:12 -06:00
425489a73f Definition dependency analysis
tricu now allows defining terms in any order and will resolve
dependencies to ensure that they're evaluated in the right order.
Undefined terms are detected and throw errors during dependency
ordering.
For now we can't define top-level mutually recursive terms.
2025-01-26 14:50:39 -06:00
b0b0fb22b9 Allow lambda expressions without explicit paren 2025-01-26 08:52:28 -06:00
5216cc4e5b Release 0.6.0 2025-01-23 16:44:14 -06:00
962a100f53 Inline pattern matching in Parser 2025-01-21 14:21:47 -06:00
ec0a6b7b16 Allow multiline expressions 2025-01-20 19:20:29 -06:00
e6e05b607a General refactor for legibility
Priming to update all source to lhs and document extensively
2025-01-19 14:41:25 -06:00
63aa977efd 0.5.0 release commit 2025-01-06 09:14:04 -06:00
8b0b24e7dc Provide "library" via tricu file directly
Allows easier loading of other files and drops the list of Haskell
strings containing the basic tools included
2025-01-01 18:53:56 -06:00
3ab9b58194 Rename "compiler" functionality to Evaluator
Allows for stdin input for evaluation when no input file is provided.
2025-01-01 08:23:53 -06:00
4aa8e19ff4 Add "SimpleT" t output form
This new output form allows easy piping to the decode function of the
tricu executable. Includes a new test for roundtrip evaluation of map,
compilation to tree calculus terms, and decoding back to a human
readable string.
2024-12-31 10:00:52 -06:00
95b1e07dd9 Adds "compiler" and CLI argument handling 2024-12-29 21:49:57 -06:00
7a7ee6886a Rename from sapling to tricu 2024-12-29 08:29:25 -06:00