Toka: A Systems Programming Language with Explicit Resource Semantics

📅 2026-06-01
📈 Citations: 0
Influential: 0
📄 PDF

career value

153K/year
🤖 AI Summary
This work addresses the longstanding tension in systems programming languages between physical transparency and compile-time memory safety: C++ lacks enforced safety boundaries, while Rust imposes high cognitive overhead through complex lifetime annotations. To reconcile these concerns, we propose and implement Toka, a novel language featuring an innovative Handle-Soul dual model that syntactically decouples pointer identities (Handles) from their underlying values (Souls), thereby eliminating semantic ambiguity between pointers and values. This design explicitly encodes resource semantics—supporting unique, shared, borrowed, and raw resource modes—and integrates them with compile-time lifetime checking. As a result, Toka significantly reduces the cognitive burden and annotation complexity of memory-safe programming while preserving near-zero runtime overhead and minimal binary size.
📝 Abstract
Systems programming languages traditionally struggle with the tension between physical transparency and compile-time memory safety. C++ provides direct, zero-cost hardware access but lacks strict safety boundaries, whereas Rust guarantees safety at the cost of complex lifetime annotations and implicit dereferencing chains. In this paper, we present Toka, a native systems programming language that establishes physical transparency in resource management via Explicit Resource Semantics. At the core of Toka's design is the Handle-Soul Duality (informally referred to as the Hat-Soul model), which cleanly dissociates pointer identities (Handles) from their underlying values (Souls) at the syntactic level. By enforcing that bare identifiers always represent values (Souls) and explicit sigils represent pointer handles, Toka eliminates the semantic ambiguity between rebind operations and value mutations. We detail Toka's resource morphology (supporting unique, shared, borrowed, and raw semantics), its lifetime checking mechanism, and its implementation of a prototype compiler. Our evaluation demonstrates that Toka achieves competitive runtime performance and minimal binary size while drastically reducing the cognitive overhead of lifetime annotations.
Problem

Research questions and friction points this paper is trying to address.

systems programming
memory safety
physical transparency
resource semantics
lifetime annotations
Innovation

Methods, ideas, or system contributions that make the work stand out.

Explicit Resource Semantics
Handle-Soul Duality
systems programming language
memory safety
lifetime checking