Commit Graph

89 Commits

Author SHA1 Message Date
e3117e3ac8 Switch manifest serialization to CBOR
Replace JSON-based bundle manifest with a CBOR-encoded format. The manifest
is now a canonical CBOR map with order-strict key decoding, raw 32-byte hash
payloads (instead of hex-encoded JSON), and compact binary representation.
2026-05-07 21:41:50 -05:00
1d84bf7cfa fix: freeVars, toSKIDB
freeVars did not descend into TStem, TFork, or SList, so dependency analysis
under structural nodes and lists was silently missed.

toSKIDB's _other = _K `SApp` TLeaf fallback returned a constant leaf when the
binder occurred under a structural node, losing the abstraction entirely.
Replace with explicit lowering: BStem/BFork/BList are converted to application
form before SKI abstraction, and any other unsupported DB term errors explicitly
2026-05-07 11:04:29 -05:00
44ab13c889 Beginning Arborix work in tricu 2026-05-06 20:10:33 -05:00
89bb73ed99 Tree-native byte processing 2026-05-06 18:53:17 -05:00
1c4c49e68d Byte marshalling 2026-05-06 17:25:42 -05:00
e7a6426060 Support multiple named exports globally
Add multi-root bundle support across the toolchain:
 - `compile`: Accept multiple definition names via `-x NAME` (repeatable or
   comma-separated). Exports all requested definitions as named roots in a
   single bundle. Defaults to "main" when no names are given.
 - `export`: Accept comma-separated hashes in the positional argument and
   multiple `-n`/`names` flags. Exports all resolved roots in one bundle.
 - Server: Add `GET /bundle/roots?n=...&h=...` endpoint that resolves
   multiple stored-term names and/or raw Merkle hashes, returning a single
   bundle containing all of them as roots.
 - Wire: Export `defaultExportNames` helper for generating default export
   names when none are supplied.
 - Drop `cereal` dependency from `tricu.cabal` (no longer used).
2026-05-06 15:30:56 -05:00
7e16607d96 Drop slopdashes and add container build 2026-05-06 14:40:33 -05:00
a36ff638a9 feat: HTTP server for exporting Arborix bundles
Introduces a read-only HTTP server (WAI/Warp) backed by the content
store, exposing three bundle-export endpoints:

- GET /bundle/name/:name   — export by stored term name
- GET /bundle/hash/:hash   — export by full Merkle hash
- GET /terms               — plain-text listing (debug)

Also adds `tricu server` (aka `--serve`) CLI mode, move `resolveExportTarget` /
 `namesForHash` / `looksLikeHash` out of `Main.hs` into `ContentStore.hs`,
and cleans up unused exports and imports across `FileEval.hs` and `Wire.hs`.
2026-05-06 14:22:36 -05:00
0cd849447f Initial JS runtime and Arborix Implementation 2026-05-06 11:50:44 -05:00
fe453b9b96 Wire prepped and basics tested 2026-05-06 08:25:07 -05:00
fb09b4666e Seeded root leaf prep for wire 2026-05-05 19:16:16 -05:00
efbe9350ed Zero Warnings Plan
Zero GHC warnings with new opts. General cleanup and updates.
2026-05-05 18:32:11 -05:00
2627627493 Picking development back up
Merge Kiselyov optimizations and De Bruijn indices
General clean up
2026-05-05 15:56:23 -05:00
6b97b210ca Full Merkle tree resolution 2026-05-05 14:08:50 -05:00
0cdc0bfc34 "size" function nodes down from 454 to 321 2025-08-07 20:08:59 -05:00
b96a3f2ef0 Fixes list and name lookup bugs 2025-05-26 17:56:07 -05:00
6780b242b1 Use exact name matches in nameToTerm 2025-05-26 09:04:03 -05:00
94514f7dd0 Update README and !help REPL command 2025-05-22 16:52:37 -05:00
43e83be9a4 Merge content store 2025-05-22 16:46:30 -05:00
3717942589 Clean up and list SKI conversion fix 2025-04-24 12:14:38 -05:00
25bfe139e8 String escaping using backslash 2025-04-15 10:52:53 -05:00
f2beb86d8a Drop backslash from lambda definitions 2025-04-15 10:34:38 -05:00
5024a2be4c Revert flake.nix 2025-02-08 10:24:14 -06:00
0a505172b4 Adds several new REPL utilities
Also removes some broken list library functions
2025-02-07 18:25:11 -06:00
e6e18239a7 Smarter decoding of terms
This update includes an update to `decodeResult` that makes string
decoding far less aggressive. This also replaces the `!decode` REPL
command with `!output` to allow users to switch output format on the
fly. New tests are included for verifying decoding behavior; this group
needs to be fleshed out further.
2025-02-07 15:06:25 -06:00
871245b567 Lint cleanup and README updates 2025-02-07 12:37:27 -06:00
30b9505d5f Clearer definition for apply 2025-02-06 08:32:17 -06:00
f4e50353ed Support for list literals in Lambdas
All checks were successful
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
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
7d1b6a741d REPL import warning; version info in CLI
All checks were successful
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
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
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