编程语言与软件工程2013lafo.ssw.uni-linz.ac.at编辑精选
One VM to Rule Them All:一个虚拟机统治一切
One VM to Rule Them All
进阶 · 约 60 分钟读完前置知识:JVM 基础、JIT/编译器基础、AST 解释器
导读
这篇论文(Oracle Labs 在 JVM Language Summit 上的演讲)介绍 Truffle 语言实现框架与 Substrate VM:用 JVM 作为宿主,通过 AST 解释器加 Graal JIT 让多种现有语言在 JVM 上跑得快,并能直接调用庞大的 JVM 库;Substrate VM 则提供提前编译(AOT),以获得低内存占用、快速启动和单一二进制部署。
HN 关注点:能否让多种语言既快又复用 JVM 生态,同时对 Oracle 主导、开源实现性能落后以及 Substrate VM 的真实身份表示疑虑。
后来怎么样
Truffle 与 Graal 后来发展为 GraalVM,Substrate VM 演化为 GraalVM Native Image,推动了 JVM 上的多语言实现与 AOT 原生镜像部署;Graal JIT 也成为 HotSpot 的可选即时编译器。
HN 评论精选
这几条评论里:支持 1 补充 2 亲历 1
亲历担忧 Oracle 对基础 VM 的掌控,亲历自由 Java 实现性能远逊于 Oracle 闭源版。
看起来有意思,但我对 Oracle 掌控的东西普遍不放心。举个简单例子:我有一台 Openpandora,用 Java 写了个带极简 Lisp 核心的 live coding 环境。用任何自由 Java 实现,它要么起不来(core dump,怀疑内存不足以启动 VM),要么慢到不可用;而用 Oracle 闭源的 Java 7 ARM 版,跑得很快(和我的 Macbook 上一样流畅)且内存占用很小。x86 上体验类似,只是资源充裕不明显。我不要求一切都开源,但基础语言/VM 应当是开源的。除非这点改变,我不会再用 Oracle 拥有的东西。
tluyben2查看英文原文
This looks interesting, but I am generally worried about something being owned by Oracle. Simple example; I own an Openpandora. I wrote a live coding environment in Java with a very basic, lispy language at it's core. Using any free Java implementation it either; did not start (core dump; suspect; not enough memory to get even the VM up) or ran very (unusable) slow. With the Java 7 closed source ARM version from Oracle; runs fast (just as smooth as on my Macbook) and uses very little memory. I have the same experience on x86, but because of the abundance of resources it's less noticable. I don't insist on everything being open source (completely), but base languages/VMs should be. Unless something about this changes, I'm not using anything owned by Oracle again.
支持看好快速语言实现、JVM 库生态以及 SubstrateVM 带来的低占用、快启动、易部署。
太棒了。第一,这意味着现有语言可以有快的实现;第二,可以对接海量 JVM 库(这是大事);第三,SubstrateVM 似乎能带来我喜欢 Go 的那些特性:低内存占用、快速启动、易部署(给我一个自包含的二进制)。只要把原生互操作(C 和 C++)做简单,这就是赢家。
steeve查看英文原文
This is amazing. First because it means we can have _fast_ versions of existing languages. Second because we can interact with the _huge_ amount of JVM libraries (this is a very big deal). Third because SubstrateVM seem to be enabling the things I really like about Go: low memory footprint, fast startup time, and easy deployment (give me a binary that does everything I need). They just need to make sure native interop is easy (both C and C++), and we have a winner!
补充追问 Substrate VM 的具体身份(LLVM vmkit 还是 Maxine),并指出 AOT 值得关注。
那 Substrate VM 到底是什么?主演讲看起来讲的是 Truffle 这个语言实现框架,本身就不错。'Substrate VM Execution Model' 幻灯片提到提前编译(AOT),听起来可能是基于 LLVM 的 Substrate VM(vmkit.llvm.org),或者会不会是 Maxine 的一个版本?AOT 作为选项当然有意思。
mpweiher查看英文原文
So what is the Substrate VM? The main presentation appears to be about Truffle, a language-implementation framework, which looks neat by itself. The "Substrate VM Execution Model" slide talks about Ahead Of Time Compilation, which makes it sound like it might actually be the LLVM-based Substrate VM: http://vmkit.llvm.org. Alternatively, could it be a version of Maxine? AOT as an option certainly sounds interesting...
补充将其与 Parrot 类比,并指出 JS 与 JVM 已部分占据多语言运行时生态位。
确实是有趣的项目。把它和 Parrot 比较会很有意思,后者有类似目标。JavaScript 和 JVM 目前在一定程度上占据了这个生态位,尽管两者最初都不是为此设计的。
bryanlarsen查看英文原文
Definitely an interesting project. It would be interesting to compare this to parrot[1], which had similar goals. Javascript and the JVM are currently occupying this niche to a certain degree, although neither were originally designed for this niche. 1: http://www.parrot.org/
历次讨论
- 2013Hacker News 讨论帖161 分 · 88 评
同领域还值得读
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 分钟编辑精选