【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 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号