ChocoPy: a programming language for compilers courses

Rohan Padhye, Koushik Sen, P. Hilfinger
{"title":"ChocoPy: a programming language for compilers courses","authors":"Rohan Padhye, Koushik Sen, P. Hilfinger","doi":"10.1145/3358711.3361627","DOIUrl":null,"url":null,"abstract":"ChocoPy is a programming language designed for teaching an undergraduate course on programming languages and compilers. ChocoPy is a restricted subset of Python 3.6, using static type annotations to enforce compile-time type safety. ChocoPy is fully specified using formal grammar, typing rules, and operational semantics. Valid ChocoPy programs can be executed in a standard Python interpreter, producing results consistent with ChocoPy semantics. A major component of CS164 at UC Berkeley is the project: students develop a full compiler for ChocoPy, targeting RISC-V, in about twelve weeks. In other exercises, students extend the syntax, type system, and formal semantics to support additional features of Python. In this paper, we outline (1) the motivations for creating the ChocoPy project, (2) salient features of the language, (3) the resources provided to students to develop their compiler, (4) some insights gained from teaching two semesters of ChocoPy-based courses by different instructors. Our assignment resources are available for re-use by other instructors and institutions.","PeriodicalId":190350,"journal":{"name":"Proceedings of the 2019 ACM SIGPLAN Symposium on SPLASH-E","volume":"38 4","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-10-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"11","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 2019 ACM SIGPLAN Symposium on SPLASH-E","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3358711.3361627","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 11

Abstract

ChocoPy is a programming language designed for teaching an undergraduate course on programming languages and compilers. ChocoPy is a restricted subset of Python 3.6, using static type annotations to enforce compile-time type safety. ChocoPy is fully specified using formal grammar, typing rules, and operational semantics. Valid ChocoPy programs can be executed in a standard Python interpreter, producing results consistent with ChocoPy semantics. A major component of CS164 at UC Berkeley is the project: students develop a full compiler for ChocoPy, targeting RISC-V, in about twelve weeks. In other exercises, students extend the syntax, type system, and formal semantics to support additional features of Python. In this paper, we outline (1) the motivations for creating the ChocoPy project, (2) salient features of the language, (3) the resources provided to students to develop their compiler, (4) some insights gained from teaching two semesters of ChocoPy-based courses by different instructors. Our assignment resources are available for re-use by other instructors and institutions.
ChocoPy:一门编程语言的编译器课程
ChocoPy是一种编程语言,设计用于教授编程语言和编译器的本科课程。ChocoPy是Python 3.6的一个受限制的子集,它使用静态类型注释来强制执行编译时类型安全。ChocoPy是使用正式语法、类型规则和操作语义完全指定的。有效的ChocoPy程序可以在标准的Python解释器中执行,产生与ChocoPy语义一致的结果。加州大学伯克利分校CS164的一个主要组成部分是这个项目:学生们在大约12周的时间里为ChocoPy开发一个完整的编译器,目标是RISC-V。在其他练习中,学生扩展语法、类型系统和形式语义,以支持Python的其他特性。在本文中,我们概述了(1)创建ChocoPy项目的动机,(2)该语言的显著特征,(3)为学生开发编译器提供的资源,(4)不同教师在两个学期的ChocoPy基础课程教学中获得的一些见解。我们的作业资源可供其他教师和机构重新使用。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信