对 GHC 扩展进行分类
我想知道 GHC 的扩展是否可以基本上分为两个不同的类别,
- 一类提供“语法糖”或便利
- ,另一类引入新的东西,例如新的范例。
现在假设可以将现有扩展分为上述类别,哪个扩展适合哪个类别?
I was wondering if GHC's extensions can be divided into basically two different categories
- those that provide "syntactic suggar" or convenience
- and those that introduce something new, a new paradigm for instance.
Now provided one could divide the existing extensions into the above categories which extension would fit into which category?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为更合适的分类是按编译器管道将其划分:
语法扩展
类型系统扩展
跨领域延伸< /strong>
优化
代码生成扩展
运行时扩展
你觉得怎么样?并非每个标志都可以 (a) 根据现有结构定义,或 (b) 编译器的新部分。这是更微妙的。
还有很多其他的扩展,看看你是否可以按照这种形式对它们进行分类。
I think a more appropriate categorization would be to divide it up by the compiler pipeline:
Syntactic extensions
Type System Extensions
Cross-cutting extensions
Optimizatsions
Code Generation Extensions
Runtime Extensions
What do you think? Not every flag is either (a) definable in terms of existing constructions, or (b) a new part of the compiler. It's more subtle.
There are many other extensions too, see if you can classify them in this form.
这些标志已在标志参考< /a> 在 GHC 的用户指南中,语言扩展在 语言功能。
The flags are already categorized in the flag reference in the GHC's users guide, and the language extensions are broken down into various categories in the section on language features.