跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 程序设计语言

arXiv:2311.07369 (cs)
[提交于 2023年11月13日]

标题:Unboxed data constructors -- or, how cpp decides a halting problem

作者:Nicolas Chataing, Stephen Dolan, Gabriel Scherer, Jeremy Yallop
查看论文《Unboxed data constructors -- or, how cpp decides a halting problem》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:We propose a new language feature for ML-family languages, the ability to selectively unbox certain data constructors, so that their runtime representation gets compiled away to just the identity on their argument. Unboxing must be statically rejected when it could introduce confusions, that is, distinct values with the same representation. We discuss the use-case of big numbers, where unboxing allows to write code that is both efficient and safe, replacing either a safe but slow version or a fast but unsafe version. We explain the static analysis necessary to reject incorrect unboxing requests. We present our prototype implementation of this feature for the OCaml programming language, discuss several design choices and the interaction with advanced features such as Guarded Algebraic Datatypes. Our static analysis requires expanding type definitions in type expressions, which is not necessarily normalizing in presence of recursive type definitions. In other words, we must decide normalization of terms in the first-order lambda-calculus with recursion. We provide an algorithm to detect non-termination on-the-fly during reduction, with proofs of correctness and completeness. Our termination-monitoring algorithm turns out to be closely related to the normalization strategy for macro expansion in the `cpp` preprocessor.
主题: 程序设计语言 (cs.PL)
引用方式: arXiv:2311.07369 [cs.PL]
  (或者 arXiv:2311.07369v1 [cs.PL] 对于此版本)
  https://doi.org/10.48550/arXiv.2311.07369
相关 DOI: https://doi.org/10.1145/3632893

提交历史

来自:Gabriel Scherer
[v1] 2023年11月13日 星期一 14:34:00 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.PL
< 上一篇   |   下一篇 >
最新 | 近期 | 2023-11
切换浏览方式为:
cs

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站