v0.9.8-03: Default @arc, Unified Diagnostics & Parallel Incremental Build
Toka v0.9.8-03 Release Notes
Toka v0.9.8-03 is a milestone release that delivers critical advancements in static safety guarantees, standard library architecture, parallel build tooling, and multi-threaded runtime safety. This release hardens the compilation boundary, aligns standard library containers with physical hardware models, introduces a parallel incremental build engine, and establishes default atomic reference counting with optimal memory orderings.
🚀 Key Achievements Since v0.9.8-02
1. Multi-Threaded Runtime Safety: Default Atomic Reference Counting
- Default
@arcSemantics: Promoted all reference counting operations for the shared pointer~to be atomic by default. This eliminates critical memory safety race conditions under multi-threaded environments. - Optimal Happens-Before Memory Orderings:
- Inc (Retain): Utilizes
Monotonic(Relaxed) ordering to minimize runtime overhead. It avoids expensive Data Memory Barrier (DMB) instructions on AArch64 (Apple Silicon) platforms while remaining extremely lightweight on x86_64. - Dec (Release): Utilizes
AcquireReleaseordering. This establishes a hardware-enforced barrier that synchronizes all historical writes before triggering the@encap/dropdestructor, preventing Use-After-Free (UAF) and race conditions during deallocation.
- Inc (Retain): Utilizes
- Future-Proof Memory Policies: Silently reserved backend code generation slots for
@policysuffixes (such as@localand@weak) in the Type and CodeGen systems, avoiding breaking changes for Toka 2.0.
2. Standard Library Redesign: CPU Contiguous Memory & Power-of-Two RingCore
- Physical Hardware Alignment: Deleted the classic doubly LinkedList from the standard library (
std). This aligns Toka with modern contiguous CPU physical memory hierarchies to maximize cache locality. - Zero-Division Power-of-Two RingCore: Refactored standard library queue and buffer containers with a power-of-two
RingCore, substituting expensive modulo division with fast bitwise operations. - True O(1) FIFO Channels: Upgraded standard library
channelqueues to leverageRingCore, providing zero-cost, high-throughput asynchronous communication.
3. Safety Hardening: Generational Slab & TCB Escaping Analysis
- Generational Slab Allocator: Implemented the standard generational
Slaballocator andSlabIDwith strict encapsulation. - Zero-Copy Option Borrows: Refactored
Slab::getandSlab::get_mutto return safe, zero-copyOptionborrows and strictly enforced pointer morphology sigils. - TCB Boundary Reinterpret Cast Guard: Hardened
collectDepsandreturnedDepsalgorithms in the semantic analyzer to proactively detect and block unsafe pointer reinterpret-cast escapes across the Trusted Computing Base (TCB).
4. Developer Tooling: Forge Parallel Incremental Build Engine
- Parallel Build Orchestrator: Developed
forge, Toka's native parallel incremental build engine. It compiles dirty targets concurrently utilizing standard channels and waker mechanics. - Instant Cache Resolution: Embedded a persistent cache store (
.forge_cache) that tracks compile-time metadata, file sizes, and modification timestamps to achieve O(1) clean target resolution. - Self-Contained FFI Interop: Leveraged native
libc_systemand thread-local memory allocation systems to manage task lifecycle dynamically.
5. Code Quality & Unified Diagnostics
- 100% Strongly-Typed Error Engine: Unified and migrated all hand-written compiler error diagnostics into a single source of truth (
spec/diagnostic.map.json). It automatically generates type-safe templates, expanding the diagnostics library to 395 entries. - Prohibiting Pointer Sigils on Method
self: UpgradedHasPointerchecks toIsRawPointerand definedERR_SELF_POINTER_SIGILto block unsafe morphology symbols on methodselfparameters at the parser level. - Zero-Trigraph Compiler Build: Eliminated
-Wtrigraphspreprocessor warnings during C++ compiler bootstrap by escaping legacy query strings inside the error definitions.
🧪 Verification & Regression Testing
This release has passed comprehensive regression test suites:
- Positive Test Suite (
test_pass.sh): 263 out of 263 tests passed (100.00% success rate), including multi-threaded stress tests (atomic_stress.tkandsync_mutex.tk). - Negative Test Suite (
test_fail.sh): 113 out of 113 diagnostic failure tests passed (100.00% success rate). - LSP & Tooling Warnings: Cleaned up all package manager and language server warnings.
📦 Commit & Tag Information
- Tag:
v0.9.8-03 - Baseline Hash:
b190895