# 萨瑟

**萨瑟**（Sather）是一门面向对象编程语言，由位于伯克利的国际计算机科学研究所（ICSI）开发，设计目标是简单、高效、安全且非专有。它最初基于埃菲尔（Eiffel），但融合了其他多种语言的思想与方法，并可编译为C代码，从而能与其他语言的目标文件高效链接。<sup>[1](https://steveomohundro.com/wp-content/uploads/2009/03/stoutamire_omohundro95_sather_11.pdf)</sup> 该语言提供垃圾回收、静态检查的强逆变类型、实现继承与类型继承相分离的多重继承、参数化类、动态分派、迭代抽象、高阶例程与迭代器、异常处理，以及包括前置条件、后置条件和类不变式在内的断言机制。<sup>[1](https://steveomohundro.com/wp-content/uploads/2009/03/stoutamire_omohundro95_sather_11.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 起源 | 在ICSI开发，该机构与加州大学伯克利分校计算机科学系有关联；首个编译器于1990年夏天用萨瑟自身编写，0.1版于1991年6月公开发布<sup>[2](http://ftp3.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/history.html)</sup> |
| 名称 | 以萨瑟塔（即钟楼）命名，该塔建于1914年，仿照威尼斯圣马可钟楼建造；此名亦为双关，因为萨瑟最初被设想为埃菲尔的高效、精简替代品<sup>[1](https://steveomohundro.com/wp-content/uploads/2009/03/stoutamire_omohundro95_sather_11.pdf)</sup> |
| 编译 | 编译为可移植的C代码；在MIPS平台上性能与手写C代码差距在10%以内，在SPARC平台上基本与C代码一样快<sup>[3](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)</sup> |
| 类型系统 | 静态检查的强逆变类型；程序员可以显式区分导致动态分派的声明与在编译期即可确定的声明<sup>[1](https://steveomohundro.com/wp-content/uploads/2009/03/stoutamire_omohundro95_sather_11.pdf)</sup><sup> • </sup><sup>[3](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)</sup> |
| 并行变体 | pSather增加了线程、同步和数据分布，同时呈现共享内存抽象；由ICSI伯克利与苏黎世联邦理工学院联合开发<sup>[4](https://www1.icsi.berkeley.edu/Sather/psather.html)</sup><sup> • </sup><sup>[5](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.38.5876)</sup> |
| 最终版本 | GNU Sather 1.2.3，2007年7月发布，为最后一个稳定版本；2025年3月26日因上游已死而从pkgsrc中移除<sup>[6](https://codearchaeology.dev/languages/sather/)</sup><sup> • </sup><sup>[7](https://mail-index.netbsd.org/pkgsrc-changes/2025/03/26/msg320108.html)</sup> |

## 历史与起源

萨瑟在ICSI创建，旨在满足研究项目对简单、高效、非专有的面向对象语言的需求。设计团队评估了C++、Objective C、埃菲尔、Self、[Smalltalk](https://www.edgepedia.org/zh/smalltalk)和CLOS，最终从埃菲尔出发，因为只有C++在效率上能满足他们的要求，但C++过于复杂，且缺乏垃圾回收和参数化类型。<sup>[3](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)</sup> 萨瑟最初基于埃菲尔，设计为非专有语言。<sup>[1](https://steveomohundro.com/wp-content/uploads/2009/03/stoutamire_omohundro95_sather_11.pdf)</sup>

命名遵循了埃菲尔以工程地标命名语言的模式：萨瑟塔是伯克利校园最著名的地标，建于1914年，仿照意大利威尼斯的圣马可钟楼建造。这一选择也有几分双关意味，因为该语言最初被设想为埃菲尔的高效、精简替代品。<sup>[1](https://steveomohundro.com/wp-content/uploads/2009/03/stoutamire_omohundro95_sather_11.pdf)</sup>

最初针对语言版本0的编译器，是1990年夏天用萨瑟自身编写的，通过手工翻译为C来完成自举。ICSI于1991年6月公开发布0.1版，几周之内，全球数百个研究小组便获取了副本。编译器、调试器以及数百个库类均可通过匿名FTP免费获取。<sup>[2](http://ftp3.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/history.html)</sup><sup> • </sup><sup>[3](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)</sup> ICSI自身的项目推动了这一设计：一个连接主义模拟器、一个高级视觉系统、一个用于语音识别的并行计算引擎，以及集成电路设计的CAD工具。<sup>[8](https://pubs.aip.org/aip/cip/article/6/5/444/987078/Sather-Provides-Nonproprietary-Access-to-Object)</sup>

第二条脉络很早就出现了。 Gerhard Goos领导下的卡尔斯鲁厄大学团队为萨瑟0.1创建了一个编译器；他们的方言萨瑟-K（Sather-K）是为教授经典编程和面向对象编程而开发的，并作为可复用类库的基础。萨瑟-K是静态类型安全的，意味着可以静态检查出没有任何方法调用会在运行时导致类型错误；当萨瑟1.0发布时，它已偏离了ICSI的规范。<sup>[2](http://ftp3.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/history.html)</sup><sup> • </sup><sup>[9](https://publikationen.bibliothek.kit.edu/195495/1940)</sup>

## 语言设计与特性

**契约与类型。** 萨瑟保留了断言、前置条件、后置条件和类不变式，但它没有埃菲尔那种对“契约式编程”的强调，并在共享强类型的同时采用了远比埃菲尔简单的继承方法。<sup>[3](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)</sup> 可以说萨瑟与埃菲尔的关键区别在于，其类型系统让程序员能在源码层面显式区分涉及动态分派的声明与编译器可以确定的声明，因此调用的运行时开销在代码中一目了然。<sup>[3](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)</sup> 该语言的大量工程精力投入到了类和类型系统上，设计决策均有文档记录，并与其他语言的方法进行了关联。<sup>[10](https://ora.ox.ac.uk/objects/uuid:289a097e-3df6-4572-a127-228ceb816f91)</sup>

**参数化类。** 参数化类的编译方式是为每个实例化生成单独代码，这使得调用目标可以编译进去而不带来性能开销。<sup>[3](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)</sup> 萨瑟1.0在其重大语言修订中加入了强类型参数化。<sup>[2](http://ftp3.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/history.html)</sup>

**迭代器。** 萨瑟1引入了迭代器，这是一种迭代抽象形式，像例程封装算法那样封装用户定义的循环控制结构。迭代器不使用return语句，而是使用yield和quit，且只能在循环中调用。每个类可以定义多种迭代器，而传统方法要求每种迭代都使用一个不同但紧密耦合的类。<sup>[11](https://people.eecs.berkeley.edu/~demmel/cs267/pSather_lecture.html)</sup><sup> • </sup><sup>[12](https://doi.org/10.1145/225540.225541)</sup>

**刻意精简。** 萨瑟的整个YACC文法仅一页纸，这体现了该语言有意为之的简洁性。<sup>[3](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)</sup> 明确的设计目标是：效率与C、C++或Fortran相当，与埃菲尔或CLU同样优雅且更安全，并像[Common Lisp](https://www.edgepedia.org/zh/common-lisp)、[Scheme](https://www.edgepedia.org/zh/scheme-programming-language)或Smalltalk那样支持高阶函数和迭代抽象。<sup>[4](https://www1.icsi.berkeley.edu/Sather/psather.html)</sup>

## 版本与实现

萨瑟1.0版代表了对语言的全面重新设计，增加了绑定例程和迭代器，将类型与代码包含干净分离，采用逆变类型和强类型参数化，支持异常，提供更强的可选运行时检查，并呈现了重新设计的库。1.0编译器由Stephen Omohundro和David Stoutamire于1994年夏天首次发布，此后Omohundro离开项目，Stoutamire成为维护者。<sup>[2](http://ftp3.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/history.html)</sup> 原定于1995年9月发布的萨瑟1.1，由David Stoutamire、Michael Philippsen、Claudio Fleiner和Boris Weissman完成，pSather成为1.1规范的一部分。<sup>[2](http://ftp3.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/history.html)</sup> ICSI自己的编译器线在1998年底的1.2b测试版后终止。<sup>[6](https://codearchaeology.dev/languages/sather/)</sup>

**GNU Sather。** 1999年，Norbert Nemec接管了1.2b代码库，以GNU Sather的名义继续推进，并在项目加入GNU计划时将编译器和库的许可证改为GNU GPL和LGPL。GNU Sather捆绑了编译器、类库、语言规范及其编程手册，以及一个可显示源代码和类继承有向图的浏览器；下载地址为ftp.gnu.org/gnu/sather/。<sup>[6](https://codearchaeology.dev/languages/sather/)</sup><sup> • </sup><sup>[13](https://directory.fsf.org/wiki/Sather)</sup> GNU Sather 1.2.3于2007年7月发布，是最后一个稳定版本，此后项目一直处于休眠状态。<sup>[6](https://codearchaeology.dev/languages/sather/)</sup>

**pSather。** pSather是萨瑟的并行扩展，提供共享内存编程模型，集成了控制并行和数据并行扩展，特别针对CM-5等分布式内存机器；由ICSI伯克利与[苏黎世联邦理工学院](https://www.edgepedia.org/zh/eth-zurich)联合开发。<sup>[5](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.38.5876)</sup> 它用线程、同步和数据分布扩展了串行萨瑟。与基于参与者模型的语言不同，多个线程可以在一个对象中执行，一个特殊的类GATE高效地组合了底层同步机制：锁、未来值和条件。<sup>[4](https://www1.icsi.berkeley.edu/Sather/psather.html)</sup> 尽管pSather程序可以在分布式计算机系统上运行，但它们为所有线程提供了共享内存抽象。<sup>[11](https://people.eecs.berkeley.edu/~demmel/cs267/pSather_lecture.html)</sup> pSather 1.0的设计主要归功于Stephan Murer和David Stoutamire，初始版本在Sequent Symmetry和Thinking Machines CM-5上运行。<sup>[2](http://ftp3.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/history.html)</sup><sup> • </sup><sup>[8](https://pubs.aip.org/aip/cip/article/6/5/444/987078/Sather-Provides-Nonproprietary-Access-to-Object)</sup> pSather编译内置于串行萨瑟编译器中，该系统已被证明可在SunOS 4.1.3、Solaris 2.4以及Linux 1.1.59和1.2.4版本下工作。<sup>[4](https://www1.icsi.berkeley.edu/Sather/psather.html)</sup>

## 与埃菲尔及其他语言的比较

萨瑟与埃菲尔共享强类型和面向对象分派，但在三个有据可查的方面有所不同。它不强调契约式编程；它采用远比埃菲尔简单的继承方法；其类型系统使动态分派显式化，因此程序员可以看到哪些声明由编译器解析，哪些会产生分派开销。<sup>[3](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)</sup> 与促成萨瑟设计的比较对象C++相比，萨瑟提供了垃圾回收和参数化类型——这正是ICSI认为C++缺失的两个特性。<sup>[3](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)</sup> 与Lisp和Smalltalk家族相比，它提供了相当的迭代抽象和高阶例程，同时具备编译为C的效率。<sup>[4](https://www1.icsi.berkeley.edu/Sather/psather.html)</sup>

## 性能与采用

设计者报告的基准测试显示，编译后的萨瑟代码在MIPS机器上与手写C代码的性能差距在10%以内，在SPARC架构上基本与手写C代码一样快。在包括汉诺塔和八皇后的一系列基准测试中，萨瑟的表现略优于C++，并数倍优于埃菲尔。<sup>[3](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)</sup> 另一项在RISC机器上进行的比较性能研究，使用指令集使用统计、缓存模拟以及由插桩的萨瑟生成代码收集的数据，得出结论：萨瑟程序的总体CPU和内存使用情况与可比的C程序几乎相同，仅为编程便利付出了适度的开销。<sup>[14](http://ftp3.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/Publications/tr-91-034.html)</sup>

ICSI的萨瑟编译器多年来在数十万行代码的中型项目中积极用于开发。<sup>[15](https://ftp2.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/future.html)</sup>

## 当前状态

ICSI的萨瑟项目已正式停止活动；编译器和工具仍可下载但不再提供支持，对pSather的活跃研究也已停止。ICSI结束项目后，一些语言爱好者继续在个人项目中使用该语言。<sup>[15](https://ftp2.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/future.html)</sup> 2021年9月发往bug-sather邮件列表的一篇帖子描述了成功编译萨瑟的情况，表明进入2020年代后仍有有限但真实的社区使用。<sup>[16](https://lists.libreplanet.org/archive/html/bug-sather/2021-09/msg00000.html)</sup>

实际情况此后进一步收窄。2025年3月，有人提议从pkgsrc中移除lang/sather，因为上游开发于2009年停止，且该包在NetBSD 10、Linux、Darwin和SmartOS上均已损坏，半数到三分之二的构建在编译过程中因段错误而失败。<sup>[17](https://mail-index.netbsd.org/pkgsrc-users/2025/03/23/msg041304.html)</sup> 萨瑟于2025年3月26日从pkgsrc中移除，提交说明称其上游已死并引用了构建问题。<sup>[7](https://mail-index.netbsd.org/pkgsrc-changes/2025/03/26/msg320108.html)</sup>

## 遗产

萨瑟最持久的影响在教学中。萨瑟164——一种萨瑟方言——为Cool（课堂面向对象语言）奠定了基础，后者由Alexander Aiken创建，多年来一直是斯坦福CS143课程及其在线后续课程中教授编译器构造所使用的语言。<sup>[6](https://codearchaeology.dev/languages/sather/)</sup>

## References

1. [Sather 1.1 (David Stoutamire & Stephen Omohundro)](https://steveomohundro.com/wp-content/uploads/2009/03/stoutamire_omohundro95_sather_11.pdf)
2. [The History of Sather, ICSI (GNU mirror)](http://ftp3.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/history.html)
3. [The Sather Language and Libraries (Omohundro & Lim, 1992)](https://steveomohundro.com/wp-content/uploads/2009/03/omohundro_lim92_the_sather_language_and_libraries.pdf)
4. [pSather home page, ICSI](https://www1.icsi.berkeley.edu/Sather/psather.html)
5. [pSather: Layered Extensions to an Object-Oriented Language for Efficient Parallel Computation (ICSI TR-93-028)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.38.5876)
6. [Sather, CodeArchaeology](https://codearchaeology.dev/languages/sather/)
7. [CVS commit: pkgsrc (removal of lang/sather), NetBSD](https://mail-index.netbsd.org/pkgsrc-changes/2025/03/26/msg320108.html)
8. [Sather Provides Nonproprietary Access to Object-Oriented Programming, Computers in Physics 6(5), 1992](https://pubs.aip.org/aip/cip/article/6/5/444/987078/Sather-Provides-Nonproprietary-Access-to-Object)
9. [Sather-K language description report, Karlsruhe / KIT](https://publikationen.bibliothek.kit.edu/195495/1940)
10. [Engineering a Programming Language: The Type and Class System of Sather (ICSI TR-93-064), Oxford Research Archive](https://ora.ox.ac.uk/objects/uuid:289a097e-3df6-4572-a127-228ceb816f91)
11. [CS267: Programming with pSather, UC Berkeley course notes](https://people.eecs.berkeley.edu/~demmel/cs267/pSather_lecture.html)
12. [Iteration abstraction in Sather, ACM](https://doi.org/10.1145/225540.225541)
13. [Sather, Free Software Directory](https://directory.fsf.org/wiki/Sather)
14. [Sather Language Design and Performance Evaluation (ICSI TR-91-034)](http://ftp3.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/Publications/tr-91-034.html)
15. [The Future of Sather, ICSI](https://ftp2.gwdg.de/pub/gnu/www/software/sather/ICSI_Sather/future.html)
16. [[bug-sather] Successfully compiling Sather, September 2021](https://lists.libreplanet.org/archive/html/bug-sather/2021-09/msg00000.html)
17. [Re: sather removal proposal, pkgsrc-users mailing list, March 2025](https://mail-index.netbsd.org/pkgsrc-users/2025/03/23/msg041304.html)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Programming languages › Individual programming languages › C-family and imperative languages

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/sather

English original: https://www.edgepedia.org/sather
