Commit Graph

60 Commits

Author SHA1 Message Date
31bf7094f4 Arboricx bundle format 1.1
We don't need SHA verification or Merkle dags in our transport bundle. Content
stores can handle both bundle and term verification and hashing.
2026-05-12 15:18:29 -05:00
8a673e282d Fixes space leak by switching to objects
The integer-arena approach (parallel global arrays) never freed nodes,
causing 6GB+ memory usage when running the self-hosted kernel. PHP
arrays don't shrink and we have no GC for them.

- Replace int-arena with plain Node objects so PHP's refcounting GC
  reclaims unreachable subtrees automatically.
- Hash-cons Stem/Fork nodes to collapse duplicate immutable subtrees.
- Cache ofNumber(0..255) to avoid re-creating byte trees.
- Eliminate indirection (tag 4) nodes entirely; projection rules now
  eagerly reduce and copy tag/a/b into the original App node.
- Remove all deref() loops — every node is exactly what it says.

Memory: 6GB+ → 24MB for `id "hello"` with runArboricxToString kernel
2026-05-10 16:56:00 -05:00
2e8a0a4c46 Host ABI definition and ergonomics in TC 2026-05-09 18:33:03 -05:00
d0886ad886 Small host execution ergos 2026-05-09 18:18:25 -05:00
2773109b87 Full Arboricx parsing in tricu 2026-05-09 17:43:45 -05:00
6dd4c3e607 Drop CBOR for simple custom manifest 2026-05-09 12:31:34 -05:00
343ecbf4c4 Arborix -> Arboricx rename 2026-05-08 09:12:20 -05:00
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
d9f25a2b5a Add Arborix bundle parsing and reconstruction
Implement portable Arborix container, section directory, nodes section, and
Merkle DAG reconstruction utilities in tricu libraries. Add byte/list helper
fixes needed for data-first recursion, validate node payloads, duplicate hashes,
and closed child references, and expose executable loading from a root hash.

Expand binary reader coverage with portable header/section tests, nodes-section
parsing, fixture bundle parsing, and execution checks for reconstructed
id/not?/map roots. Refresh fixture bundles and remove obsolete fixtures.
2026-05-07 14:21:24 -05:00
a002365651 Add Arborix section directory byte readers 2026-05-07 12:28:14 -05:00
37d57044e2 Idiomatic naming in libs 2026-05-07 08:15:32 -05:00
44ab13c889 Beginning Arborix work in tricu 2026-05-06 20:10:33 -05:00
dee85efabf Tree-native binary processing 2026-05-06 19:36:53 -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
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
2627627493 Picking development back up
Merge Kiselyov optimizations and De Bruijn indices
General clean up
2026-05-05 15:56:23 -05:00
0cdc0bfc34 "size" function nodes down from 454 to 321 2025-08-07 20:08:59 -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
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
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
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
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
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
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
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
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
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
c578d780e9 Updates to tests
Uncomments a test for comment parsing behavior and removes a test for
incomplete function definitions.
2024-12-29 21:09:02 -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