arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1902.00735cs.PL
收藏

作为一级价值的事件环--教学语言设计案例研究

Event Loops as First-Class Values: A Case Study in Pedagogic Language Design

Joe Politz, Benjamin Lerner, Sorawee Porncharoenwase, Shriram Krishnamurthi

摘要:

世界模型是事件驱动编程的现有函数输入输出机制。它被用于许多流行的教科书和课程设置。世界模型将两个不同的任务--事件处理器的定义及其执行--合并为一个。这种合并给我们尝试使用它的几个教育环境中的学生用户带来了重大(甚至是不可接受的)负担,例如,教物理学。虽然堆积特性来解决这些问题很有诱惑力,但我们使用了Scheme语言的设计格言,即删除那些使它们看起来必要的弱点。通过分离上面的两个任务,我们得到了一个稍微不同的原语,即反应堆,作为我们的基础。这只定义了事件处理器,各种执行操作符决定了它如何运行。新设计支持对事件驱动程序进行编程控制。这简化了对程序行为的反映,并消除了旧设计所强加的许多不必要的课程依赖性。这项工作已经在Pyret程序设计语言中实现。关注点的分离使新的课程,如Bootstrap:物理课程,能够起飞。每年都有成千上万的学生使用这种新机制。我们相信,减少阻抗失配可以改善他们的教育体验。

英文摘要:

The World model is an existing functional input-output mechanism for event-driven programming. It is used in numerous popular textbooks and curricular settings. The World model conflates two different tasks -- the definition of an event processor and its execution -- into one. This conflation imposes a significant (even unacceptable) burden on student users in several educational settings where we have tried to use it, e.g., for teaching physics. While it was tempting to pile on features to address these issues, we instead used the Scheme language design dictum of removing weaknesses that made them seem necessary. By separating the two tasks above, we arrived at a slightly different primitive, the reactor, as our basis. This only defines the event processor, and a variety of execution operators dictate how it runs. The new design enables programmatic control over event-driven programs. This simplifies reflecting on program behavior, and eliminates many unnecessary curricular dependencies imposed by the old design. This work has been implemented in the Pyret programming language. The separation of concerns has enabled new curricula, such as the Bootstrap:Physics curriculum, to take flight. Thousands of students use this new mechanism every year. We believe that reducing impedance mismatches improves their educational experience.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑