4 ms·
It's true, Pyret gets ideas from a handful of places, not just Python. From a student or instructor's point of view, it is serving a lot of the same ends as so
by jpolitz 10y ago
It's true, Pyret gets ideas from a handful of places, not just Python.
From a student or instructor's point of view, it is serving a lot of the same ends as some of Python's choices:
Toplevel code runs as a script without ceremony, the default behavior doesn't statically check types but is conservative about coercing types and overloading operators (e.g. "a" + 5 is an error), integers promote to bignums by default (though Pyret supports exact rational bignums as well).
Pyret supports docstrings explicitly, and examples/check blocks have similarities to Python's doctest.
Fields of ADT instances can be accessed simply with "." (in contrast to OCaml or other functional languages), and methods close over self on dot-access as they do in Python.
Some of these things are also true of Ruby, so that's a fair comparison as well. And things like "data", and the gradual type-checking facilities, are clearly coming from other sources (though Python is moving in a gradually-typed direction as well).
I know we were thinking about Python in particular when we made a lot these decisions, so I think it's a fair characterization, though Python is one of several inspirations.