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.


翻译:系统编程语言传统上在物理透明性与编译时内存安全之间存在矛盾。C++提供直接且零成本的硬件访问,但缺乏严格的安全性边界;而Rust虽能保障安全性,却以复杂的生命周期标注和隐式解引用链为代价。本文提出Toka——一种原生系统编程语言,通过显式资源语义在资源管理中建立物理透明性。Toka设计的核心是“句柄-灵魂二元性”(非正式称为“帽子-灵魂模型”),该模型在语法层面明确区分指针标识(句柄)与其底层值(灵魂)。通过强制裸标识符始终表示值(灵魂),而显式符号表示指针句柄,Toka消除了重绑定操作与值修改之间的语义歧义。本文详细阐述了Toka的资源形态(支持唯一、共享、借用和原始语义)、其生命周期检查机制,以及原型编译器的实现。评估表明,Toka在显著降低生命周期标注认知开销的同时,实现了具有竞争力的运行时性能和极小的二进制体积。

0
下载
关闭预览

相关内容

《软件定义网络元素与机器代码的形式化验证》
专知会员服务
14+阅读 · 2025年11月18日
【干货书】C++实战编程指南,附549页pdf与Slides
专知会员服务
84+阅读 · 2021年4月23日
【经典书】Linux UNIX系统编程手册,1554页pdf
专知会员服务
48+阅读 · 2021年2月20日
专知会员服务
38+阅读 · 2020年10月29日
佐治亚理工2020《数据库系统实现》课程,不可错过!
专知会员服务
24+阅读 · 2020年10月14日
基于PyTorch/TorchText的自然语言处理库
专知
28+阅读 · 2019年4月22日
自然语言处理精品资料
人工智能前沿讲习班
14+阅读 · 2019年3月13日
资源 | 清华大学开源OpenKE:知识表示学习平台
机器之心
10+阅读 · 2017年11月4日
今日头条推荐系统架构演进之路
QCon
32+阅读 · 2017年6月21日
自然语言处理工具包spaCy介绍
AINLP
18+阅读 · 2016年11月14日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 5月16日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
6+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
5+阅读 · 6月17日
相关资讯
基于PyTorch/TorchText的自然语言处理库
专知
28+阅读 · 2019年4月22日
自然语言处理精品资料
人工智能前沿讲习班
14+阅读 · 2019年3月13日
资源 | 清华大学开源OpenKE:知识表示学习平台
机器之心
10+阅读 · 2017年11月4日
今日头条推荐系统架构演进之路
QCon
32+阅读 · 2017年6月21日
自然语言处理工具包spaCy介绍
AINLP
18+阅读 · 2016年11月14日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员