Algol 68:一门雄心勃勃的系统语言,却始终未能超越C语言

1作者: alexandratabone6 个月前原帖
当人们谈论可能取代C语言的编程语言时,Algol 68并不常被提及,但它其实应该被关注。 Algol 68于1968年由国际计算机协会(IFIP)标准化,是Algol 60的继任者,拥有更丰富的类型系统、正交设计以及现代语言中仍然可以看到的特性:用户定义类型、灵活数组、结构化控制流,甚至在某些实现中还包含内置的并发原语。它也能够进行低级系统工作,如直接内存访问、指针运算和位运算,但具有更严格的类型检查,并且在某些编译器中进行了边界检查。 曾有过严肃的尝试将其用于实际系统:在IBM大型机上使用的FLACC编译器、在ICL 1900系列上的Algol 68R,甚至在大学进行的操作系统内核实验。当时的基准测试有时在同一硬件上与C语言相匹配或超越。 那么,为什么它会逐渐被遗忘呢?该语言的报告被认为极其晦涩(根据Dijkstra的说法是“智力灾难”),早期的编译器速度慢且不完整,而到了70年代中期,Unix和C语言已经获得了巨大的势头。Algol 68从未获得像C语言那样的工具、库或市场推广。 现在回头看,Rust和Zig所受到的赞誉——严格的类型、内存安全选项、清晰的并行语法——在50多年前的Algol 68中就已经存在。它只是没有赢得流行度的竞争。
查看原文
When people talk about the languages that could have replaced C, Algol 68 doesn’t come up often but it probably should.<p>Standardized in 1968 by IFIP, it was a successor to Algol 60 with a much richer type system, orthogonal design, and features you still see in modern languages: user-defined types, flexible arrays, structured control flow, and even built-in concurrency primitives in some implementations. It could do low-level systems work too direct memory access, pointer arithmetic, bitwise operations but with stricter type checking and, in some compilers, bounds checking.<p>There were serious attempts to use it for real systems: the FLACC compiler on IBM mainframes, Algol 68R on the ICL 1900 series, and even experiments with OS kernels at universities. Benchmarks from the time sometimes matched or exceeded C on the same hardware.<p>So why did it fade? The language report was infamously dense (“an intellectual disaster” according to Dijkstra), early compilers were slow and incomplete, and by the mid-70s Unix and C had huge momentum. Algol 68 never got the tooling, libraries, or marketing push that C enjoyed.<p>Looking at it now, a lot of what Rust and Zig are praised for strict typing, memory safety options, clean syntax for parallelism was already in Algol 68 more than 50 years ago. It just didn’t win the popularity contest.