f4e50353ed
Support for list literals in Lambdas
Test, Build, and Release / test (push) Successful in 1m35s
Test, Build, and Release / build (push) Successful in 1m12s
2025-02-02 12:08:08 -06:00
f9864b8361
REPL namespaces; lib function for pattern matching
...
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
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
7d1b6a741d
REPL import warning; version info in CLI
...
Test, Build, and Release / test (push) Successful in 1m18s
Test, Build, and Release / build (push) Successful in 1m13s
Adds the ability to toggle result decoding in REPL. Adds several more
useful functions to the base library.
2025-01-30 16:33:36 -06:00
bf1000d174
Rework module system
...
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
c6a7835a6f
Don't require available library to run REPL or decoder
2025-01-27 16:28:40 -06:00
20b114fe9b
Gracefully ignore no-op redefs
2025-01-27 16:19:59 -06:00
4a4b09e898
# Modules
...
Basic implementation of a module system including tests.
2025-01-27 16:04:04 -06:00
72291c652d
Small dependency ordering optimizations
2025-01-26 16:08:34 -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
6713b05872
Add optimization cases for triage and composition
2025-01-25 15:12:28 -06:00
00cdeca280
Eval optimization! Tests for demos
2025-01-25 09:18:13 -06:00
3175132eec
Immutable definitions and documentation updates
2025-01-24 16:14:33 -06:00
10c7cc367d
Some special characters in ids; new demos
...
Adds support for several special characters in identifiers. Adds a demo
for converting values to source code and another for checking equality.
Updates the existing demo and tests to reflect new names for functions
returning booleans.
2025-01-23 15:46:40 -06:00
3e3e5802fa
Drop unreachable cases of updateDepth
2025-01-21 16:16:04 -06:00
83dad2c56b
Add more explicit error handling for mismatched groupings
2025-01-21 16:06:10 -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
eeaf9e0289
Eliminate redundant eager calls of elimLambda
2025-01-20 16:05:06 -06:00
b385349197
Reduce duplication of elimLambda calls
2025-01-20 15:16:27 -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
66cc5fdd27
Drop parseVarWithoutAssignment
...
Additionally sorts gitignore and adds attempted decoding of lists back
to the REPL
2025-01-03 10:31:35 -06:00
7d97b85f74
Fix critical list evaluation bug and REPL updates
2025-01-02 19:08:14 -06:00
5523d5acde
Use better default output form in evaluator
2025-01-01 19:40:12 -06:00
f478a7d091
Clarify CLI options
2025-01-01 19:32:41 -06:00
03cbadcc54
Support evaluation across multiple source files
2025-01-01 19:27: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
1c8457733e
Fixes identifier lexing; support REPL file loading
2025-01-01 18:05:21 -06:00
57f7389c4d
Normalize CLI options and help display
2025-01-01 08:34:17 -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
7abc7061d9
Expands CLI support with output forms and decoding
...
Adds CLI options for compiling to a Tree Calculus, AST, Ternary, and
ASCII tree view. Adds CLI command for attempted decoding of a compiled
result to Number/String/List.
2024-12-30 14:22:37 -06:00
78dd2f4d8f
Initial ternary representation options
...
Both parsing and conversion from T to ternary representation supported
2024-12-30 08:30:40 -06:00
95b1e07dd9
Adds "compiler" and CLI argument handling
2024-12-29 21:49:57 -06:00
bde89125ba
Resolves issue with parsing comments
2024-12-29 21:02:38 -06:00
8a2dc2dfcf
Additional tests
2024-12-29 12:22:24 -06:00
f41c92fa9d
Expansion of testing suite to cover incl. library
...
Expands the testing suite to verify behavior of provided library
functions. Updates the README further for clarification on important
concepts.
2024-12-29 10:28:32 -06:00
7a7ee6886a
Rename from sapling to tricu
2024-12-29 08:29:25 -06:00
30c04a84d6
Stop using to/of conventions backwards
2024-12-28 07:24:19 -06:00
a9432777e5
Support for single line comment syntax using --
2024-12-28 07:15:34 -06:00
fe62e63c22
Update README and REPL formatting for list outputs
2024-12-27 20:54:30 -06:00
decf912be7
Update lambda handling; better default decode out
2024-12-27 20:46:30 -06:00
8c1243580f
Further library additions and REPL updates
2024-12-27 19:27:04 -06:00
c718684963
Include equality testing in basic library
2024-12-27 16:30:32 -06:00
2c75f58e42
Minor fix to REPL output for numbers
...
Uses # instead of text output. Adds several basic library functions.
2024-12-27 16:09:54 -06:00
1224961c62
Automatic decoding of supported literals in REPL
...
Automatic decoding & display of string, number, and list types in REPL.
General updates to README, style, and comments.
2024-12-27 15:40:50 -06:00
9c1c916fc9
Tests and better default REPL behavior
2024-12-27 14:10:13 -06:00