3 ms·
Great points! These are important things, but not necessarily important to Pyret. Pyret is not designed to be a general-purpose programming language, so the des
by jswrenn 10y ago
Great points! These are important things, but not necessarily important to Pyret. Pyret is not designed to be a general-purpose programming language, so the design of the language is directed and constrained by the needs of the teachers who use it.
Pyret's number representation is one consequence of this: Pyret numbers are stored as either exact rational numbers:
> num-sqrt(4.41)
21/10
or, when an exact representation isn't possible, as "roughnums" (which are backed by a Javascript floating-point number:
> num-sqrt(2)
~1.4142135623730951
Pyret's users overwhelmingly use Code.Pyret.Org, an in-browser development environment. Unfortunately, Javascript is a very hostile compilation target. For the time being, this rules out support for threading.
Pyret does not have FFI from an end-user perspective, but several of the standard library modules are implemented in hand-written Javascript.
Pyret has file I/O, but not in its online development environment, since the web page does not have filesystem access.
(Disclosure: I am a developer of Pyret!)