3 ms·
Overall this looks quite nice. I like the way types can be defined but if they are not they can be anything. Are these types checked anywhere? I think they sho
by cabalamat 5y ago
Overall this looks quite nice. I like the way types can be defined but if they are not they can be anything.
Are these types checked anywhere? I think they should be checked at compile-time wherever possible, and optionally at run time too (I say optionally as the checks might make it slow, so they could be checked in development but perhaps not in production).
- justinpombrio 5y agoIIRC, they're checked at run-time but not compile-time. And to avoid the speed issue (you're right: it really can get really slow), it only checks the top-level type. E.g. `List<Number>` just checks that it's a list.
- cabalamat 5y ago> they're checked at run-time but not compile-time Do they intend to add this? I think it would make a big difference. It would make thje language more like Haskell, where lots of bugs would be caught at compile time. > it only checks the top-level type. E.g. `List<Number>` just checks that it's a list. That's fair enough because otherwise it might have to go though potentially very big data structures. Maybe there could be a command `strict_check(aDataStructure)` which would only get executed when type checking is on and would recurse into a data structure checking everything.
- scns 5y agoIt is used to to teach children. Spoken the name sounds like pirate. No snark intended.
- cabalamat 5y agoI'm not sure if this was intended as a reply to my comment. In any case, I would suggest that a language be powerful and simple enough that it can do a wide range of tasks including teaching children, GUI apps, web apps, AI research, scripting, etc. Python does this and Pyret should aspire to do it too.
- scns 5y agoIt totally was. Type checking is being worked on, they were not happy with the performance of their first implementation.
- skrishnamurthi 5y agoThey are indeed checked at compile-time if you use the optional type checker. It's not on by default because there are still a few odd corner-case bugs in it. But the Run button remembers which state you are in, so once you switch to using the type-checker, you'll always use it unless you stop using it. What it should do is a decision that should be made by the individual curriculum/instructor.