This tutorial gives an advanced introduction to string diagrams and graph languages for higher-order computation. The subject matter develops in a principled way, starting from the two dimensional syntax of key categorical concepts such as functors, adjunctions, and strictification, and leading up to Cartesian Closed Categories, the core mathematical model of the lambda calculus and of functional programming languages. This methodology inverts the usual approach of proceeding from syntax to a categorical interpretation, by rationally reconstructing a syntax from the categorical model. The result is a graph syntax -- more precisely, a hierarchical hypergraph syntax -- which in many ways is shown to be an improvement over the conventional linear term syntax. The rest of the tutorial focuses on applications of interest to programming languages: operational semantics, general frameworks for type inference, and complex whole-program transformations such as closure conversion and automatic differentiation.
翻译:本教程系统性地介绍了高阶计算的弦图与图语言高级应用。内容从函子、伴随和严格化等关键范畴论概念的二维语法出发,以严谨方式逐步推导至笛卡尔闭范畴——这一λ演算与函数式编程语言的核心数学模型。该方法论颠覆了从语法到范畴解释的传统路径,通过从范畴模型理性重构语法,最终形成图语法(更精确地说是分层超图语法),并在多方面展现出相较于传统线性项语法的优越性。教程后续聚焦编程语言相关应用:操作语义、通用类型推断框架,以及闭包转换与自动微分等复杂程序整体变换技术。