Pyret is a programming language designed for computing education across many contexts, with a robust web-based runtime and programming environment to support broad access. Several curricula have been co-designed with Pyret at many levels.
Writing tests via examples (unit tests) is directly supported by the syntax and runtime of Pyret. No separate library or build file configuration needed, writing and running the tests come with writing and running a program.
Programs that create images give immediate visual feedback, and support learning outcomes around composition of values. Bootstrap:Algebra has lessons like Make a Flag and Hour of Code using these ideas.
Pyret's number system supports exact rational arithmetic for many operations. This avoids having floating point as a curricular dependency early on. When approximations become inevitable, they have an explicit representation: Roughnums.
Programs that create images give immediate visual feedback, and support learning outcomes around composition of values. Bootstrap:Algebra has lessons like Make a Flag and Hour of Code using these ideas.
In Boostrap's Data Science curriculum, students work with programs that load and analyze raw data using Pyret Tables. The material has been used both integrated into math classes and as part of AP Computer Science Principles. Data can be easily loaded from CSV files at public URLs, or from Google Sheets.
Pyret reactors and images can be used to build physical simulations. These ideas are used in the Bootstrap:Physics curriculum, and they are supported by both language development and curricular research.
Writing tests via examples (unit tests) is directly supported by the syntax and runtime of Pyret. No separate library or build file configuration needed, writing and running the tests come with writing and running a program.
Pyret has algebraic data types and case matching in the style of most modern languages. Direct construction, along with built-in testing, make it straightforward to incrementally build up data structure definitions.
Programs that create images give immediate visual feedback, and support learning outcomes around composition of values. Bootstrap:Algebra has lessons like Make a Flag and Hour of Code using these ideas.
Writing tests via examples (unit tests) is directly supported by the syntax and runtime of Pyret. No separate library or build file configuration needed, writing and running the tests come with writing and running a program.
Pyret has algebraic data types and case matching in the style of most modern languages. Direct construction, along with built-in testing, make it straightforward to incrementally build up data structure definitions.
Pyret has a Visual Studio Code extension that opens files in the same visual editor as the examples above. It works in Github Codespaces, github.dev, and desktop Visual Studio Code.
All the examples above embed an instace of Pyret through its embedding library.
You can embed Pyret on your own websites and projects by
installing that npm
package, which has an API for controlling and
listening to the embedded instance.
You can embed from our copies of the compiler and runtime, or serve
your own. No Pyret code runs on the server: it's strictly a bundle
of client-side HTML, CSS, and JavaScript (we've done a
little bit of engineering in this space to make this possible).
Pyret runs from the command line via the pyret-npm
package.
Nearly all libraries (including images) run the same offline and
in-browser. This can be especially important for grading student
code submissions in an automated way. THIS DOCUMENT (fill) says more
about it.
Pyret has specific libraries and features (FILL: url-file tutorial, Github example) for creating and deploying starter code for students seamlessly. We developed these features and workflows in our own courses, with our own TAs, and for our own curricula.