@yminsky 这场关于如何改进代码库、让它更适合智能体使用的演讲里,有太多精华和实用建议了 • 智能体依靠反馈发挥作用,而类型就是最好的反馈形式之一 • 用类型让非法状态无法被表示,就能在整个代码库中强制执行全局规则 • 基于属性的测试、模糊测试,甚至全系统确定性仿真测试 • 预期输出测试:直接打印内容,再将其捕获到测试中。这样能让行为清晰可读。这与编译器使用固定样例测试的方式非常相似,可以缩小审查范围 • 形式化方法过去成本极高:seL4 大约有 8,700 行 C 代码,耗费了约 25 人年,每行 C 代码对应 23 行证明,但智能体改变了投入产出比 https://www.youtube.com/watch?v=rUYP4C29yCw
看原文
so many gems and great tips in this talk from @yminsky about how to improve your codebase for agents • agents thrive on feedback, and types are one of the best kinds • make illegal states unrepresentable with types, and it enforces global rules across your codebase • property based tests, fuzzing, and even full-system deterministic simulation testing • expect tests: just print stuff out and capture it in the test. makes behavior legible. it's very similar to how compilers have fixture tests, it reduces the review surface area • formal methods used to be very expensive: seL4 is about 8,700 lines of C and took around 25 person-years, with 23 lines of proof for every line of C code, but agents change the roi https://www.youtube.com/watch?v=rUYP4C29yCw