达马斯-辛德米尔纳类型推理算法的实现马斯、米尔、算法、类型

2023-09-11 03:01:05 作者:孤寂

我在寻找有关知名达马斯-辛德米尔纳算法信息 做类型推断的函数式语言,关于实施特别的信息。

I'm looking for information about the well-known Damas-Hindley-Milner algorithm to do type inference for functional languages, especially information about implementation.

我已经知道该怎么做的W-算法,但我听说了基于约束的生成器/解算器,而不是通常的统一最近的新算法。但是,我不能设法找到这些新算法的执行情况的任何讨论。

I already know how to do the W-algorithm, but I heard about recent new algorithms based on constraint generator/solver rather than usual unification. However, I can't manage to find any discussions about the implementation of those new algorithm.

任何想法,我能找到的ML推断一些疑问语气的信息?

Any idea where I could find some partical information on ML inference ?

推荐答案

如果您熟悉ML code,要找到这些东西的最佳方式是简单地考虑在野外的实现。一个很好的参考实现哈姆雷特的,其目的是为更多的测试平台,而不是一个生产实施。

If you're comfortable with ML code, the best way to find these things is to simply look into the implementations in the wild. A good reference implementation is HaMLet, which is designed as more of a test platform rather than a production implementation.

这些问题,几乎所有严重的最近的讨论将是在学术场地。这可能是感兴趣的一个纸张是Generalising辛德米尔纳类型推理算法。

Almost all serious recent discussion of these issues is going to be in scholarly venues. One paper that might be of interest is Generalising Hindley-Milner type inference algorithms.

此外,不同类型的系统在皮尔斯的类型和编程的实现(包括让多态性)语言,以及阿佩尔的现代编译器实现在ML 更符合现代的方法实施这一算法比W的香草说明。

Also, the implementations of various type systems (including let polymorphism) in Pierce's "Types and Programming Languages", as well as Appel's "Modern Compiler Implementation in ML" more closely match modern approaches to implementing this than the vanilla description of algorithm W.