编程语言与软件工程2018dcs.gla.ac.uk
工程服务器软件的语言比较:Erlang、Go 与 Scala/Akka
Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka
进阶 · 约 60 分钟读完前置知识:并发编程基础、Erlang/Actor 模型、JVM 基础
导读
这篇论文通过一组基准实验,比较 Erlang、Go 和 Scala/Akka 三种语言在工程化服务器软件场景下的表现,考察并发、容错等服务器开发关键属性。作者用相同的服务器任务在三种语言上实现并测量性能差异。
HN 关注点:HN 读者长期关注服务器语言选型,这类跨语言实证比较能直接指导工程决策,评论焦点集中在实验方法是否公平、版本是否过时。
HN 评论精选
这几条评论里:质疑 1 补充 2 亲历 1
质疑质疑实验方法:未对齐并发模型,JVM 语言可能被低估
我感谢作者显然投入的时间,但发现几处错误和遗漏。C# 和 F# 是运行在 CLR 上的 VM 语言,CLR 与 JVM 非常相似。另外,Go 和 Erlang 使用的是用户态的 fiber 阻塞线程,公平的比较应该在 Scala/Java 中也用 Comsat/Quasar 实现 fiber 阻塞。我怀疑基于 JVM 的语言表现会远好于 Erlang,如果用了 fiber 阻塞线程甚至可能和 Go 一样快。补充:他们用的 Akka 应该就是 fiber 阻塞的,所以这部分批评可能不成立。不过 Scala 生成的代码通常比 Java 慢,我预计 Java 加 fiber 的性能会好 2-10 倍。
thermodynthrway查看英文原文
I appreciate the time obviously spent on this, but i see a couple errors and ommissions. C# and F# are VM languages that run on the CLR which is extremely similar to the JVM. Also, Go and Erlang use fiber blocking threads (userspace threads). A fair comparison would use fiber blocking in Scala/Java as well using Comsat/Quasar. I have a feeling JVM based languages would perform far better than Erlang, and possibly even as fast as Go if fiber blocking threads were used. Edit: they're using Akka which (I believe) IS fiber blocking so part of my critique may not apply. However, Scala is known for generating somewhat slower code than Java so I would expect Java with fibers to perform 2-10x better
亲历亲历:从 PHP 迁移到 Go 体验良好,但社区较小、编译限制烦人
我最近把网站(一个小搜索引擎)的核心页面从 PHP 迁移到了 Go。目前还没用 goroutine,只是逐行移植,整体体验很愉快。我强烈推荐 Go。唯一缺点是开发者社区较小(但在增长),找答案可能要多花点时间。另外希望它在排查问题时不要强制注释掉未使用的库和变量——运行时应该允许,构建时再限制就好。
ehonda查看英文原文
I recently switched the core pages of my website (a small search engine) to Go from PHP. Have not implemented any goroutines yet, just focused on a line-by-line port for now, and it was overall a fun experience. I would highly recommend Go. Only downside is the smaller (but growing) community of developers, so you might spend a little more time finding answers. Also I wish it didn't force you to comment out unused libraries or unused variables when you're trying to troubleshoot something. It should be allowed when running, but keep it restricted when building maybe?
补充指出实验版本过时,结论可能不反映当前性能
论文实验用的是 Erlang/OTP 19.0、Go 1.7.1、Scala 2.12.0 + Akka 2.4.12,这些版本相当过时。如果用最新版本重测会很有意思,尤其是刚发布的 Erlang/OTP 21.0——他们在本基准测试所考察的属性上做了大量优化。
ramchip查看英文原文
> In the experiments we use the following versions of the languages: Erlang/OTP 19.0, Go 1.7.1, Scala 2.12.0 with Akka 2.4.12. These are pretty outdated, it would be interesting to see numbers on the latest versions. I'd be especially curious to compare with Erlang/OTP 21.0 (coming out today) as they did a lot of optimization work on the attributes tested in this benchmark.
历次讨论
- 2018Hacker News 讨论帖233 分 · 48 评
同领域还值得读
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 分钟编辑精选