Live data from Hacker News

The Pyret Programming Language

pyret.org

11–20 of 138 posts

Re: The Pyret Programming Language

#11

I really like the in-function documentation and unit like testing in the where clause. > # this is true > ((1 / 3) * 3) == 1 This worries me. I know it is true mathamatically, but experience tells me trusting floats is a recipe for disaster. A approximate equal operator is safer. Floats are such a leaky abstraction it is in my opinion better students know this early on.

Many languages treat the construction

   1/3
As a rational type, and do not convert to float unless you cast. Common Lisp comes immediately to mind. Evidently pyret is another.

Re: The Pyret Programming Language

#14

My criticism is that this language is very similar to Python and might very well confuse students who ultimately have to switch to Python or other languages.

Honestly this looks much closer to ruby than Python, implicit returns etc are very unpythonic, it’s not white space sensitive, etc.

Re: The Pyret Programming Language

#15

My criticism is that this language is very similar to Python and might very well confuse students who ultimately have to switch to Python or other languages.

Honestly this looks much closer to ruby than Python, implicit returns etc are very unpythonic, it’s not white space sensitive, etc.

If you only know python...

Re: The Pyret Programming Language

#16

My criticism is that this language is very similar to Python and might very well confuse students who ultimately have to switch to Python or other languages.

To me it looks a lot more like Haskell than anything, e.g. :: for type signatures, sum types, pattern matches, etc.

And some Ruby with the end keyword to close blocks.

Re: The Pyret Programming Language

#18
It seems pretty bad to have kebab-case identifiers in a language that also has an infix subtraction operator -. The only languages I know that allow kebab-case idents are lisps, where subtraction is (- prefix notation). From the examples:

    lam(actual): num-abs(actual - target) 
This is a new, even worse kind of "whitespace significance" than indentation. Is it a function called `num-abs` or a variable `num` minus `abs(actual - target)`? I can't tell if the language would allow `actual-target` as subtraction.

Re: The Pyret Programming Language

#19

It seems pretty bad to have kebab-case identifiers in a language that also has an infix subtraction operator -. The only languages I know that allow kebab-case idents are lisps, where subtraction is (- prefix notation). From the examples: lam(actual): num-abs(actual - target) This is a new, even worse kind of "whitespace significance" than indentation. Is it a function called `num-abs` or a variable `num` minus `abs(…

[deleted]

Re: The Pyret Programming Language

#20

It seems pretty bad to have kebab-case identifiers in a language that also has an infix subtraction operator -. The only languages I know that allow kebab-case idents are lisps, where subtraction is (- prefix notation). From the examples: lam(actual): num-abs(actual - target) This is a new, even worse kind of "whitespace significance" than indentation. Is it a function called `num-abs` or a variable `num` minus `abs(…

Dylan had kebab-case idents and infix operators. It worked okay because you have to separate infix operators with a space anyway; omitting it is a syntax error.

In practice I doubt this would trip me up because every coding standard I've worked with has mandated spaces around infix operators. I suppose it might be a lot more confusing if you're used to coding standards that allow you to omit them, but my understanding is that's a minority.

Post reply on HN