对 Awk 创建者 Brian Kernighan 博士的简短采访 (2022)
A brief interview with Awk creator Dr. Brian Kernighan (2022)

原始链接: https://pldb.io/blog/brianKernighan.html

著名的加拿大计算机科学家 Brian Kernighan 博士在贝尔实验室与 Dennis Richie 一起开发了 UNIX。 他的开创性工作包括合着《C 编程语言》以及自 2000 年以来在普林斯顿大学任教。他创建了第一个“Hello World!” 程序并继续影响计算机科学界。 Kernighan 强调了 Awk 中关联数组的重要性,这个概念在现代语言中已经变得很常见,例如 Java 和 C++ 中的哈希图、Perl 和 Python 中的字典。 他指出,虽然模式-动作范式在其创建过程中并不新颖,但它被证明是针对某些类型的计算的有效组织技术。 在开发过程中的参考资料方面,Kernighan 提到,由于工作于 20 世纪 70 年代,现有技术非常稀缺。 然而,Yacc(用于创建和试验语法)和 Lex(自动化词汇级别)等基本工具通过简化繁琐的编码来帮助塑造流程。 Lex 是模式动作语言的一个典型例子。 当被问及对有抱负的编程语言设计者的建议时,Kernighan 建议从小型的专业项目开始。 他鼓励创建简单的编译器和运行时来简化特定任务。 参考 Jon Bentley 的旧而相关的文章,Kernighan 认为,与开发 Rust 或 C++ 等既定语言的替代品相比,此类努力仍然令人愉快、实用且可以实现。

1978 年,著名著作《C 编程语言》的作者 Brian Kernighan 表示,哈希表被认为“有点奇怪”。 然而,这一说法与历史证据相矛盾,历史证据表明哈希表在 20 世纪 60 年代和 1970 年代的计算机科学中得到了普遍使用和研究。 哈希表通常称为关联检索结构,是编译器、汇编器、链接器、数据库和文件系统中的标准功能。 它们早在 1973 年就出现在 Knuth 备受推崇的“计算机编程艺术”系列中,并且在整个 1970 年代,Communications of the ACM 上发表了大量讨论哈希表和相关主题的文章。 此外,Kernighan 本人也为其中许多出版物做出了贡献,这表明他确实熟悉这项技术。 Kernighan 的评论似乎是因为他专注于让编程语言更简单、更容易让初学者学习,主张将哈希表作为核心库结构,而不是要求用户手动实现它们。 到 1979 年,当 Unix 版本 7 发布时,以 Kernighan 的脚本语言 AWK 为特色,哈希表不再被视为深奥,而是编程中的常规工具。 如今,哈希表已成为现代编程语言(例如 Python、C++ 和 Java)中普遍存在的组件。 值得注意的是,第一篇讨论哈希表的论文由 Donald E. Knuth 撰写,可以追溯到 1968 年,而计算机协会 (ACM) 的 ACM 杂志的 Communications 中最早引用哈希表的是 1959 年此外,这个概念早于这两个里程碑,起源于 1953 年的 IBM 内部,并于 1956 年被 Dumas 记录在公开文献中。因此,考虑到哈希表已经有 20 多年的历史,Kernighan 对哈希表的描述是新颖的。 1978 年出版《C 编程语言》。
相关文章

原文

November 15, 2022 — Dr. Brian Kernighan is a Canadian computer scientist who contributed to the development of UNIX at Bell Labs. Along with Dennis Richie, he co-authored a fundamental book on C, The C Programming Language. He has been training the next generation of programmers at Princeton University since 2000 and has been monumental in his contribution to the computer science community at large. He wrote the first documented “Hello World!” program and to that we say, “Hello, Brian!”.

*

Dr. Kernighan: The main idea in Awk was associative arrays, which were newish at the time, but which now show up in most languages either as library functions (hashmaps in Java or C++) or directly in the language (dictionaries in Perl and Python). Associative arrays are a very powerful construct, and can be used to simulate lots of other data structures.

I guess the pattern-action paradigm was also not novel but not widely used at the time. It's an effective way to organize some kinds of computations.

*

When you were making programming languages what references did you use?

Dr. Kernighan: None? This was a long time ago (think 1970s), and the languages that I have been involved with have all been new and special-purpose so there wasn't much available prior art. Of course one vital tool was Yacc, which made it really easy to create and experiment with grammars and have them converted into highly efficient parsers. Lex did the same thing for the lexical level, again replacing a lot of tedious code with a set of rules. Lex is certainly an example of a pattern-action language; arguably Yacc is as well, so it's kind of a virtuous cycle.

*

What would be your advice to young people today who want to get into the field of designing programming languages?

Dr. Kernighan: Try designing and implementing small and special purpose languages. They are lots of fun, often very useful, and a great deal easier than trying to create a replacement for Rust or C++. Look for things that could be automated if you had the right kind of language to spell out the steps, then create a simple compiler and runtime. Jon Bentley wrote a couple of articles on this long ago that are still relevant.

Image from Wikimedia Commons. Thank you for your time Dr. Kernighan!

联系我们 contact @ memedata.com