什么是超级编译? [英] What is supercompilation?

查看:113
本文介绍了什么是超级编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简短而甜蜜:我见过几个来源谈论超级编译。但我还没有在互联网上的任何地方找到一个单一的文档,描述这是什么。大概是因为它看起来很简单,甚至不值得解释。

Short and sweet: I've seen several sources talking about "supercompilation". But I have yet to find one single document anywhere on the face of the Internet which describes what this is. Presumably because it seems simple enough to whoever that it isn't even worth explaining.

有人知道这是什么?

推荐答案

超级编译可以作为部分评估的推广。部分评估背后的想法是,程序的许多部分可以在编译时评估,因此应该是。超级编译扩展了这个,评估在编译时不能完全做的事情,例如把 map f(map g xs)变成 map f。g)xs 没有任何除了映射的定义(至少我认为我有部分评价权 - 我只读了很多超级编译)。

Supercompilation can be approached as a generalization of partial evaluation. The idea behind partial evaluation is that many parts of a program can be evaluated at compile time, and so should be. Supercompilation extends this, evaluating things that can't be fully done at compile time as well, like turning map f (map g xs) into map (f . g) xs without anything besides the definition of map (At least I think I got partial evaluation right - I've only read much about supercompilation).

另一种观察方式是结合许多其他优化,如砍伐森林,专业化和内联。通过作用就像它已经知道函数和评估的输入,它可以获得一个更直接的计算结果的方法 - 它可以通过查看它们将如何被使用或者它可以插入所有可能的值来摆脱中间数据结构,然后将结果换成 case ,或者用其假装值做其他事情。

Another way to look at it is as a combination of many other optimizations, like deforestation, specialization, and inlining. By acting as if it already knew the inputs to functions and evaluating, it can get a more direct method of calculating the result - it can get rid of intermediate data structures by seeing how they will be used or it can plug in all possible values and then wrap the result in a case, or do something else with its pretend values.

Max Bolingbroke有一个数字的有用论文 - 我推荐第一个,超级编译通过评估,作为介绍。第二部分以示例的方式介绍主题,其余部分,虽然有点难以理解,但是对于过程非常有用。 Neil Mitchell还有一个好的演示文稿数量来描述它。

Max Bolingbroke has a number of useful papers on the subject - I recommend the first one, Supercompilation by Evaluation, as an introduction. Section 2 introduces the subject by example and the rest, while a bit difficult to get through, is very informative about the process. Neil Mitchell also has a number of good presentations describing it.

我希望能有所帮助。

这篇关于什么是超级编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆