首页> 外文会议>International Conference on Learning and Teaching in Computing and Engineering >How Does a Program Run? A Visual Model Based on Annotating Abstract Syntax Trees
【24h】

How Does a Program Run? A Visual Model Based on Annotating Abstract Syntax Trees

机译:程序如何运行?基于注释抽象语法树的可视化模型

获取原文

摘要

How does a program run? A correct mental model relies on an approach that uses rewriting of programs into canonical forms or juggling with variables, assignment statements and stacks. The rewriting process is, however, quite cumbersome, and the stack method inadequate for understanding functional programming because of the presence of closures. For the last several years, we have been experimenting with a diagrammatic way of teaching how functional and imperative programs run. Programs are drawn as abstract syntax trees and evaluation is explained as an annotation of the tree. Evaluation may also include replicating parts of a tree (e.g., when doing a function call). Each programming language defines a particular evaluation model, and each evaluation model entails a particular way of annotating the tree. Using this method, we have taught many standard topics in the Principles of Programming Languages course: lexical scope, closures, recursion, parameter passing, variable assignment, and continuations. The annotation framework turns out to be an excellent preparation for students attempting to write full-blown interpreters, as done in several popular text books on programming languages. In this paper, we introduce this method of understanding how programming languages run and also report experimental results of using it in a class of approximately 200 students during the last year.
机译:程序如何运行?正确的心理模型依赖于一种方法,该方法将程序重写为规范形式或与变量,分配语句和堆栈进行杂耍。然而,重写过程是非常麻烦的,并且堆栈方法由于存在封闭而理解功能规划不足。在过去的几年中,我们一直在尝试一种教学方式的示意性方式,令人牢固的计划运行。程序被绘制为抽象语法树木,评估被解释为树的注释。评估还可以包括复制树的部分(例如,在做函数调用时)。每个编程语言定义特定的评估模型,每个评估模型都需要一种注释树的特定方式。使用此方法,我们在编程语言原则中教授了许多标准主题课程:词汇范围,封闭,递归,参数通过,可变分配和持续。注释框架表明,对于尝试编写全吹解释者的学生,这是在编程语言上的几个流行文本书籍中完成的学生提供的优秀准备。在本文中,我们介绍了这种了解编程语言如何运行的方法,并在去年期间报告在大约200名学生中使用它的实验结果。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号