一句话:开发了理解 OCaml 作用域与类型规则的块编程环境,使完整块程序生成的 OCaml 代码保证可编译。
OCaml Blockly 是一个基于 Google Blockly 构建的块编程环境,面向函数式语言 OCaml 的一个子集。其核心特点是内建 OCaml 的作用域规则和类型规则:用户拼搭出的完整程序对应的 OCaml 代码不会出现语法错误、作用域错误或类型错误。系统覆盖 OCaml 入门构造,足以编写东京地铁网络最短路问题。论文介绍了 OCaml Blockly 的设计,并说明其在计算机专业函数式编程课程中的使用方式。
Abstract OCaml Blockly is a block-based programming environment for a subset of the functional language OCaml, developed based on Google Blockly. The distinct feature of OCaml Blockly is that it knows the scoping and typing rules of OCaml. As such, for any complete program in OCaml Blockly, its OCaml counterpart compiles: it is free from syntax errors, scoping errors, and type errors. OCaml Blockly supports introductory constructs of OCaml that are sufficient to write the shortest path problem for the Tokyo metro network. This paper describes the design of OCaml Blockly and how it is used in a CS-major course on functional programming.