算法与计算机科学mvanier.livejournal.com编辑精选
Y 组合子(2008)
The Y Combinator (2008)
2018 — 2021,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是一篇讲解 Y 组合子的经典博客文章,逐步展示如何从递归函数推导出 Y 组合子,让匿名函数在 λ 演算中实现递归。文中对强/弱类型的定义也引发讨论,评论区补充了图形表示、替代读物和适用边界。
为什么经久不衰:Y 组合子是函数式编程与 λ 演算的核心概念,而这篇推导清晰、常被推荐的讲解让它在多年后仍值得一读。
HN 评论精选
称赞文章推导清晰,并推荐配套演讲、笔记和 Python 示例。
这是对如何推导出 Y 组合子的很好描述。有一个使用类似例子的演讲,我觉得很有教育意义。我把视频中的例子记下来帮助自己学习,最近也给团队讲了这个主题并写了 Python 版本。
grdvnl查看英文原文
That is a nice description of how to arrive at the Y-combinator. There was a talk using similar examples which I think is very educational. https://www.infoq.com/presentations/Y-Combinator I wrote down the examples used in the video (given the poor quality of video) to help myself learn about the Y-Combinator https://gist.github.com/gdevanla/9171085 Recently, I presented this topic to my team and wrote down a Python equivalent of this example. https://gist.github.com/gdevanla/07a08d99e183f494d036c6d6fe665c09
讽刺文章对强弱类型的定义会把带子类型的系统误判为弱类型。
“强类型仅仅意味着语言中每个值有且只有一个类型,而弱类型意味着某些值可以有多个类型。”啊哈!现在任何有子类型的系统都成了“弱类型”!比如 System F-sub!
catnaroek查看英文原文
> Strong typing simply means that every value in the language has one and only one type, whereas weak typing means that some values can have multiple types. Aha! Now, any system with subtyping is “weakly typed”! For example, System F-sub!
推荐另一篇更轻松易懂的经典材料。
这让我想起我心目中理解 Y 组合子的最佳材料——Matthias Felleisen 和 Dan Friedman 的《(Y Y) Works!》。它读起来很轻松,强烈推荐。
truncate查看英文原文
This remind of the best material in my opinion to understand the Y combinator, "(Y Y) Works! by Matthias Felleisen and Dan Friedman"[1]. Its very light read IMO, and highly recommended. [1] https://xivilization.net/~marek/binaries/Y.pdf
指出 Y 组合子在 Actor 模型中的局限。
不幸的是,Y 组合子不适用于 Actor 程序,因为 Actor 程序能实现非确定性过程,而这些过程无法在非确定性 λ 演算中实现。详见链接中的论文。
ProfHewitt查看英文原文
Unfortunately, the Y Combinator does not work for Actor programs, which can implement non-deterministic procedures that cannot be implemented in the non-deterministic lambda calculus. For further information, see the following: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3418003
历次讨论
同类还值得读
位运算技巧集
Bit Twiddling Hacks
斯坦福页面上的经典位运算技巧合集,收录了 popcount、前导/尾随零、位反转、交换、舍入等大量技巧,并附有解释和性能讨论。
算法与计算机科学上首页 8 次 · 2011–2024graphics.stanford.edu编辑精选如何不按平均评分排序
How Not To Sort By Average Rating
经典文章解释了为什么按平均评分排序不可靠:只有少量评价的条目(比如仅一条五星)会轻易排到最前,而评价数量的差异被忽略。
算法与计算机科学上首页 7 次 · 2009–2024evanmiller.org编辑精选数据结构可视化
Data Structure Visualizations
旧金山大学 David Galles 教授制作的数据结构与算法交互式可视化网站,涵盖 B 树、红黑树、排序、图算法等,可逐步操作观察其运行过程。
算法与计算机科学上首页 6 次 · 2011–2021cs.usfca.edu编辑精选1996 年以来的计算机科学最佳论文奖
Best Paper Awards in Computer Science since 1996
Jeff Huang 维护的一个汇总页面,收录了自 1996 年以来计算机科学各主要会议的“最佳论文奖”获奖名单,并按年份和会议整理,方便读者一站式浏览历届获奖论文。
算法与计算机科学上首页 6 次 · 2010–2018jeffhuang.com编辑精选算法(Jeff Erickson)
Algorithms, by Jeff Erickson
伊利诺伊大学 Jeff Erickson 教授的算法课教材,免费在线开放。
算法与计算机科学上首页 5 次 · 2018–2022jeffe.cs.illinois.edu编辑精选