编程语言与软件工程2011ics.uci.edu
Oberon——被忽视的珍宝
Oberon – The Overlooked Jewel
进阶 · 约 30 分钟读完前置知识:操作系统基础、编译器/语言实现基础、Pascal 或 Modula 系语言常识
导读
这篇论文回顾 Niklaus Wirth 的 Oberon 系统与语言,论证它是一颗被业界低估的“宝石”——其极简、安全、模块化的设计思想远超同时代。评论补充:Oberon 早在数十年前就实现了最早的 JIT 编译之一、用鼠标点击直接执行代码等特性,其理念还影响了后来的 Go 等语言。
HN 关注点:Oberon 超前的系统设计(JIT、点击执行、用安全语言写操作系统)为何没能被工业界采纳,以及它对现代语言的深远影响。
后来怎么样
Oberon 系统本身未被工业界采纳,但其极简语言、模块化系统设计与早期 JIT/动态加载实践被后续语言与系统(如 Go 的方法绑定与声明风格)吸收,成为 Wirth 系统软件思想的经典范例。
HN 评论精选
这几条评论里:质疑 1 补充 1 亲历 2
亲历Oberon 超前于时代:最早的 JIT 之一、点击执行、Active Text,并力荐 Wirth 的编译器/算法/系统三本书。
我曾试用过 Oberon,不得不说它远远超前于时代。论文作者不仅发明了最早的 JIT 编译系统之一,而且(对一门系统编程语言而言)鼠标点击即可执行代码的能力(类似 Rob Pike 的 ACME 编辑器)至今仍不多见。Oberon 上还试过不少新颖想法,比如有篇叫“Active Text”的论文允许把视频放进代码注释(Smalltalk 或许也能做到)。最后,所有讲细节的书都强烈推荐:Wirth 的编译器书是轻松经典(Oberon-0 的语法只占两页),他的算法书里有别处难找的精彩描述(求中位数的分治、多相排序),而《Project Oberon》包含别处罕见的系统软件细节,比如 PieceLinkText——据我所知是实现文本编辑器的最佳数据结构,比 rope-strings 早很多。
sb查看英文原文
I tried Oberon once and have to say that it was way ahead of its time. Not only did the author (of the linked paper) invent one of the first JIT compiled systems, but also the ability to execute code with a mouse click (similar to Rob Pike's ACME editor) is---for a systems programming language---still not available today. There were several novel research ideas tried for the Oberon system. I remember there was some paper called "Active Text" that allowed putting videos into code comments. (Probably that could have been done in Smalltalk, too.) Finally, all of the books explaining details are heartily recommended. Wirth's compiler book (referred to at HN several times) is a classic easy-going introduction (the Oberon-0 grammar fits on only two pages IIRC! [1]), his algorithm book (also available for download, also referred to multiple times at HN) has some of the nicest descriptions that I did not find anywhere else (showing a divide-and-conquer approach to computing the median [near the Quicksort treatment]; plus polyphase sort, which might be useful again in data centers), and finally the Project Oberon book contains some unique treatment on system software that is not easily found anywhere else. For example, it contains the details on what's called PieceLinkText, which is the (at least AFAIK) best data structure to implement a text editor and it's operations. (Predating rope-strings by a fair amount of time, too.) edit: [1]: just checked my own copy; Oberon-0's grammar actually fits on one page, the full Oberon grammar fits on two pages! [2]: URLs: - Compiler book: http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf - Algorithm book: http://www.inf.ethz.ch/personal/wirth/books/AlgorithmE1/AD2012.pdf - Project Oberon: http://www.inf.ethz.ch/personal/wirth/books/ProjectOberon.pdf
亲历Oberon 证明了安全语言可写 OS,其模块化 UI 设计很优雅,并影响了 Go 的方法绑定方式。
相当不错的系统,我大学时甚至为它写过词法/语法分析器。它活生生地证明了可以用一门安全的系统编程语言来开发操作系统。Native Oberon 用起来很舒服,UI 概念能映射到 Oberon 模块,因此可扩展性很好。可惜工业界从未采纳。Go 中方法与类型的关联方式就受 Oberon 语言族影响(见 Component Pascal)。
pjmlp查看英文原文
Quite a nice system. I even wrote a lexer/parser for it back on my university days. It is the living proof that it is possible to use a safe systems programming language for operating system development. The Native Oberon system was quite nice to use in how the UI concepts would map to Oberon modules, as such it was quite extensible. Sadly, it never got picked up by the industry. The way methods are associated with types in Go has been influenced by Oberon language family (see Component Pascal).
质疑质疑:Pascal 系语言碎片化严重、用户太少难以选择,官方资源也似已停滞。
我在 Borland Pascal 上长大,对 Pascal 及其衍生语言有感情,也对它们输给 C 衍生语言感到遗憾。(我最近读了些 Modula 3 的资料,对其模块系统很感兴趣。)但用户少、碎片化严重(Borland Pascal/Delphi、Object Pascal、Component Pascal;Modula-2/3;Oberon、Oberon-2、Oberon-07、Active Oberon、Zonnon)。这些语言加起来用户群可能也就和 Common Lisp 差不多“大”,让人怎么选?而且 ETH 上的 Oberon 网页看起来像废弃了一样。
zvrba查看英文原文
Having grown up on Borland Pascal, I have a sentiment for Pascal and its derivatives. I enjoyed programming in BP, and I'm not too happy that Pascal derivatives lost their popularity to C derivatives. (I was reading a bit about Modula 3 and got quite intrigued by its module system.) But, users are few, fragmentation is high (Borland Pascal/Delphi, Object Pascal, Component Pascal; Modula-2 and Modula-3; Oberon, Oberon-2, Oberon-07, Active Oberon, Zonnon). How the heck are you supposed to choose when all those languages taken together have probaby about user base as "large" as that of common lisp? Plus, Oberon webpages at ETH look like abandoned.
补充力荐《Project Oberon》一书:550 页内含完整 OS 与编译器源码,讲得清楚。
《Project Oberon: The Design of an Operating System and Compiler》一书详细讲解了 Oberon 编译器和操作系统的设计。它不仅讲得清楚,而且不到 550 页就包含了编译器和操作系统的完整源码!我从中学到了一些有趣的编译器技术。
magoghm查看英文原文
The book "Project Oberon: The Design of an Operating System and Compiler" http://www.amazon.com/Project-Oberon-Design-Operating-Compiler/dp/0201544288/ref=sr_1_1?ie=UTF8&qid=1366902572&sr=8-1&keywords=project+oberon contains a detailed explanation of the design for the Oberon compiler and operating system. Not only it is well written with clear explanations, but it also includes the full source code for the compiler and operating system in less than 550 pages! I learned some interesting compiler techniques from reading that book.
历次讨论
- 2011Hacker News 讨论帖50 分 · 8 评
- 2012Hacker News 讨论帖54 分 · 57 评
- 2013Hacker News 讨论帖83 分 · 53 评
同领域还值得读
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 分钟编辑精选