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

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

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

arXiv:2303.12254 (cs)
[提交于 2023年3月22日]

标题:Practical compilation of fexprs using partial evaluation: Fexprs can performantly replace macros in purely-functional Lisp

作者:Nathan Braswell, Sharjeel Khan, Santosh Pande
查看论文《Practical compilation of fexprs using partial evaluation: Fexprs can performantly replace macros in purely-functional Lisp》的 PDF
查看中文 PDF 查看原文 PDF EasyResearch 阅读
摘要:Macros are a common part of Lisp languages, and one of their most lauded features. Much research has gone into making macros both safer and more powerful resulting in developments in multiple areas, including maintaining hygiene, and typed program staging. However, macros do suffer from various downsides, including being second-class. Particularly egregious for eager functional programming, they are unable to be passed to higher-order functions or freely composed. Fexprs, as reformulated by John Shutt, provide a first-class and more powerful alternative to macros that meshes well with pure functional programming. Unfortunately, naive execution of fexprs is much slower than macros due to re-executing unoptimized operative combiner code at runtime that, in a macro-based language, would have been expanded and then optimized at compile time. To show that fexprs can be practical replacements for macros, we formulate a small purely functional fexpr based Lisp, Kraken, with an online partial evaluation and compilation framework that supports first-class, partially-static-data environments and can completely optimize away fexprs that are used and written in the style of macros. We show our partial evaluation and compilation framework produces code that is more than 70,000 times faster than naive interpretation due to the elimination of repeated work and exposure of static information enabling additional optimization. In addition, our Kraken compiler performs better compared to existing interpreted languages that support fexprs, including improving on NewLisp's fexpr performance by 233x on one benchmark.
评论: 26 pages, 23 figures (incl appendix), submitted to ICFP23
主题: 程序设计语言 (cs.PL)
引用方式: arXiv:2303.12254 [cs.PL]
  (或者 arXiv:2303.12254v1 [cs.PL] 对于此版本)
  https://doi.org/10.48550/arXiv.2303.12254

提交历史

来自:Nathan Braswell
[v1] 2023年3月22日 星期三 01:45:03 UTC
全文链接:

访问论文:

  • 查看中文 PDF
  • 查看原文 PDF
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

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

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

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