编程语言与软件工程2013leafpetersen.com
衡量 Haskell 差距
Measuring the Haskell Gap
进阶 · 约 45 分钟读完前置知识:Haskell 基础、C 语言、编译器优化基础
导读
这篇论文系统测量了 Haskell 与 C 在性能上的差距(即 "Haskell Gap"),通过基准测试比较 Haskell 编译器(HRC)与 C 编译器(GCC、ICC)的代码性能。结论指出差距很大程度上取决于代码编写者对各语言的熟练程度以及编译器的优化能力,Haskell 编译器已能利用数据结构内在特性进行优化,性能表现令人印象深刻。
HN 关注点:语言性能基准测试的方法论问题,以及 Haskell 编译器优化水平究竟达到了什么程度。
HN 评论精选
这几条评论里:支持 3 补充 1
支持称赞论文质量,建议改进图表符号的一致性
这篇论文很棒,可读性强、动机清晰,我学到不少东西,也期待去读 2012 年的 Ninja C 论文。一个小建议:希望改进各图表符号的规范化——如果不仔细看每张图的图例,读者可能会把结果错误归因(比如我下意识想把 Intel 的 HRC 和“带方框的浅灰色”关联起来,但这种表示在各图之间并不一致)。
breckinloggins查看英文原文
This is a great paper; it is very readable and motivated and I learned quite a bit. I'm also now looking forward to perusing the 2012 Ninja C paper. One small change I would make to the preprint would be to better normalize the graph symbols. In particular, failing to read the legends of each graph carefully might cause readers to misattribute results in subsequent graphs (for example, my mind wanted to associate Intel's HRC with "the lighter gray ones with the boxes", which is not a stable representation across all graphs).
补充惊叹 Haskell 编译器基于数据结构特性的优化能力
有趣的是 Haskell 基于数据结构的内在特性来优化算法,而 C 编译器则利用对底层机器的知识。Haskell 编译器已经发展到如此程度,令人惊叹。
arocks查看英文原文
It is interesting to read how Haskell optimized the algorithm based on the instrinsic properties of the data structures. In contrast, C compilers leveraged on the knowledge of the underlying machine. It is amazing how far Haskell compilers have come.
支持认同结论:基准测试结果取决于写代码的人和编译器质量
我觉得这个结论很好:语言基准测试的老问题就是——代码是谁写的,他们对各语言的熟练程度如何。正如文章指出的,编译器也很重要:某些情况下 ICC 比 GCC 快 200% 以上,通常也快 15-20%,主要归功于更智能的内联和更快(且在 fpmath=fast 下更精确)的数学库。
berkut查看英文原文
It's a good conclusion I feel: this is always the issue with language benchmarks - who wrote the code, and how good were they with each of the languages. Similarly as the article points out, the compiler matters a lot: ICC can in certain cases be more than 200% faster than GCC with similar flags, and is generally 15-20% faster anyway, mainly due to more intelligent inlining and much faster (and more accurate with fpmath=fast) math libs.
支持称赞基准测试质量及 HRC 的表现
这是一个做得很好的基准测试,也是 HRC 令人印象深刻的展示。感谢分享!
joelthelion查看英文原文
This is a nicely done benchmark, and an impressive demonstration of HRC. Thanks for posting!
历次讨论
- 2013Hacker News 讨论帖148 分 · 35 评
同领域还值得读
Google 的软件工程(2017)
Software Engineering at Google (2017)
介绍了 Google 的软件工程实践,包括其单一代码库(monorepo)、几乎全部开发在主干进行而非分支、代码审查、构建系统 Blaze、协议缓冲区等工具与流程,并讨论了频繁重…
编程语言与软件工程2017 · 1,127 分 · 465 评 · 引用 15入门 · 约 45 分钟编辑精选Peter Naur:编程作为理论构建 (1985)
Peter Naur – Programming as Theory Building (1985)
Peter Naur 1985 年的经典论文《Programming as Theory Building》提出:编程的本质不是写代码或文档,而是在程序员头脑中构建对程序及其运行…
编程语言与软件工程2016 · 629 分 · 74 评入门 · 约 45 分钟编辑精选SciPy 1.0:Python 科学计算的基础算法
SciPy 1.0: fundamental algorithms for scientific computing in Python
这篇发表于 Nature Methods 的论文介绍了 SciPy 1.0——Python 科学计算生态的基石库,涵盖其核心算法模块(优化、积分、插值、线性代数等)、软件架构与社…
编程语言与软件工程2020 · 387 分 · 98 评入门 · 约 45 分钟编辑精选Lisp 的历史(1979)
History of Lisp (1979)
这是 Lisp 发明者 John McCarthy 于 1979 年为 HOPL(编程语言史)会议撰写的回顾文章,讲述 Lisp 的起源、设计动机与早期演进,文中也涉及 if 表…
编程语言与软件工程2018 · 352 分 · 44 评入门 · 约 45 分钟编辑精选使用 NumPy 进行数组编程
Array Programming with NumPy
这篇 Nature 文章介绍 NumPy 的数组编程模型及其在科学计算中的核心作用:以 ndarray 为中心,通过向量化操作让 Python 高效处理多维数组。
编程语言与软件工程2020 · 318 分 · 134 评入门 · 约 40 分钟编辑精选