Search papers, labs, and topics across Lattice.
Toka is a new systems programming language designed to balance physical transparency with compile-time memory safety, addressing the limitations of C++ and Rust. By introducing the Handle-Soul Duality, Toka clearly separates pointer identities from their underlying values, thereby eliminating semantic ambiguities that complicate resource management. Evaluation results indicate that Toka not only maintains competitive runtime performance and minimal binary size but also significantly reduces the cognitive burden associated with lifetime annotations.
Toka's innovative Handle-Soul Duality could redefine resource management in systems programming by eliminating semantic ambiguities and reducing cognitive overhead.
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.