实现CLR的功能语言(或者,关于F#的实现的论文) [英] Implementating functional languages for the CLR (Or, papers on the implementation of F#)

查看:115
本文介绍了实现CLR的功能语言(或者,关于F#的实现的论文)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道关于F#编译器的实现的任何好的文章?我试图生成一个简单的功能语言针对CLR的CIL代码,但我正在努力的几个方面。

Does anyone know of any good papers on the implementation of the F# compiler? I'm trying to generate CIL code for a simple functional language targeting the CLR, but I am struggling with a few aspects.

功能语言和CIL之间的差异是很难生成良好类型的CIL代码。我有通过类型擦除工作的解决方案,但我更愿意找到一种方法来生成反映(至少一些扩展)我的源语言的Hindley-Milner类型系统(例如,通过生成通用类)的CIL代码。从MS和Mono F#编译器生成的代码判断,他们设法实现这一切!

The differences between functional languages and CIL are making it hard to generate well-typed CIL code. I have solutions that work via type erasure, but I'd much rather find a way to generate CIL code that reflects (to at least some extend) the Hindley-Milner type system of my source language (e.g., by generating generic classes). Judging by the generated code from the MS and Mono F# compilers, they manage to achieve exactly this!

推荐答案

关于在F#上实现的学术论文 - 尽管编译器是开源的,因此您可以浏览源代码如果你想了解一些具体的细节。 (BTW:Mono中提供的F#编译器基于开源版本,因此它与Visual Studio中提供的F#编译器基本相同)。

There aren't many academic papers on the implementation on F# - although the compiler is open-source, so you can explore the source code if you want to learn about some specific details. (BTW: the F# compiler available in Mono is based on the open-source release, so it is essentially the same as the F# compiler available in Visual Studio).

只有相关的学术出版物是Don Syme的论文 ILX:扩展功能语言互操作性的.NET Common IL 。这是非常有趣的阅读 - 它讨论如何可以扩展IL以使函数式语言的编译更容易。在封面下,初始版本的F#编译器编译成这个扩展IL(ILX),然后将其翻译成普通IL。细节自那以后可能已经改变,但核心原则是一样的。

The only relevant academic publication is Don Syme's paper ILX: Extending the .NET Common IL for Functional Language Interoperability. It is quite interesting reading - it discusses how the IL could be extended to make compilation of functional languages easier. Under the cover, the initial versions of F# compiler compiled to this extended IL (ILX), which is then translated to ordinary IL. The details have probably changed since then, but the core principles will be the same.

这篇关于实现CLR的功能语言(或者,关于F#的实现的论文)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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