【24h】

Down with Emacs Lisp: Dynamic Scope Analysis

机译:用Emacs Lisp:动态范围分析

获取原文

摘要

It is possible to translate code written in Emacs Lisp or another Lisp dialect which uses dynamic scoping to a more modern programming language with lexical scoping while largely preserving structure and readability of the code. The biggest obstacle to such an idiomatic translation from Emacs Lisp is the translation of dynamic binding into suitable instances of lexical binding: Many binding constructs in real programs in fact exhibit identical behavior under both dynamic and lexical binding. An idiomatic translation needs to detect as many of these binding constructs as possible and convert them into lexical binding constructs in the target language to achieve readability and efficiency of the target code. The basic prerequisite for such an idiomatic translation is thus a dynamic scope analysis which associates variable occurrences with binding constructs. We present such an analysis. It is an application of the Nielson/Nielson framework for flow analysis to a semantics for dynamic binding akin to Moreau's. Its implementation handles a substantial portion of Emacs Lisp, has been applied to realistic Emacs Lisp code, and is highly accurate and reasonably efficient in practice.
机译:可以翻译以EMACS LISP或另一个LISP方言中写入的代码,该代码使用动态范围与具有词汇范围的更现代的编程语言,同时很大程度上保留了代码的结构和可读性。来自Emacs Lisp的这种惯用性翻译的最大障碍是对词汇结合的合适实例的动态结合的翻译:实际上的许多结合构建体实际上表现出动态和词汇结合的相同行为。惯用的翻译需要检测尽可能多的这些绑定构造,并将它们转换为目标语言中的词汇绑定构造,以实现目标代码的可读性和效率。因此,这种惯用转换的基本先决条件是一个动态范围分析,它将可变发生与绑定构造相关联。我们提出了这样的分析。它是Nielson / Nielson框架的应用程序,用于对Moreau的动态绑定的语义进行流量分析。其实施处理了大量的Emacs Lisp,已应用于现实的Emacs Lisp码,并且在实践中具有高度准确和合理效率。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号