This document captures the design principles, architectural invariants, and implementation strategies that guide development on the T81 Foundation project.
/spec are the source of truth. The implementation must conform to them. Any deviation in the code is considered a bug.t81_core, t81_lang_frontend, t81_vm). This separation is enforced by the CMake build system and allows for independent development and testing./legacy/hanoivm is preserved as an immutable reference. It is a source of historical context and semantic clarification, but it is not a target for new development.T81Int<N>: A header-only, fixed-size, templated class for balanced ternary integers. Its internal storage is a std::array of packed trytes.T81BigInt: An arbitrary-precision integer class using multi-limb balanced ternary storage, with core arithmetic implemented and actively optimized for performance.Fraction: A rational number type that is always maintained in canonical form (reduced, with a positive denominator).T81Float: A balanced ternary floating-point type with canonical storage and sign-magnitude representation. Note: Division and transcendental functions currently rely on host double precision.T81Fixed, T81UInt, and T81Prob extend the foundation with ternary fixed-point, unsigned integer, and probability-specialized numerics respectively; T81Float also has specializations for different mantissa/exponent budgets and interoperability with T81Int through constexpr bridges.T81Complex, T81Quaternion, and T81Polynomial capture higher-order algebra, while T81Vector, T81Matrix, and T81Tensor expose fixed- and variable-dimensional linear spaces that compose cleanly with the numeric types.T81List, T81Map, T81Set, T81Tree, T81Graph, along with T81String, T81Bytes, T81Symbol, and T81Result/T81Maybe/T81Promise, offer deterministic collection semantics, canonical string/byte handling, and rich error/result signaling within the ternary stack.T81Stream/T81IOStream, T81Time, T81Entropy, T81Agent, T81Thread, T81Network, T81Discovery, and T81Reflection round out the platform, providing deterministic I/O, timing, entropy sourcing, metadata, and runtime/topology introspection.t81::support::expected-like object.std::domain_error. The “no exceptions” rule in the spec applies to value-level semantics, not fundamental domain errors.MatchPattern::Kind::Variant and the CLI now formats nested arms in Axion trace output. The parser accepts forms such as Nested(Data(v)) or Wrap({ inner: Data(v) }), making it possible to bind into inner enums or record fields without needing multiple locals.-DT81_USE_CXX23=OFF). Features should be used where they enhance clarity and safety./include: All public APIs are defined in the /include/t81/ directory. Implementation details reside in /src/.new and delete are forbidden in high-level code./tests/cpp/. Bug fixes must be accompanied by a regression test.google/benchmark) are used only for non-essential targets like benchmarks.