特别节目·中文精读

吉多·范罗苏姆:Python

Guido van Rossum: Python

Python 之父讲述语言的设计取舍、社区治理的演变,以及编程语言的品味。

官方音频00:00 / --:--
中文精读由 AI 基于原始访谈改写,非官方翻译,可能存在偏差或错误;表述以原音频与官方文稿为准。说明

2018年7月的一个周四早上,7点钟。吉多·范罗苏姆(Guido van Rossum)醒来,脑子里冒出一句话:昨晚那场 PEP 572 的争论,是我最后一次让自己为这类事情紧张成这样。于是他打开电脑,用15到20分钟写完一封邮件,宣布辞去 Python 社区"终身仁慈独裁者"(BDFL,Benevolent Dictator For Life)的职位。

邮件发出去5分钟,他在 Twitter 上看到人们已经在讨论:吉多辞去 BDFL 了。他本以为那封邮件只发在核心开发者才读的内部论坛上,至少能给自己留一天缓冲时间。

邮件里有一句话后来被反复引用:你们将自谋出路。他没有指定继承人,没有说要建立民主制、无政府状态、独裁还是联邦,把这个开放性问题整个扔回给社区。

这场对话发生在辞职三个月后。Lex 问他,Python 生涯里最艰难的决定是哪一个。是 Python 3 不向后兼容吗?

最艰难的决定大概是辞职。(吉多·范罗苏姆)

从电子积木到生命游戏

1956年,吉多出生在荷兰。父母那一代人被二战深深地刻过一遍。Lex 开场就问了个大问题:人性本善还是本恶?

吉多的回答很朴素:我们每个人身上都有善和恶的潜能,很大程度上取决于环境和情境。

他青少年时期最喜欢的荷兰作家是威廉·弗雷德里克·赫尔曼斯(Willem Frederik Hermans)。这位作家的早期小说写的全是二战期间那些说不清的事:抵抗组织和德国间谍之间的界限,你永远搞不清某个人是真的抵抗者还是告密者,有些角色跨过了那条线,读者到最后也不知道究竟发生了什么。主角往往是反英雄,常常在某个层面上没能实现自己的宏大目标。

然后是童年爱好:搭电子电路,拼机械模型。

他讲得很老实。头几年纯粹是照说明书组装,他对电子学的理解浅到可笑,连线圈和电容是干什么的都不知道。这个无知后来惹了麻烦。做复杂一点的数字电路时,电路图看起来完美无缺,就是不工作。他没想到两根线靠得太近、或者开关做工太糙,会产生兆赫级的振荡,把整个电路搞乱。

他能调试,能极其仔细地照说明书操作,这个习惯保持了一辈子。但他脑子里那套"晶体管怎么工作"的模型是错的。

这段经历后来有回声。他自己承认:

我一直非常专注于编程这项活动本身,而不是你写出来的程序拿去干什么。(吉多·范罗苏姆)

所以他从没把计算机看成"能创造人工生命的弗兰肯斯坦",也没把它看成写作工具或者游戏机。他最后造出一门给程序员用的工具语言,回头看不算巧合。

18岁那年,他去东欧参加数学奥林匹克,是荷兰队成员。队里另一个极客小孩跟他讲了一种叫"计算机"的玩意儿。他之前从没听过这个词。

更早的时候,父母用打孔卡付杂志订阅费,他完全不知道背后有台计算机在读取这些卡片、在账户之间转账。他不感兴趣。

直到上大学读数学,才发现学校有一台计算机,学生可以用。用法是:把程序打在打孔卡上,交给操作员,一小时后取回打印结果。那台机器不连接真实世界,你能做的只有写点抽象的东西。

大二或者大三,有人给他看了一篇两页的影印文章。《科学美国人》上的一个专栏,作者每月写一篇数学趣题,那一期讲的是康威的生命游戏(Conway's Game of Life)。文章列出了全部规则,还暗示这件事在哲学上很有意思,这也正是康威给它起这个名字的原因。

他用 Pascal 写了个实现。值得说的是他怎么写的。

他先在纸上设计了一个由逻辑门构成的电路,九个比特输入,也就是一个细胞加上它周围八个邻居,输出这个细胞下一代的值。那是个全加器加上一些截断逻辑。然后他把这个电路翻译成 Pascal 整数上的一系列布尔运算,把整数当位串用。这样大约八条指令就能算出一代里的60个比特。

他得意的那个点很有意思:整段回忆的重点落在"我把它优化得很好"上,对图形本身的美一个字没提。

原因很实际。学生机时预算极小,而且是计量的。他曾经因为超支被教授找麻烦。他想跑更大的棋盘、更多的代。实现必须快,他才有余力去喂不同的图案进去,看看会跑出什么,比如滑翔机,那个几代之后整体平移一两格的经典图案,还有滑翔机枪。

滑翔机枪这种图案是他跑出来的。规则是他写的,输出不在他预期之内。

这就碰到了生命游戏真正的谜题:底层规则简单到可以手算,跑出来的东西却没人能用数学描述。

Lex 提到斯蒂芬·沃尔夫勒姆(Stephen Wolfram)为这事着迷,因为数学工具不够用,你唯一能做的就是跑一遍看结果。吉多的回应比较克制,他不认为这类问题适合经典数学分析。

这里岔出了一条很有意思的思路。如果我们想造出真正的智能,是不是也得造一个宇宙然后让它跑起来?手工用 Python 一行行码出一个完整智能体,可能根本没戏。需要的可能是先找到一套规则,让它在演进过程中不会迅速退化成无意义的重复。

沃尔夫勒姆的经验是:你发现能产生有趣现象的规则,快得令人意外。理论上不该这么容易,但事实就是这样。所以也许我们这个宇宙装载的规则本身就容易长出有趣的东西,而长出有趣东西的难度,比我们以为的低。

年轻的吉多对"计算机会思考"这件事基本无感。他那时几乎不读科幻,顶多读过一本科幻小说集。真正让他开眼的是二十出头读的《哥德尔、埃舍尔、巴赫》(Gödel, Escher, Bach),一本讲意识的书。

他说得很直接:

我完全相信大脑在某种意义上就是计算机。我不相信有什么额外的东西给我们注入智能或意识。没有灵魂这种东西。我大概十岁就是无神论者了,就是稍微想了想数学和宇宙。(吉多·范罗苏姆)

但同一段话里他又说,他十几岁的时候,知道那台计算机有多少位内存、知道给它编程有多难,他完全不信能从这么个东西里造出满足他定义的那种智能。

这两种说法并不矛盾。他知道大脑是计算机,也知道当时的计算机差得太远,远到他看不出这段距离怎么填。

编程语言是攒出来的,不是想出来的

Lex 问了一个假设:如果给你三个月,从零设计一门语言,你怎么把"Python 好用的那些特质"变成语法规则和语言特性?

吉多的回答把这个问题直接推翻了。

他说 Python 一开始他就给自己定了规矩:我可不想什么都从零设计,我要从别的语言里借我喜欢的东西。

所以设计的第一步是观察:我自己喜欢什么。

这也是为什么17岁造不出一门好语言。你还没有足够多的语言使用经验,根本不知道自己讨厌什么、舍不得什么。

他造 Python 的时候三十五六岁。他写过解析器,参与过 ABC 语言的实现,跟 ABC 的设计者争论了好几年设计问题,虽然 ABC 的最终设计他一点没参与,他加入团队时语言已经设计完并实现了。

然后他开始借。缩进和一部分语法特征来自 ABC,字符串字面量和数字的工作方式来自 C,还有各种零零碎碎的局部规则从各处拿来。Python 的好东西大部分是借的。

这个回答解释了 Python 的长相。它来自一个有品味、有经验的中年工程师做的大规模策展,跟天才式的设计推演没什么关系。

Python 3:那些绕不过去的老坑

从"终身仁慈独裁者"这个称呼说起,Lex 问了 Python 3 的决策过程。不向后兼容,这个决定怎么做的?

吉多说那其实是群体过程。当时他名义上是 BDFL,所有人都尊重他作为创造者和语言设计拥有者的位置,但他在看所有人的反馈。

Python 3.0 的起点是社区里的人反复指出:有几个问题一遍又一遍地咬到用户,能不能动一动?

那些问题当时被叫"Python 疣"(Python warts)。团队过去的做法一直是死守向后兼容,所以很多疣在早年的版本里已经解决了,办法是兼容地解决,或者用非常渐进的演化路径绕过去。剩下这些,是公认的问题,谈不上路障,但总有人在这里绊倒,而且每次绊倒都是同一个地方。

团队想不出向后兼容的解法。

但也一直有个选项摆在那里:不解决。很长一段时间,他们就是这么自我安慰的:好吧,这门语言在这个地方、那个地方就是不完美。有些细节在 Java 里更好,在 R 里更好,在 Visual Basic 里更好,我们认了,反正改不动。也没那么糟,可以做点用户教育,可以加静态分析器,可以让解析器报个警告。

但有一部分疣,他们的判断是:这些问题不会消失,而且未来会越来越糟,得动手。

于是有了 Python 3。

2018年7月那个周四

PEP 572 是赋值表达式,也就是那个 `:=` 海象运算符。一个小特性。

争论大得离谱。很多人声称自己知道什么是 Pythonic 什么不是,声称这会毁掉这门语言,是对 Python 最根本设计哲学的侵犯。

吉多的原话是:我觉得这全是扯淡,因为我支持它,而关于 Python 的设计哲学,我大概还是知道一点的。

他为此累了很久,也紧张了很久。那个周三晚上他终于发出邮件:接受了,我可以去实现了。然后上床睡觉,感觉很解脱,这事过去了。

周四早上7点醒来,他想的是:这是最后一次让我为 PEP 决策紧张成这样的争论了,我应该辞职。

他想了退休这件事已经有五年,一直在开玩笑、在暗示,告诉社区未来某天我会退休,别把称呼里"终身"那部分太当真。这次他想,就是现在了。

那天他休假,本来打算和妻子去附近一个小海滨镇子好好过一天。他花了15到20分钟写完那封辞职信。

他说自己当时甚至没意识到那是个多么重大的决定。

Lex 说那封信读起来几乎有莎士比亚的味道。不指定继承人,把"你们将自谋出路"这种不确定性直接交出去,这个开放式的姿态把创造未来的责任还给了社区。

吉多的判断是:他敢这么干,是因为他知道 Python 处在很好的位置。

核心开发者是50到100人的群体,写或者审了绝大部分进入 Python 的代码。这些人大部分时候相处得很好,专业领域分布广,经验层次从 Python 核心到嵌入式系统都有。他放心,因为这群人能照顾好自己。

辞职信发出后,社区开始起草宪法。到这次对话时,已经有五六个互相竞争的提案。

他对此非常自信。辩论整体上健康且有产出。

关于程序员之间的战争

Lex 提了个观察。他弹吉他,随便弹点什么,周围人都是"太棒了""真好听"。但他以旁观者身份进编程社区,发现但凡一个话题,往往会分成阵营,阵营之间互相批评起来相当狠。

他问得挺小心:作为旁观者我可能完全错了,但你怎么看这件事?

吉多先承认了这个现象:圣战是编程社区最喜欢的活动之一。

然后他给了个平衡的看法。如果所有人互相拍肩膀、从不说真话,那不是好事。但确实存在一个中间地带:对人刻薄不行,但持续健康的批评和反馈非常有用。

这个中间地带在每一层都能看到。有人提了个改动很小的修复,很可能有 reviewer 回一句:其实换个做法更好。

Python 不打算变成高并发语言

Lex 把所有热门话题打包扔过来:并发、并行计算、async IO、GIL、打包工具、函数式编程。请吉多挑着说。

吉多把 GIL、并行、async IO 合成一个话题回答,结论明确:

我对 Python 发展成一门高并发、高并行的语言不太抱希望。语言的设计方式、大多数用户的用法、语言的实现方式,都让这个未来相当不可能。(吉多·范罗苏姆)

但他把 async IO 单拎出来了。async IO 是个特例,它只做一件事:让 IO 重叠起来,仅限 IO。这恰好是支撑高吞吐 IO、每秒大量连接的最佳实践。这块他不担心,async IO 会继续演进,有几个互相竞争的包,有些非常聪明的人在推着他们改进。

并行计算他说得更干脆:Python 不是干这个的语言。

有绕过去的办法,但你不能指望写一段 Python 算法,编译器自动把它并行化。你能做的是用 NumPy 这类包,告诉它数据在哪、要对数据做什么抽象操作,它把能用的 CPU 全用上,然后你其实已经回到 C++ 的世界了。这些包本身通常就是 C++ 写的。TensorFlow 这些也一样,跨 GPU 的并行它们替你处理。

打包是另一个故事。吉多第一句话就是:打包一直是我最不喜欢的话题。

他说这问题真的难,因为操作系统和平台想拥有打包权,但它们的打包方案不针对任何特定语言。Linux 就有两套互相竞争的方案,全都跨语言工作。而 Node、Ruby、Python 各自有只在自家生态内工作的方案。

他自己怎么办?用系统包管理器装 Python,用 Python 的包管理器装第三方 Python 包。大多数人也是这么干的。

他给了个时间线:十年前的 Python 打包是灾难,现在 pip 就是未来。数值计算和科学计算另有一个基于 Anaconda 的生态,两者能共存。他看不出有再多搞几套的必要。

他养大了这个孩子

Lex 看过那部五个半小时的口述史,说它因为线性叙事,给人一种"一生过得很充实"的感觉。他问:除了家庭,回头看这段旅程,你真正骄傲的是什么?

吉多的回答值得抄下来:

Python 肯定是我做过的最好的事。但我不会只说创造 Python,而是我养育 Python 的方式,像养一个孩子。我不只是怀了一个孩子,我把他养大了,现在我要把他放进世界,我已经让他能够照顾自己。我为此非常骄傲。(吉多·范罗苏姆)

然后是蒙提·派森。Lex 说你可以随时给我放"死鹦鹉"那一段。吉多说那也是他最喜欢的。

"它已经蹬腿了。""不,它只是在休息。""它已经寿终正寝、魂归西天了。"这就是那场对话。

意识是一条光谱

话题转向意识。吉多强调,这跟他的日常工作完全是两条线。他写编程语言,不涉及任何朝智能或意识方向走的东西。但作为科普读物的 avid 读者,他有些想法。

他的核心判断是:把意识当成开关来看,方向就错了。猫、狗、老鼠有某种形式的智能,鱼也有某种形式的智能。演化花了很多时间。他认为,越来越多智能的演化,特别是通向人类这种智能的路径,是跟着感官的演化走的,尤其是视觉。

解释一个场景需要的计算量巨大,人类至今比计算机做得更好。他的猜想是:哺乳动物发展出它们那个层次的意识,从智能到自我意识到意识,跟"这台机器人有高度发达的感官"有关。大量丰富的感官信息涌进来,一层层堆上去,某种类似意识的东西就出现了。

然后是自动驾驶。这段是他自己主动延伸的,而且说得相当具体。

他说自己开车的时候不只是注意交通规则。他会看周围,从里面读线索:这片是商业区;有个老太太过马路;有人抱着一大堆邮件,前面有个邮筒,这人八成是要过街去投信。然后他就减速了,他完全没意识到自己在做这个判断。

把观察转成"另一个意识打算干什么""世界上另一个系统会怎么动"的理解,这个过程无处不在。比如判断那棵树要倒了。

所以他说:

如果有什么东西会变得有意识,我预期会是自动驾驶汽车,而不是 Google 或 Amazon 数据中心里那堆网络互联的、数以亿计的计算机。(吉多·范罗苏姆)

这个判断的标准很实用。意识在这里成了一个工程指标:一个系统为了跟人类互动而必须具备的东西。你得能共情,能恐惧,能理解什么是怕死,才能处理好跟行人的关系,才能基于人的欲望和想法做基本计算。

狗就是证据。狗明显知道周围的人要干什么,或者说至少有一个关于人类行为的模型,而且它会学。有些狗知道你要出门,它想跟着;你把它单独留下它会难过、会叫;小时候被虐待过的狗会害怕。我们不认为狗有多少意识,但也不认为它一点没有。

从笛卡尔到模式匹配

17世纪有一批人,莱布尼茨、霍布斯、笛卡尔,他们有种感觉:所有思考、所有推理,那些我们觉得大脑里最特殊的东西,都可以转换成逻辑。一旦形式化了全部知识,你就能计算。我们的大脑在做的,就是计算。

吉多的反驳切在很具体的地方:他们没有"模式匹配"这个概念。

他们以为自己发现了不起的数学工具,牛顿的微积分之类,于是顺着那条线推演逻辑能走多远。他们没意识到,认出人脸靠的是另一套机制:海量数据,加上一个能解读视觉线索和上下文的电路,对着存储的规则做大规模并行模式匹配。

他自己举了个生动的例子。如果明天在 Dropbox 办公室楼下见到 Lex,他能认出来,就算 Lex 换了件衬衫也能。但如果明天在贝尔蒙特某家咖啡馆、或者海滩上碰见,他可能完全认不出来。他经常犯这种错:只在"我妻子的同事"这个语境里认识的人,在电影院里撞见就认不出。

Lex 追问:你说模式匹配,你觉得规则无法编码这个?看看这个房间,我是黑衬衫、这个身高、是个人,你每一刻都在拾取上万条关于场景的事实,把它们聚合成对场景的理解。你不觉得这些全都能编码,最后摆到桌上计算吗?

吉多的回答分两层。

第一层:是的,这里没有魔法。第二层:但从眼睛耳朵进来的原始事实,到"我理解了这一幕",中间隔着的抽象层级太多,他不认为 AI 真的走完了这段距离。

他给了个类比。人体由原子构成,这是个毫无用处的还原论视角。人体由器官构成,器官由细胞构成,细胞由蛋白质构成,蛋白质由氨基酸构成,氨基酸由原子构成,再往下是量子力学。每层都对,但你不能拿量子力学去理解身体。

他还有一段关于编译器的推演,我觉得是这次对话里最有信息量的部分。

一个编译器解析程序,它的输入例程在某种意义上就是一个感觉器官。它构建起一个极其复杂的内部表示:不再是线性的字节序列,而是一棵抽象语法树。编译器用这棵树生成输出,比如翻译成能在硬件上跑的机器码,然后这棵树被扔掉。

鱼或者苍蝇接收到视觉信号,他相信它也在构建某种数据结构。苍蝇脑子里的抽象层级可能少到只有"这边比那边暗""有东西在动",所以你的手一挥它就跑了。但那已经是对运动的抽象。

我们脑子里有类似的东西,只是复杂得多。你要是没有对运动的极好的抽象,你根本没法开车。

再往上,人类在运动抽象之上建了更复杂的数据结构,其中一部分持久保存下来,变成记忆,可以调取。记电话号码是很"有意识"的记忆方式:十个数字,重复几遍,能复述出来。但"我怎么认出你的脸",他完全不知道。大脑里有一堆专用硬件会干这件事,他不知道自己脑子里这套东西有多少写在 DNA 里,有多少是零到三岁之间反复训练出来的。

所以日常生活里,我们运行在抽象的最高层,完全不感知底下那些细节。编译器叠着编译器,一路往下。

软件 2.0 不该叫编程

Lex 提到 Andrej Karpathy 的说法"软件 2.0":神经网络用一堆输入输出的例子学出映射,你看不见里面,也没法分析,只能训练。他问吉多:这种模糊的、引号里的"编程",应该叫编程吗?

吉多的回答很干脆:我不会把那叫编程。那是另一种活动。

就像用细胞搭器官不叫化学。

他给了个观察:AI 史上处理过的每一个任务,一旦我们搞清楚了它是怎么做到的,它就不再被算作人工智能了。那时你不需要这个词了,那就是"哦,现在我们知道怎么做了",然后一个新的科学或工程领域长出来。

他承认自己可能太执着于术语。但他预期,未来就是会有不同的概念,由受教育背景不同、对"我在干什么"的模型不同的人去发展。

他对"算法"这个词有一处抱怨,挺有意思。他说每次在报纸上读到关于 Facebook 的软文,说"算法"如何如何,他就来气,因为那是同一个词完全不同的用法。他八岁十岁学到的是:算法是一套你完全理解的规则,可以被数学分析,可以被证明。你可以证明埃拉托斯特尼筛法只产生素数,且产生所有素数。

而今天那些系统,你只能说在所有测试过的东西上它99.9%的情况下有效,但你没法保证,它会以意想不到的方式失败,你甚至连它怎么失败的例子都举不出来。

但这里有个转折,是吉多自己提出来的:软件 1.0 其实也早就到这一步了。

无 bug 程序的理想,大部分软件开发者早就放弃了。我们只在 bug 频繁到烦人的时候才管它。我们接受偶尔的崩溃、宕机、错误结果,因为不可能有那么多程序员把代码写到无 bug,那活儿太枯燥,你要是上形式化方法,那就更枯燥。

用户点了个链接报错,普通人不会慌,再点一次,通常就好了,或者换个路子完成任务。这是一种端到端的恢复机制。系统内部全是重试、超时、降级。他猜生物系统里这类机制更多,否则活不下来。

规模改变了一切

说到编程教育,吉多的观察很准。

基础编程课上学生写的程序太小太简单,只要有 bug 你总能找出来修掉。中学的信息课是这样,大学的编程入门课也大多是"小规模编程"。很少有课程真的教软件工程,真的教你搭大型系统。

Dropbox 每年夏天招大量实习生,西海岸每家科技公司都这么干。这些实习生总是被震到,因为这是他们有生以来第一次看见一个真正的大型软件开发环境长什么样。大学里学的一切几乎都是小得多的尺度,而那个尺度差异会造成质的差别,改变你做事的方式和思考的方式。

Lex 追问:70年代80年代你刚开始想 Python 的时候,有没有想过会出现 Google、Facebook、Dropbox 底下那么大的系统?

吉多:计算技术的几乎每一个阶段都让我措手不及。

再往前追,他讲了自己想解决什么问题。他很高兴自己当时不知道社区里所有的"痒处":

如果你试图一次解决所有问题,你什么都解决不了。(吉多·范罗苏姆)

他的问题极其聚焦:要一门卡在 shell 脚本和 C 之间的语言。一个在那个特定环境里能让他作为程序员更高效的工具。他还给自己定了时间预算,大约三个月,包含设计(想清楚语法和语义上所有特性)和实现(从解析源码到执行的整条流水线)。

所以他不知道自己缺什么,反而救了他。

为什么从 C++ 换到 Python 会觉得快

Lex 讲了自己的经历。90年代到21世纪头十年,他做机器学习和 AI 研究一直用 C++。做机械、电气的同事用 MATLAB,还有些人偏好 Java 那种强调面向对象的路子。最近十年,神经网络那些包都建在 Python 上,他切过去了,明显感觉到效率提升,但说不清为什么。

吉多说:你大概确实更快了。

然后 Lex 自己把原因说出来了,我觉得这段比任何抽象论证都好使。

他说他在 C++ 里太享受写出高性能代码、构建漂亮结构这件事了,尤其是新标准里那些模板编程,搭一个形式上极其优雅的结构。结果他发现自己大部分时间都花在搭那个结构上,而不是完成任务本身,比如解析一个文件、抽几个关键词。

这就是 Python 那三个月设计预算的回报。它砍掉的东西,恰好是让人沉迷、让人忘记自己在干什么的东西。

回过头看吉多那三个月:借缩进、借字符串字面量、借数字语义,不发明新范式,不追求理论上完备,把"从想法到能跑起来"的路径压到最短。他在电子爱好时期用面包板,线路一碰就散架,但能工作,他要的就是先看见它工作,然后去做下一张图。等设计定了,再考虑做 PCB、考虑焊接、考虑电压波动和机械振动。后面那些他不懂,但写代码的那部分他懂得很透。

面包板和 Python 是同一件事。

被爱者与独裁者

这场对话录于2018年11月,吉多辞职四个月后。回头看,他留下的那句话分量很足:你们将自谋出路。

一个创造了全世界最流行语言之一的人,在最后关头没有安排接班人,没有设计治理结构,甚至没给自己留缓冲时间。他做的是把权力交出去,然后相信那群他亲手挑进来、一起工作了二三十年的人。

而他自己给这段生涯的定性,落点在"我把它养大了,现在它能照顾自己",至于"我发明了一门语言"这种说法,从来不是他叙述的重心。

这两句话放在一起,是一种很少见的创造者姿态。多数强人卡在"我走了它会散",他的判断是"我走了它会自己长出宪法,而且会有五六份竞争方案,这很健康"。

如果你只记三条

  • 别从零设计,先攒品味。吉多造 Python 时三十五六岁,写过解析器、参与过 ABC 实现、跟设计者吵了几年架。他做的第一件事是列出自己喜欢的特性,然后从各语言里借。17岁造不出好语言,跟聪明程度无关,问题在用过的语言还不够多,不知道自己讨厌什么。
  • 砍
  • 砍掉让你沉迷的部分。Lex 从 C++ 换到 Python 之后效率明显提升,原因跟语法长短没什么关系。C++ 让他把时间花在构建优雅的模板结构上,完成任务本身反而被挤到了后面。评估一门工具时问一句:它让我的时间有多少花在"手艺表演"上,多少花在把事情做完上?
  • 先分清是哪一类问题,再决定用什么标准验收。软件 1.0 追求可证明的正确性,这个理想早就被大多数团队放弃了;软件 2.0 只能追求统计意义上的可靠,99.9% 有效,但说不清失败边界在哪。把神经网络的产出当成"算法"来验收,等于把两套完全不同的工程契约混成一谈。做技术决策之前先问一句:这个模块我能给出保证,还是只能给出概率?答案不同,测试策略、发布节奏、责任划分全都不一样。
文稿来自公开 Kaggle 数据集(rajneesh231/lex-fridman-podcast-transcript),为早期自动转录存档,可能存在识别错误。
The following is a conversation with Guido van Rossum, creator of Python, one of the most popular programming languages in the world, used in almost any application that involves computers from web back end development to psychology, neuroscience, computer vision, robotics, deep learning, natural language processing, and almost any subfield of AI. This conversation is part of MIT course on artificial general intelligence and the artificial intelligence podcast. If you enjoy it, subscribe on YouTube, iTunes, or your podcast provider of choice, or simply connect with me on Twitter at Lex Friedman, spelled F R I D. And now, here's my conversation with Guido van Rossum. You were born in the Netherlands in 1956. Your parents and the world around you was deeply deeply impacted by World War Two, as was my family from the Soviet Union. So with that context, what is your view of human nature? Are some humans inherently good, and some inherently evil? Or do we all have both good and evil within us? Guido van Rossum Ouch, I did not expect such a deep one. I, I guess we all have good and evil potential in us. And a lot of it depends on circumstances and context. Peter Bell out of that world, at least on the Soviet Union side in Europe, sort of out of suffering, out of challenge, out of that kind of set of traumatic events, often emerges beautiful art, music, literature. In an interview I read or heard, you said you enjoyed Dutch literature when you were a child. Can you tell me about the books that had an influence on you in your childhood? Guido van Rossum Well, with as a teenager, my favorite writer was my favorite Dutch author was a guy named Willem Frederik Hermans, who's writing, certainly his early novels were all about sort of ambiguous things that happened during World War Two. I think he was a young adult during that time. And he wrote about it a lot, and very interesting, very good books, I thought, I think. Peter Bell In a nonfiction way? Guido van Rossum No, it was all fiction, but it was very much set in the ambiguous world of resistance against the Germans, where often you couldn't tell whether someone was truly in the resistance or really a spy for the Germans. And some of the characters in his novels sort of crossed that line, and you never really find out what exactly happened. Peter Bell And in his novels, there's always a good guy and a bad guy, the nature of good and evil. Is it clear there's a hero? Guido van Rossum No, his heroes are often more, his main characters are often anti heroes. And so they're not very heroic. They're often, they fail at some level to accomplish their lofty goals. Peter Bell And looking at the trajectory through the rest of your life, has literature, Dutch or English or translation had an impact outside the technical world that you existed in? Guido van Rossum I still read novels. I don't think that it impacts me that much directly. Peter Bell It doesn't impact your work. Guido van Rossum It's a separate world. My work is highly technical and sort of the world of art and literature doesn't really directly have any bearing on it. Peter Bell You don't think there's a creative element to the design? You know, some would say design of a language is art. Guido van Rossum I'm not disagreeing with that. I'm just saying that sort of I don't feel direct influences from more traditional art on my own creativity. Peter Bell Right. Of course, you don't feel doesn't mean it's not somehow deeply there in your subconscious. Guido van Rossum Who knows? Peter Bell Who knows? So let's go back to your early teens. Your hobbies were building electronic circuits, building mechanical models. What if you can just put yourself back in the mind of that young Guido 12, 13, 14, was that grounded in a desire to create a system? So to create something? Or was it more just tinkering? Just the joy of puzzle solving? Guido van Rossum I think it was more the latter, actually. I maybe towards the end of my high school period, I felt confident enough that that I designed my own circuits that were sort of interesting somewhat. But a lot of that time, I literally just took a model kit and follow the instructions, putting the things together. I mean, I think the first few years that I built electronics kits, I really did not have enough understanding of sort of electronics to really understand what I was doing. I mean, I could debug it, and I could sort of follow the instructions very carefully, which has always stayed with me. But I had a very naive model of, like, how do I build a circuit? Of, like, how a transistor works? And I don't think that in those days, I had any understanding of coils and capacitors, which actually sort of was a major problem when I started to build more complex digital circuits, because I was unaware of the sort of the analog part of the – how they actually work. And I would have things that – the schematic looked – everything looked fine, and it didn't work. And what I didn't realize was that there was some megahertz level oscillation that was throwing the circuit off, because I had a sort of – two wires were too close, or the switches were kind of poorly built. But through that time, I think it's really interesting and instructive to think about, because echoes of it are in this time now. So in the 1970s, the personal computer was being born. So did you sense, in tinkering with these circuits, did you sense the encroaching revolution in personal computing? So if at that point, we would sit you down and ask you to predict the 80s and the 90s, do you think you would be able to do so successfully to unroll the process that's happening? No, I had no clue. I remember, I think, in the summer after my senior year – or maybe it was the summer after my junior year – well, at some point, I think, when I was 18, I went on a trip to the Math Olympiad in Eastern Europe, and there was like – I was part of the Dutch team, and there were other nerdy kids that sort of had different experiences, and one of them told me about this amazing thing called a computer. And I had never heard that word. My own explorations in electronics were sort of about very simple digital circuits, and I had sort of – I had the idea that I somewhat understood how a digital calculator worked. And so there is maybe some echoes of computers there, but I never made that connection. I didn't know that when my parents were paying for magazine subscriptions using punched cards, that there was something called a computer that was involved that read those cards and transferred the money between accounts. I was also not really interested in those things. It was only when I went to university to study math that I found out that they had a computer, and students were allowed to use it. And there were some – you're supposed to talk to that computer by programming it. What did that feel like, finding – Yeah, that was the only thing you could do with it. The computer wasn't really connected to the real world. The only thing you could do was sort of – you typed your program on a bunch of punched cards. You gave the punched cards to the operator, and an hour later the operator gave you back your printout. And so all you could do was write a program that did something very abstract. And I don't even remember what my first forays into programming were, but they were sort of doing simple math exercises and just to learn how a programming language worked. Did you sense, okay, first year of college, you see this computer, you're able to have a program and it generates some output. Did you start seeing the possibility of this, or was it a continuation of the tinkering with circuits? Did you start to imagine that one, the personal computer, but did you see it as something that is a tool, like a word processing tool, maybe for gaming or something? Or did you start to imagine that it could be going to the world of robotics, like the Frankenstein picture that you could create an artificial being? There's like another entity in front of you. You did not see the computer. I don't think I really saw it that way. I was really more interested in the tinkering. It's maybe not a sort of a complete coincidence that I ended up sort of creating a programming language which is a tool for other programmers. I've always been very focused on the sort of activity of programming itself and not so much what happens with the program you write. Right. I do remember, and I don't remember, maybe in my second or third year, probably my second actually, someone pointed out to me that there was this thing called Conway's Game of Life. You're probably familiar with it. I think – In the 70s, I think is when they came up with it. So there was a Scientific American column by someone who did a monthly column about mathematical diversions. I'm also blanking out on the guy's name. It was very famous at the time and I think up to the 90s or so. And one of his columns was about Conway's Game of Life and he had some illustrations and he wrote down all the rules and sort of there was the suggestion that this was philosophically interesting, that that was why Conway had called it that. And all I had was like the two pages photocopy of that article. I don't even remember where I got it. But it spoke to me and I remember implementing a version of that game for the batch computer we were using where I had a whole Pascal program that sort of read an initial situation from input and read some numbers that said do so many generations and print every so many generations and then out would come pages and pages of sort of things. I remember much later I've done a similar thing using Python but that original version I wrote at the time I found interesting because I combined it with some trick I had learned during my electronics hobbyist times. I essentially first on paper I designed a simple circuit built out of logic gates that took nine bits of input which is sort of the cell and its neighbors and produced a new value for that cell and it's like a combination of a half adder and some other clipping. It's actually a full adder. And so I had worked that out and then I translated that into a series of Boolean operations on Pascal integers where you could use the integers as bitwise values. And so I could basically generate 60 bits of a generation in like eight instructions or so. Nice. So I was proud of that. It's funny that you mentioned, so for people who don't know Conway's Game of Life, it's a cellular automata where there's single compute units that kind of look at their neighbors and figure out what they look like in the next generation based on the state of their neighbors and this is deeply distributed system in concept at least. And then there's simple rules that all of them follow and somehow out of this simple rule when you step back and look at what occurs, it's beautiful. There's an emergent complexity. Even though the underlying rules are simple, there's an emergent complexity. Now the funny thing is you've implemented this and the thing you're commenting on is you're proud of a hack you did to make it run efficiently. When you're not commenting on, it's a beautiful implementation, you're not commenting on the fact that there's an emergent complexity that you've coded a simple program and when you step back and you print out the following generation after generation, that's stuff that you may have not predicted would happen is happening. And is that magic? I mean, that's the magic that all of us feel when we program. When you create a program and then you run it and whether it's Hello World or it shows something on screen, if there's a graphical component, are you seeing the magic in the mechanism of creating that? I think I went back and forth. As a student, we had an incredibly small budget of computer time that we could use. It was actually measured. I once got in trouble with one of my professors because I had overspent the department's budget. It's a different story. I actually wanted the efficient implementation because I also wanted to explore what would happen with a larger number of generations and a larger size of the board. Once the implementation was flawless, I would feed it different patterns and then I think maybe there was a follow up article where there were patterns that were like gliders, patterns that repeated themselves after a number of generations but translated one or two positions to the right or up or something like that. I remember things like glider guns. Well, you can Google Conway's Game of Life. People still go aww and ooh over it. For a reason because it's not really well understood why. I mean, this is what Stephen Wolfram is obsessed about. We don't have the mathematical tools to describe the kind of complexity that emerges in these kinds of systems. The only way you can do is to run it. I'm not convinced that it's sort of a problem that lends itself to classic mathematical analysis. One theory of how you create an artificial intelligence or artificial being is you kind of have to, same with the Game of Life, you kind of have to create a universe and let it run. That creating it from scratch in a design way, coding up a Python program that creates a fully intelligent system may be quite challenging. You might need to create a universe just like the Game of Life. You might have to experiment with a lot of different universes before there is a set of rules that doesn't essentially always just end up repeating itself in a trivial way. Yeah, and Stephen Wolfram works with these simple rules, says that it's kind of surprising how quickly you find rules that create interesting things. You shouldn't be able to, but somehow you do. And so maybe our universe is laden with rules that will create interesting things that might not look like humans, but emergent phenomena that's interesting may not be as difficult to create as we think. Sure. But let me sort of ask, at that time, some of the world, at least in popular press, was kind of captivated, perhaps at least in America, by the idea of artificial intelligence, that these computers would be able to think pretty soon. And did that touch you at all? In science fiction or in reality in any way? I didn't really start reading science fiction until much, much later. I think as a teenager I read maybe one bundle of science fiction stories. Was it in the background somewhere, like in your thoughts? That sort of the using computers to build something intelligent always felt to me, because And how did you try to design it into the language? There are different tasks and as a programmer, it's useful to have different tools available that sort of are suitable for different tasks. So I still write C code, I still write shell code, but I write most of my things in Python. Why do I still use those other languages, because sometimes the task just demands it. And well, I would say most of the time the task actually demands a certain language because the task is not write a program that solves problem X from scratch, but it's more like fix a bug in existing program X or add a small feature to an existing large program. But even if you're not constrained in your choice of language by context like that, there is still the fact that if you write it in a certain language, then you have this balance between how long does it take you to write the code and how long does the code run? And when you're in the phase of exploring solutions, you often spend much more time writing the code than running it because every time you've run it, you see that the output is not quite what you wanted and you spend some more time coding. And a language like Python just makes that iteration much faster because there are fewer details that you have to get right before your program compiles and runs. There are libraries that do all sorts of stuff for you, so you can sort of very quickly take a bunch of existing components, put them together, and get your prototype application running. Just like when I was building electronics, I was using a breadboard most of the time, so I had this sprawl out circuit that if you shook it, it would stop working because it was not put together very well, but it functioned and all I wanted was to see that it worked and then move on to the next schematic or design or add something to it. Once you've sort of figured out, oh, this is the perfect design for my radio or light sensor or whatever, then you can say, okay, how do we design a PCB for this? How do we solder the components in a small space? How do we make it so that it is robust against, say, voltage fluctuations or mechanical disruption? I know nothing about that when it comes to designing electronics, but I know a lot about that when it comes to writing code. So the initial steps are efficient, fast, and there's not much stuff that gets in the way, but you're kind of describing, like Darwin described the evolution of species, right? You're observing of what is true about Python. Now if you take a step back, if the act of creating languages is art and you had three months to do it, initial steps, so you just specified a bunch of goals, sort of things that you observe about Python, perhaps you had those goals, but how do you create the rules, the syntactic structure, the features that result in those? So I have in the beginning and I have follow up questions about through the evolution of Python too, but in the very beginning when you were sitting there creating the lexical analyzer or whatever. Python was still a big part of it because I sort of, I said to myself, I don't want to have to design everything from scratch, I'm going to borrow features from other languages that I like. Oh, interesting. So you basically, exactly, you first observe what you like. Yeah, and so that's why if you're 17 years old and you want to sort of create a programming language, you're not going to be very successful at it because you have no experience with other languages, whereas I was in my, let's say mid 30s, I had written parsers before, so I had worked on the implementation of ABC, I had spent years debating the design of ABC with its authors, with its designers, I had nothing to do with the design, it was designed fully as it ended up being implemented when I joined the team. But so you borrow ideas and concepts and very concrete sort of local rules from different languages like the indentation and certain other syntactic features from ABC, but I chose to borrow string literals and how numbers work from C and various other things. So in then, if you take that further, so yet you've had this funny sounding, but I think surprisingly accurate and at least practical title of benevolent dictator for life for quite, you know, for the last three decades or whatever, or no, not the actual title, but functionally speaking. So you had to make decisions, design decisions. Can you maybe, let's take Python 2, so releasing Python 3 as an example. It's not backward compatible to Python 2 in ways that a lot of people know. So what was that deliberation, discussion, decision like? Yeah. What was the psychology of that experience? Do you regret any aspects of how that experience undergone that? Well, yeah, so it was a group process really. At that point, even though I was BDFL in name and certainly everybody sort of respected my position as the creator and the current sort of owner of the language design, I was looking at everyone else for feedback. Sort of Python 3.0 in some sense was sparked by other people in the community pointing out, oh, well, there are a few issues that sort of bite users over and over. Can we do something about that? And for Python 3, we took a number of those Python words as they were called at the time and we said, can we try to sort of make small changes to the language that address those words? And we had sort of in the past, we had always taken backwards compatibility very seriously. And so many Python words in earlier versions had already been resolved because they could be resolved while maintaining backwards compatibility or sort of using a very gradual path of evolution of the language in a certain area. And so we were stuck with a number of words that were widely recognized as problems, not like roadblocks, but nevertheless sort of things that some people trip over and you know that that's always the same thing that people trip over when they trip. And we could not think of a backwards compatible way of resolving those issues. But it's still an option to not resolve the issues, right? And so yes, for a long time, we had sort of resigned ourselves to, well, okay, the language is not going to be perfect in this way and that way and that way. And we sort of, certain of these, I mean, there are still plenty of things where you can say, well, that particular detail is better in Java or in R or in Visual Basic or whatever. And we're okay with that because, well, we can't easily change it. It's not too bad. We can do a little bit with user education or we can have a static analyzer or warnings in the parse or something. But there were things where we thought, well, these are really problems that are not going away. They are getting worse in the future. We should do something about that. But ultimately there is a decision to be made, right? So was that the toughest decision in the history of Python you had to make as the benevolent dictator for life? Or if not, what are there, maybe even on the smaller scale, what was the decision where you were really torn up about? Well, the toughest decision was probably to resign. All right, let's go there. Hold on a second then. Let me just, because in the interest of time too, because I have a few cool questions for you and let's touch a really important one because it was quite dramatic and beautiful in certain kinds of ways. In July this year, three months ago, you wrote, now that PEP 572 is done, I don't ever want to have to fight so hard for a PEP and find that so many people despise my decisions. I would like to remove myself entirely from the decision process. I'll still be there for a while as an ordinary core developer and I'll still be available to mentor people, possibly more available. But I'm basically giving myself a permanent vacation from being BDFL, benevolent dictator for life. And you all will be on your own. First of all, it's almost Shakespearean. I'm not going to appoint a successor. So what are you all going to do? Create a democracy, anarchy, a dictatorship, a federation? So that was a very dramatic and beautiful set of statements. It's almost, it's open ended nature called the community to create a future for Python. It's just kind of a beautiful aspect to it. So what, and dramatic, you know, what was making that decision like? What was on your heart, on your mind, stepping back now a few months later? I'm glad you liked the writing because it was actually written pretty quickly. It was literally something like after months and months of going around in circles, I had finally approved PEP572, which I had a big hand in its design, although I didn't initiate it originally. I sort of gave it a bunch of nudges in a direction that would be better for the language. So sorry, just to ask, is async IO, that's the one or no? PEP572 was actually a small feature, which is assignment expressions. That had been, there was just a lot of debate where a lot of people claimed that they knew what was Pythonic and what was not Pythonic, and they knew that this was going to destroy the language. This was like a violation of Python's most fundamental design philosophy, and I thought that was all bullshit because I was in favor of it, and I would think I know something about Python's design philosophy. So I was really tired and also stressed of that thing, and literally after sort of announcing I was going to accept it, a certain Wednesday evening I had finally sent the email, it's accepted. I can just go implement it. So I went to bed feeling really relieved, that's behind me. And I wake up Thursday morning, 7 a.m., and I think, well, that was the last one that's going to be such a terrible debate, and that's the last time that I let myself be so stressed out about a pep decision. I should just resign. I've been sort of thinking about retirement for half a decade, I've been joking and sort of mentioning retirement, sort of telling the community at some point in the future I'm going to retire, don't take that FL part of my title too literally. And I thought, okay, this is it. I'm done, I had the day off, I wanted to have a good time with my wife, we were going to a little beach town nearby, and in I think maybe 15, 20 minutes I wrote that thing that you just called Shakespearean. The funny thing is I didn't even realize what a monumental decision it was, because five minutes later I read that link to my message back on Twitter, where people were already discussing on Twitter, Guido resigned as the BDFL. And I had posted it on an internal forum that I thought was only read by core developers, so I thought I would at least have one day before the news would sort of get out. The on your own aspects had also an element of quite, it was quite a powerful element of the uncertainty that lies ahead, but can you also just briefly talk about, for example I play guitar as a hobby for fun, and whenever I play people are super positive, super friendly, they're like, this is awesome, this is great. But sometimes I enter as an outside observer, I enter the programming community and there seems to sometimes be camps on whatever the topic, and the two camps, the two or plus camps, are often pretty harsh at criticizing the opposing camps. As an onlooker, I may be totally wrong on this, but what do you think of this? Yeah, holy wars are sort of a favorite activity in the programming community. And what is the psychology behind that? Is that okay for a healthy community to have? Is that a productive force ultimately for the evolution of a language? Well, if everybody is patting each other on the back and never telling the truth, it would not be a good thing. I think there is a middle ground where sort of being nasty to each other is not okay, but there is a middle ground where there is healthy ongoing criticism and feedback that is very productive. And you mean at every level you see that. I mean, someone proposes to fix a very small issue in a code base, chances are that some reviewer will sort of respond by saying, well, actually, you can do it better the other way. When it comes to deciding on the future of the Python core developer community, we now have, I think, five or six competing proposals for a constitution. So that future, do you have a fear of that future, do you have a hope for that future? I'm very confident about that future. By and large, I think that the debate has been very healthy and productive. And I actually, when I wrote that resignation email, I knew that Python was in a very good spot and that the Python core developer community, the group of 50 or 100 people who sort of write or review most of the code that goes into Python, those people get along very well most of the time. A large number of different areas of expertise are represented, different levels of experience in the Python core dev community, different levels of experience completely outside it in software development in general, large systems, small systems, embedded systems. So I felt okay resigning because I knew that the community can really take care of itself. And out of a grab bag of future feature developments, let me ask if you can comment, maybe on all very quickly, concurrent programming, parallel computing, async IO. These are things that people have expressed hope, complained about, whatever, have discussed on Reddit. Async IO, so the parallelization in general, packaging, I was totally clueless on this. I just used pip to install stuff, but apparently there's pipenv, poetry, there's these dependency packaging systems that manage dependencies and so on. They're emerging and there's a lot of confusion about what's the right thing to use. Then also functional programming, are we going to get more functional programming or not, this kind of idea. And of course the GIL connected to the parallelization, I suppose, the global interpreter lock problem. Can you just comment on whichever you want to comment on? Well, let's take the GIL and parallelization and async IO as one topic. I'm not that hopeful that Python will develop into a sort of high concurrency, high parallelism language. That's sort of the way the language is designed, the way most users use the language, the way the language is implemented, all make that a pretty unlikely future. So you think it might not even need to, really the way people use it, it might not be something that should be of great concern. I think async IO is a special case because it sort of allows overlapping IO and only IO and that is a sort of best practice of supporting very high throughput IO, many connections per second. I'm not worried about that. I think async IO will evolve. There are a couple of competing packages. We have some very smart people who are sort of pushing us to make async IO better. Parallel computing, I think that Python is not the language for that. There are ways to work around it, but you can't expect to write an algorithm in Python and have a compiler automatically parallelize that. What you can do is use a package like NumPy and there are a bunch of other very powerful packages that sort of use all the CPUs available because you tell the package, here's the data, here's the abstract operation to apply over it, go at it, and then we're back in the C++ world. Those packages are themselves implemented usually in C++. That's where TensorFlow and all these packages come in, where they parallelize across GPUs, for example, they take care of that for you. In terms of packaging, can you comment on the future of packaging in Python? Packaging has always been my least favorite topic. It's a really tough problem because the OS and the platform want to own packaging, but their packaging solution is not specific to a language. If you take Linux, there are two competing packaging solutions for Linux or for Unix in general, but they all work across all languages. Several languages like Node, JavaScript, Ruby, and Python all have their own packaging solutions that only work within the ecosystem of that language. What should you use? That is a tough problem. My own approach is I use the system packaging system to install Python, and I use the Python packaging system then to install third party Python packages. That's what most people do. Ten years ago, Python packaging was really a terrible situation. Nowadays, pip is the future, there is a separate ecosystem for numerical and scientific Python based on Anaconda. Those two can live together. I don't think there is a need for more than that. That's packaging. Well, at least for me, that's where I've been extremely happy. I didn't even know this was an issue until it was brought up. In the interest of time, let me sort of skip through a million other questions I have. So I watched the five and a half hour oral history that you've done with the Computer History Museum, and the nice thing about it, it gave this, because of the linear progression of the interview, it gave this feeling of a life, you know, a life well lived with interesting things in it, sort of a pretty, I would say a good spend of this little existence we have on Earth. So, outside of your family, looking back, what about this journey are you really proud of? Are there moments that stand out, accomplishments, ideas? Is it the creation of Python itself that stands out as a thing that you look back and say, damn, I did pretty good there? Well, I would say that Python is definitely the best thing I've ever done, and I wouldn't sort of say just the creation of Python, but the way I sort of raised Python, like a baby. I didn't just conceive a child, but I raised a child, and now I'm setting the child free in the world, and I've set up the child to sort of be able to take care of himself, and I'm very proud of that. And as the announcer of Monty Python's Flying Circus used to say, and now for something completely different, do you have a favorite Monty Python moment, or a moment in Hitchhiker's Guide, or any other literature show or movie that cracks you up when you think about it? You can always play me the dead parrot sketch. Oh, that's brilliant. That's my favorite as well. It's pushing up the daisies. Okay, Greta, thank you so much for talking with me today. Lex, this has been a great conversation. I felt I had so much understanding of what actually goes on inside a computer. I knew how many bits of memory it had and how difficult it was to program. And sort of, I didn't believe at all that you could just build something intelligent out of that, that would really sort of satisfy my definition of intelligence. I think the most influential thing that I read in my early twenties was Gödel Escherbach. That was about consciousness, and that was a big eye opener in some sense. In what sense? So, on your own brain, did you at the time or do you now see your own brain as a computer? Or is there a total separation of the way? So yeah, you're very pragmatically practically know the limits of memory, the limits of this sequential computing or weakly paralyzed computing, and you just know what we have now, and it's hard to see how it creates. But it's also easy to see, it was in the 40s, 50s, 60s, and now at least similarities between the brain and our computers. Oh yeah, I mean, I totally believe that brains are computers in some sense. I mean, the rules they use to play by are pretty different from the rules we can sort of implement in our current hardware, but I don't believe in, like, a separate thing that infuses us with intelligence or consciousness or any of that. There's no soul, I've been an atheist probably from when I was 10 years old, just by thinking a bit about math and the universe, and well, my parents were atheists. Now, I know that you could be an atheist and still believe that there is something sort of about intelligence or consciousness that cannot possibly emerge from a fixed set of rules. I am not in that camp. I totally see that, sort of, given how many millions of years evolution took its time, DNA is a particular machine that sort of encodes information and an unlimited amount of information in chemical form and has figured out a way to replicate itself. I thought that that was, maybe it's 300 million years ago, but I thought it was closer to half a billion years ago, that that's sort of originated and it hasn't really changed, that the sort of the structure of DNA hasn't changed ever since. That is like our binary code that we have in hardware. I mean... The basic programming language hasn't changed, but maybe the programming itself... Obviously, it did sort of, it happened to be a set of rules that was good enough to sort of develop endless variability and sort of the idea of self replicating molecules competing with each other for resources and one type eventually sort of always taking over. That happened before there were any fossils, so we don't know how that exactly happened, but I believe it's clear that that did happen. Can you comment on consciousness and how you see it? Because I think we'll talk about programming quite a bit. We'll talk about, you know, intelligence connecting to programming fundamentally, but consciousness is this whole other thing. Do you think about it often as a developer of a programming language and as a human? Those are pretty sort of separate topics. Sort of my line of work working with programming does not involve anything that goes in the direction of developing intelligence or consciousness, but sort of privately as an avid reader of popular science writing, I have some thoughts which is mostly that I don't actually believe that consciousness is an all or nothing thing. I have a feeling that, and I forget what I read that influenced this, but I feel that if you look at a cat or a dog or a mouse, they have some form of intelligence. If you look at a fish, it has some form of intelligence, and that evolution just took a long time, but I feel that the sort of evolution of more and more intelligence that led to sort of the human form of intelligence followed the evolution of the senses, especially the visual sense. I mean, there is an enormous amount of processing that's needed to interpret a scene, and humans are still better at that than computers are. And I have a feeling that there is a sort of, the reason that like mammals in particular developed the levels of consciousness that they have and that eventually sort of going from intelligence to self awareness and consciousness has to do with sort of being a robot that has very highly developed senses. Has a lot of rich sensory information coming in, so that's a really interesting thought that whatever that basic mechanism of DNA, whatever that basic building blocks of programming, if you just add more abilities, more high resolution sensors, more sensors, you just keep stacking those things on top that this basic programming in trying to survive develops very interesting things that start to us humans to appear like intelligence and consciousness. As far as robots go, I think that the self driving cars have that sort of the greatest opportunity of developing something like that, because when I drive myself, I don't just pay attention to the rules of the road. I also look around and I get clues from that, oh, this is a shopping district, oh, here's an old lady crossing the street, oh, here is someone carrying a pile of mail, there's a mailbox, I bet you they're going to cross the street to reach that mailbox. And I slow down, and I don't even think about that. And so, there is so much where you turn your observations into an understanding of what other consciousnesses are going to do, or what other systems in the world are going to be, oh, that tree is going to fall. I see sort of, I see much more of, I expect somehow that if anything is going to become unconscious, it's going to be the self driving car and not the network of a bazillion computers in a Google or Amazon data center that are all networked together to do whatever they do. So, in that sense, so you actually highlight, because that's what I work in Thomas Vehicles, you highlight the big gap between what we currently can't do and what we truly need to be able to do to solve the problem. Under that formulation, then consciousness and intelligence is something that basically a system should have in order to interact with us humans, as opposed to some kind of abstract notion of a consciousness. Consciousness is something that you need to have to be able to empathize, to be able to fear, understand what the fear of death is, all these aspects that are important for interacting with pedestrians, you need to be able to do basic computation based on our human desires and thoughts. And if you sort of, yeah, if you look at the dog, the dog clearly knows, I mean, I'm not the dog owner, but I have friends who have dogs, the dogs clearly know what the humans around them are going to do, or at least they have a model of what those humans are going to do and they learn. Some dogs know when you're going out and they want to go out with you, they're sad when you leave them alone, they cry, they're afraid because they were mistreated when they were younger. We don't assign sort of consciousness to dogs, or at least not all that much, but I also don't think they have none of that. So I think it's consciousness and intelligence are not all or nothing. The spectrum is really interesting. But in returning to programming languages and the way we think about building these kinds of things, about building intelligence, building consciousness, building artificial beings. So I think one of the exciting ideas came in the 17th century and with Leibniz, Hobbes, Descartes, where there's this feeling that you can convert all thought, all reasoning, all the thing that we find very special in our brains, you can convert all of that into logic. So you can formalize it, formal reasoning, and then once you formalize everything, all of knowledge, then you can just calculate and that's what we're doing with our brains is we're calculating. So there's this whole idea that this is possible, that this we can actually program. But they weren't aware of the concept of pattern matching in the sense that we are aware of it now. They sort of thought they had discovered incredible bits of mathematics like Newton's calculus and their sort of idealism, their sort of extension of what they could do with logic and math sort of went along those lines and they thought there's like, yeah, logic. There's like a bunch of rules and a bunch of input. They didn't realize that how you recognize a face is not just a bunch of rules but is a shit ton of data plus a circuit that sort of interprets the visual clues and the context and everything else and somehow can massively parallel pattern match against stored rules. I mean, if I see you tomorrow here in front of the Dropbox office, I might recognize you. Even if I'm wearing a different shirt, yeah, but if I see you tomorrow in a coffee shop in Belmont, I might have no idea that it was you or on the beach or whatever. I make those kind of mistakes myself all the time. I see someone that I only know as like, oh, this person is a colleague of my wife's and then I see them at the movies and I didn't recognize them. But do you see those, you call it pattern matching, do you see that rules is unable to encode that? Everything you see, all the pieces of information you look around this room, I'm wearing a black shirt, I have a certain height, I'm a human, all these, there's probably tens of thousands of facts you pick up moment by moment about this scene. You take them for granted and you aggregate them together to understand the scene. You don't think all of that could be encoded to where at the end of the day, you can just put it all on the table and calculate? I don't know what that means. I mean, yes, in the sense that there is no actual magic there, but there are enough layers of abstraction from the facts as they enter my eyes and my ears to the understanding of the scene that I don't think that AI has really covered enough of that distance. It's like if you take a human body and you realize it's built out of atoms, well, that is a uselessly reductionist view, right? The body is built out of organs, the organs are built out of cells, the cells are built out of proteins, the proteins are built out of amino acids, the amino acids are built out of atoms and then you get to quantum mechanics. So that's a very pragmatic view. I mean, obviously as an engineer, I agree with that kind of view, but you also have to consider the Sam Harris view of, well, intelligence is just information processing. Like you said, you take in sensory information, you do some stuff with it and you come up with actions that are intelligent. That makes it sound so easy. I don't know who Sam Harris is. Oh, well, it's a philosopher. So like this is how philosophers often think, right? And essentially that's what Descartes was, is wait a minute, if there is, like you said, no magic, so he basically says it doesn't appear like there's any magic, but we know so little about it that it might as well be magic. So just because we know that we're made of atoms, just because we know we're made of organs, the fact that we know very little how to get from the atoms to organs in a way that's recreatable means that you shouldn't get too excited just yet about the fact that you figured out that we're made of atoms. Right, and the same about taking facts as our sensory organs take them in and turning that into reasons and actions, that sort of, there are a lot of abstractions that we haven't quite figured out how to deal with those. I mean, sometimes, I don't know if I can go on a tangent or not, so if I take a simple program that parses, say I have a compiler that parses a program, in a sense the input routine of that compiler, of that parser, is a sensing organ, and it builds up a mighty complicated internal representation of the program it just saw, it doesn't just have a linear sequence of bytes representing the text of the program anymore, it has an abstract syntax tree, and I don't know how many of your viewers or listeners are familiar with compiler technology, but there's… Fewer and fewer these days, right? That's also true, probably. People want to take a shortcut, but there's sort of, this abstraction is a data structure that the compiler then uses to produce outputs that is relevant, like a translation of that program to machine code that can be executed by hardware, and then that data structure gets thrown away. When a fish or a fly sees, sort of gets visual impulses, I'm sure it also builds up some data structure, and for the fly that may be very minimal, a fly may have only a few, I mean, in the case of a fly's brain, I could imagine that there are few enough layers of abstraction that it's not much more than when it's darker here than it is here, well it can sense motion, because a fly sort of responds when you move your arm towards it, so clearly its visual processing is intelligent, well, not intelligent, but it has an abstraction for motion, and we still have similar things in, but much more complicated in our brains, I mean, otherwise you couldn't drive a car if you couldn't, if you didn't have an incredibly good abstraction for motion. Yeah, in some sense, the same abstraction for motion is probably one of the primary sources of our, of information for us, we just know what to do, I think we know what to do with that, we've built up other abstractions on top. We build much more complicated data structures based on that, and we build more persistent data structures, sort of after some processing, some information sort of gets stored in our memory pretty much permanently, and is available on recall, I mean, there are some things that you sort of, you're conscious that you're remembering it, like, you give me your phone number, I, well, at my age I have to write it down, but I could imagine, I could remember those seven numbers, or ten digits, and reproduce them in a while, if I sort of repeat them to myself a few times, so that's a fairly conscious form of memorization. On the other hand, how do I recognize your face, I have no idea. My brain has a whole bunch of specialized hardware that knows how to recognize faces, I don't know how much of that is sort of coded in our DNA, and how much of that is trained over and over between the ages of zero and three, but somehow our brains know how to do lots of things like that, that are useful in our interactions with other humans, without really being conscious of how it's done anymore. Right, so our actual day to day lives, we're operating at the very highest level of abstraction, we're just not even conscious of all the little details underlying it. There's compilers on top of, it's like turtles on top of turtles, or turtles all the way down, there's compilers all the way down, but that's essentially, you say that there's no magic, that's what I, what I was trying to get at, I think, is with Descartes started this whole train of saying that there's no magic, I mean, there's all this beforehand. Well didn't Descartes also have the notion though that the soul and the body were fundamentally separate? Separate, yeah, I think he had to write in God in there for political reasons, so I don't know actually, I'm not a historian, but there's notions in there that all of reasoning, all of human thought can be formalized. I think that continued in the 20th century with Russell and with Gadot's incompleteness theorem, this debate of what are the limits of the things that could be formalized, that's where the Turing machine came along, and this exciting idea, I mean, underlying a lot of computing that you can do quite a lot with a computer. You can encode a lot of the stuff we're talking about in terms of recognizing faces and so on, theoretically, in an algorithm that can then run on a computer. And in that context, I'd like to ask programming in a philosophical way, what does it mean to program a computer? So you said you write a Python program or compiled a C++ program that compiles to some byte code, it's forming layers, you're programming a layer of abstraction that's higher, how do you see programming in that context? Can it keep getting higher and higher levels of abstraction? I think at some point the higher levels of abstraction will not be called programming and they will not resemble what we call programming at the moment. There will not be source code, I mean, there will still be source code sort of at a lower level of the machine, just like there are still molecules and electrons and sort of proteins in our brains, but, and so there's still programming and system administration and who knows what, to keep the machine running, but what the machine does is a different level of abstraction in a sense, and as far as I understand the way that for the last decade or more people have made progress with things like facial recognition or the self driving cars is all by endless, endless amounts of training data where at least as a lay person, and I feel myself totally as a lay person in that field, it looks like the researchers who publish the results don't necessarily know exactly how their algorithms work, and I often get upset when I sort of read a sort of a fluff piece about Facebook in the newspaper or social networks and they say, well, algorithms, and that's like a totally different interpretation of the word algorithm, because for me, the way I was trained or what I learned when I was eight or ten years old, an algorithm is a set of rules that you completely understand that can be mathematically analyzed and you can prove things. You can like prove that Aristotelian sieve produces all prime numbers and only prime numbers. Yeah. So I don't know if you know who Andrej Karpathy is, I'm afraid not. So he's a head of AI at Tesla now, but he was at Stanford before and he has this cheeky way of calling this concept software 2.0. So let me disentangle that for a second. So kind of what you're referring to is the traditional, the algorithm, the concept of an algorithm, something that's there, it's clear, you can read it, you understand it, you can prove it's functioning as kind of software 1.0. And what software 2.0 is, is exactly what you described, which is you have neural networks, which is a type of machine learning that you feed a bunch of data and that neural network learns to do a function. All you specify is the inputs and the outputs you want and you can't look inside. You can't analyze it. All you can do is train this function to map the inputs to the outputs by giving a lot of data. And that's as programming becomes getting a lot of data. That's what programming is. Well, that would be programming 2.0. To programming 2.0. I wouldn't call that programming. It's just a different activity. Just like building organs out of cells is not called chemistry. Well, so let's just step back and think sort of more generally, of course. But you know, it's like as a parent teaching your kids, things can be called programming. In that same sense, that's how programming is being used. You're providing them data, examples, use cases. So imagine writing a function not by, not with for loops and clearly readable text, but more saying, well, here's a lot of examples of what this function should take. And here's a lot of examples of when it takes those functions, it should do this. And then figure out the rest. So that's the 2.0 concept. And so the question I have for you is like, it's a very fuzzy way. This is the reality of a lot of these pattern recognition systems and so on. It's a fuzzy way of quote unquote programming. What do you think about this kind of world? Should it be called something totally different than programming? If you're a software engineer, does that mean you're designing systems that are very, can be systematically tested, evaluated, they have a very specific specification and then this other fuzzy software 2.0 world, machine learning world, that's something else totally? Or is there some intermixing that's possible? Well the question is probably only being asked because we don't quite know what that software 2.0 actually is. And I think there is a truism that every task that AI has tackled in the past, at some point we realized how it was done and then it was no longer considered part of artificial intelligence because it was no longer necessary to use that term. It was just, oh now we know how to do this. And a new field of science or engineering has been developed and I don't know if sort of every form of learning or sort of controlling computer systems should always be called programming. So I don't know, maybe I'm focused too much on the terminology. But I expect that there just will be different concepts where people with sort of different education and a different model of what they're trying to do will develop those concepts. I guess if you could comment on another way to put this concept is, I think the kind of functions that neural networks provide is things as opposed to being able to upfront prove that this should work for all cases you throw at it. All you're able, it's the worst case analysis versus average case analysis. All you're able to say is it seems on everything we've tested to work 99.9% of the time, but we can't guarantee it and it fails in unexpected ways. We can't even give you examples of how it fails in unexpected ways, but it's like really good most of the time. Is there no room for that in current ways we think about programming? programming 1.0 is actually sort of getting to that point too, where the sort of the ideal of a bug free program has been abandoned long ago by most software developers. We only care about bugs that manifest themselves often enough to be annoying. And we're willing to take the occasional crash or outage or incorrect result for granted because we can't possibly, we don't have enough programmers to make all the code bug free and it would be an incredibly tedious business. And if you try to throw formal methods at it, it becomes even more tedious. So every once in a while the user clicks on a link and somehow they get an error and the average user doesn't panic. They just click again and see if it works better the second time, which often magically it does, or they go up and they try some other way of performing their tasks. So that's sort of an end to end recovery mechanism and inside systems there is all sorts of retries and timeouts and fallbacks and I imagine that that sort of biological systems are even more full of that because otherwise they wouldn't survive. Do you think programming should be taught and thought of as exactly what you just said? I come from this kind of, you're always denying that fact always. In sort of basic programming education, the sort of the programs you're having students write are so small and simple that if there is a bug you can always find it and fix it. Because the sort of programming as it's being taught in some, even elementary, middle schools, in high school, introduction to programming classes in college typically, it's programming in the small. Very few classes sort of actually teach software engineering, building large systems. Every summer here at Dropbox we have a large number of interns. Every tech company on the West Coast has the same thing. These interns are always amazed because this is the first time in their life that they see what goes on in a really large software development environment. Everything they've learned in college was almost always about a much smaller scale and somehow that difference in scale makes a qualitative difference in how you do things and how you think about it. If you then take a few steps back into decades, 70s and 80s, when you were first thinking about Python or just that world of programming languages, did you ever think that there would be systems as large as underlying Google, Facebook, and Dropbox? Did you, when you were thinking about Python? I was actually always caught by surprise by sort of this, yeah, pretty much every stage of computing. So maybe just because you've spoken in other interviews, but I think the evolution of programming languages are fascinating and it's especially because it leads from my perspective towards greater and greater degrees of intelligence. I learned the first programming language I played with in Russia was with the Turtle logo. Logo, yeah. And if you look, I just have a list of programming languages, all of which I've now played with a little bit. I mean, they're all beautiful in different ways from Fortran, Cobalt, Lisp, Algol 60, Basic, Logo again, C, as a few, the object oriented came along in the 60s, Simula, Pascal, Smalltalk. All of that leads. They're all the classics. The classics. Yeah. The classic hits, right? Steam, that's built on top of Lisp. On the database side, SQL, C++, and all of that leads up to Python, Pascal too, and that's before Python, MATLAB, these kind of different communities, different languages. So can you talk about that world? I know that sort of Python came out of ABC, which I actually never knew that language. I just, having researched this conversation, went back to ABC and it looks remarkably, it has a lot of annoying qualities, but underneath those, like all caps and so on, but underneath that, there's elements of Python that are quite, they're already there. That's where I got all the good stuff. All the good stuff. So, but in that world, you're swimming these programming languages, were you focused on just the good stuff in your specific circle, or did you have a sense of what is everyone chasing? You said that every programming language is built to scratch an itch. Were you aware of all the itches in the community? And if not, or if yes, I mean, what itch were you trying to scratch with Python? Well, I'm glad I wasn't aware of all the itches because I would probably not have been able to do anything. I mean, if you're trying to solve every problem at once, you'll solve nothing. Well, yeah, it's too overwhelming. And so I had a very, very focused problem. I wanted a programming language that sat somewhere in between shell scripting and C. And now, arguably, there is like, one is higher level, one is lower level. And Python is sort of a language of an intermediate level, although it's still pretty much at the high level end. I was thinking about much more about, I want a tool that I can use to be more productive as a programmer in a very specific environment. And I also had given myself a time budget for the development of the tool. And that was sort of about three months for both the design, like thinking through what are all the features of the language syntactically and semantically, and how do I implement the whole pipeline from parsing the source code to executing it. So I think both with the timeline and the goals, it seems like productivity was at the core of it as a goal. So like, for me in the 90s, and the first decade of the 21st century, I was always doing machine learning, AI programming for my research was always in C++. And then the other people who are a little more mechanical engineering, electrical engineering, are MATLABby. They're a little bit more MATLAB focused. Those are the world, and maybe a little bit Java too. But people who are more interested in emphasizing the object oriented nature of things. So within the last 10 years or so, especially with the oncoming of neural networks and these packages that are built on Python to interface with neural networks, I switched to Python and it's just, I've noticed a significant boost that I can't exactly, because I don't think about it, but I can't exactly put into words why I'm just much, much more productive. Just being able to get the job done much, much faster. So how do you think, whatever that qualitative difference is, I don't know if it's quantitative, it could be just a feeling, I don't know if I'm actually more productive, but how do you think about... You probably are. Yeah. Well, that's right. I think there's elements, let me just speak to one aspect that I think that was affecting my productivity is C++ was, I really enjoyed creating performant code and creating a beautiful structure where everything that, you know, this kind of going into this, especially with the newer and newer standards of templated programming of just really creating this beautiful formal structure that I found myself spending most of my time doing that as opposed to getting it, parsing a file and extracting a few keywords or whatever the task was trying to do. So what is it about Python? How do you think of productivity in general as you were designing it now, sort of through the decades, last three decades, what do you think it means to be a productive programmer?

本集资源与出处