Knuth是计算机世界头号牛人,其TAOCP(The Art of Computer Programming)是计算机科学界的圣经,他写的TeX是科学论文排版的标准。他可能是除了RMS之外,最有名的Emacs用户了。
今年四月,Donald Knuth的访谈,我翻译了其中讲他用什么工具那一段。翻译很烂,主要为自己更好地理解。
Andrew: What set of tools do you use today for writing TAOCP? Do you use TeX? LaTeX? CWEB? Word processor? And what do you use for the coding?
问:写TAOCP你用些什么工具?TeX?LaTeX?CWEB?还是字处理器?你用什么工具写代码呢?
Donald: My general working style is to write everything first with pencil and paper, sitting beside a big wastebasket. Then I use Emacs to enter the text into my machine, using the conventions of TeX. I use tex, dvips, and gv to see the results, which appear on my screen almost instantaneously these days. I check my math with Mathematica.
答:我一般的工作习惯是,先坐到一个大废纸篓旁,把所有的东西用纸笔写下来。然后在Emacs编辑器里,用TeX的格式把文本输入到机器里。我用tex,dvips和gv查看如今几乎是可以立刻显示到屏幕上来的结果。我用Mathematica检查我的数学公式。
I program every algorithm that’s discussed (so that I can thoroughly understand it) using CWEB, which works splendidly with the GDB debugger. I make the illustrations with MetaPost (or, in rare cases, on a Mac with Adobe Photoshop or Illustrator). I have some homemade tools, like my own spell-checker for TeX and CWEB within Emacs. I designed my own bitmap font for use with Emacs, because I hate the way the ASCII apostrophe and the left open quote have morphed into independent symbols that no longer match each other visually. I have special Emacs modes to help me classify all the tens of thousands of papers and notes in my files, and special Emacs keyboard shortcuts that make book writing a little bit like playing an organ. I prefer rxvt to xterm for terminal input. Since last December, I’ve been using a file backup system called backupfs, which meets my need beautifully to archive the daily state of every file.
我用CWEB给每一个讨论到的算法写程序(这样我才能完全的理解那个算法),它跟GDB调试器配合很好。我用MetaPost作图(偶尔,我也会用Mac机上的Adobe Photoshop或Illustrator)。我有一些自己写的工具,像我自己的用来在Emacs里检查Tex和CWEB语法的拼写检查工具。我设计了我自己的位图字体在Emacs里使用,因为我不喜欢ASCII apostrophe和left open quote看起来像独立的符号,视觉上互不搭配。我有特殊的Emacs模式来帮助我给我机器中的成千上万份论文和笔记做分类,我有特殊的Emacs键绑定让写书轻松地有点像弹奏某种乐器一样。虚拟终端的选择,相对xterm,我更喜欢rxvt。从去年10起,我开始用一个教backupfs的文件备份系统,它能给每个文件每天的状态存档,正好满足我的需求。
According to the current directories on my machine, I’ve written 68 different CWEB programs so far this year. There were about 100 in 2007, 90 in 2006, 100 in 2005, 90 in 2004, etc. Furthermore, CWEB has an extremely convenient “change file” mechanism, with which I can rapidly create multiple versions and variations on a theme; so far in 2008 I’ve made 73 variations on those 68 themes. (Some of the variations are quite short, only a few bytes; others are 5KB or more. Some of the CWEB programs are quite substantial, like the 55-page BDD package that I completed in January.) Thus, you can see how important literate programming is in my life.
根据我机器上的当前目录状态,我今年至今写了68个不同的CWEB程序。2007年,我大约写了100个,06年90个,05年100个,04年90个。CWEB有一个极其方便的“改变文件”的机制,用它我可以飞快地根据一个主题文件创建多个不同的版本和不同的变体。08年至今,我已经有73个变体,68个主题文件了。(一些变体很短,只有几个字节,另一些则有5KB或更大。其中一些CWEB程序内容相当多,如我今年1月完成的有55页的BDD包。)所以,你可以看到,文学编程(literate programming)在我生活中有多么重要。
I currently use Ubuntu Linux, on a standalone laptop—it has no Internet connection. I occasionally carry flash memory drives between this machine and the Macs that I use for network surfing and graphics; but I trust my family jewels only to Linux. Incidentally, with Linux I much prefer the keyboard focus that I can get with classic FVWM to the GNOME and KDE environments that other people seem to like better. To each their own.
目前,我在一台没有联网的笔记本上使用Ubuntu Linux。我时常会用闪存在这台机和我用来上网和作图的Mac机交换数据,但重要的数据我只相信Linux。相对于其他人更喜欢的GNOME和KDE桌面环境,我更喜欢以键盘快捷键为中心的古典的FVWM。人各有所好(To each their own)。