compiler-construction - 什么是 A 范式?

标签 compiler-construction compiler-development

我正在阅读各种中间形式,但除了类似 wiki 的条目之外,我无法获得有关 A-normal 形式的信息。这里有人知道这件事或有关于它的好资源吗?

最佳答案

Administrative normal form .

In computer science, administrative normal form (abbreviated ANF) is a canonical form of programs, which was introduced by Flanagan et al 1993 to serve as an intermediate representation in functional compilers to make subsequent transformations to machine code more direct.


In ANF, all arguments to a function must be trivial. That is, evaluation of each argument must halt immediately.


Grammar

The following BNF grammar describes the pure λ-calculus modified to support the constraints of ANF:

EXP ::= VAL 
      | let VAR = VAL in EXP
      | let VAR = VAL VAL in EXP

VAL ::= VAR
      | λ VAR . EXP

Variants of ANF used in compilers or in research often allow constants, records, tuples, multiargument functions, primitive operations and conditional expressions as well.


弗拉纳根,科马克;萨布里,阿姆尔;杜巴,布鲁斯 F.;费莱森,马蒂亚斯。 "The Essence of Compiling with Continuations"可能是最终的来源。
还在 cs252r : Advanced Functional Programming 上找到了一些注释.

关于compiler-construction - 什么是 A 范式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/828144/

相关文章:

c++ - 是否存在 C4129 警告未指示错误的真实案例?

compiler-construction - LLVM中的部分应用

optimization - 编译器优化问题

visual-c++ - 为什么VC++编译器MOV + PUSH args不仅仅是PUSH它们? x86

compiler-construction - 龙书的哪一部分已经过时了?

java - 是否有可以在 JRE 6 上使用 Java 5 编译器但不能使用 Java 6 编译器编译的 Java 程序片段?

c++ - 如何在 Visual C++ 2010 Express 中更改编译器

C 语法生成无效表达式

parsing - 如何在编译器中实现前向引用?