6 ms·
Start Coding in Pyret
- japaget 12y agoSee previous HN discussion at https://news.ycombinator.com/item?id=6701688 https://news.ycombinator.com/item?id=6701688 and GitHub repository at https://github.com/brownplt/pyret-lang https://github.com/brownplt/pyret-lang .
- passive 12y agoHmm, this looks like a language I would design if I ever got around to it. If they have a good distribution system, could be awesome.
- doug1001 12y agothis looks really interesting love the where blocks and the data declarations (remind me of scala's case classes) and the "progressive" type annotation (which mimics the way i use cython + python) (less appealing, and this is purely subjective of course, is your logo, which seems to have been inspired by malware or perhaps by labels required for toxic chemicals)
- edmccard 12y ago>...your logo, which seems to have been inspired by malware and perhaps labels required for industrial chemicals Or maybe "pyret" is pronounced like "pirate" and the logo was inspired by the skull-and-crossbones pirate flag. I especially like how the crossbones look like the letter lambda.
- desdiv 12y agoAnd the color scheme is paying homage to Scheme's logo.
- shriramkmurthi 12y agoTo _Racket's_ logo.
- shriramkmurthi 12y agoPrecisely!
- tetron 12y agoThis looks more or less like a reskinned Standard ML. Which is cool, because SML is awesome :-)
- zem 12y agoit's dynamically typed, though!
- shriramkmurthi 12y agoThe static type system is under development, but it will never be _required_.
- mgraczyk 12y ago"Pyret has numbers, because we believe an 8GB machine should not limit students to using just 32 bits." Java Pyret // this is not true # this is true ((1 / 3) * 3) == 1 ((1 / 3) * 3) == 1 wat How about ((1.0 / 3) * 3) == 1? Not sure what point they are trying to make here. Did somebody change the definition of "number" to mean "floating point type?"
- JonathonW 12y agoFrom what I'm reading, Pyret numbers are either exact rational numbers (which includes integers) or inexact floating point numbers (presumably, they're disambiguating this by whether or not you use a decimal point).
- mgraczyk 12y agoNice. Still, it's unsettling that they've confounded address space size with integral type width.
- dragonwriter 12y agoAvailable RAM (something 8GB plausibly could refer to, unlike address-space size) is arguably more relevant to the issue here (which is the desirability of not using fixed-width integers and floating point but instead preferring arbitrary-precision rational numbers as the default.)
- shriramkmurthi 12y agoThat is indeed our point. Thanks for explaining it!
- fineIllregister 12y agoIn Pyret, (1 / 3) resolves to (1 / 3), not 0.3333333333333333 or some equivalent, like it does in many other languages. (0.3333333333333333 * 3) is 0.999999999999999, not 1.
- vijucat 12y agoWhy are all "learning to program" languages these days duck typed / dynamically typed? Has it always been this way? Has SML, for example, been a first language of choice in Programming 101 in earlier decades? Personal bias : I think there is a definite loss in not teaching about the power of static typing in a first language.
- noelwelsh 12y agoBeginners have very incomplete mental models of programming languages (if they didn't, they wouldn't be beginners...) I believe the experience of the PLT group, who have been teaching introductory programming for some 20 years and definitely understand type systems, is that static types can get in the way of learning. There are two reasons: - Type errors for most type systems are very difficult to diagnose for beginners. They often aren't, for example, located on the actual error location in Hindley-Milner style type inference. - Allowing students to run their code helps build a correct mental model. In particular it allows them to locate the errors in their code. Note that Pyret does have a facility for dynamic checks that serves a similar purpose to static types.
- vijucat 12y ago> located on the actual error location in Hindley-Milner style type inference Very interesting, thanks for the insight + reference to the PLT group.
- shriramkmurthi 12y agoIn addition to @noelwelsh's reply, I want to add that we are very much working on a type system (we have a working internal prototype). We are also working on a very different kind of type inference, unlike Hindley-Milner. For us, it's important that the error story be as good as the "proper functioning" story, which is why we haven't released these. But it does mean that in the near future, people will be able to program in the typed language starting whenever they want, including from the very beginning. (And then we can do some experiments, too!)