4 ms·
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.
by bayesian_horse 5y ago
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.
- AlphaSite 5y agoHonestly this looks much closer to ruby than Python, implicit returns etc are very unpythonic, it’s not white space sensitive, etc.
- keithalewis 5y agoIf you only know python...
- aranchelk 5y agoTo 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.
- scns 5y agoStudents switching from this to a "real world language" would be disappointed if it does not have Algebraic Data Types, pretty sure about this. Once you learned about them in SML, OCaml, Haskell or one of their descendants, which include Pyret, Elm, ReasonML/ReScript, Rust and Purescript, you feel lucky if you can use Kotlin and approximate them with sealed classes. We will see, maybe C++, Java and C# add them in the next 5 years.
- gsliepen 5y agoC++17 added std::variant (https://en.cppreference.com/w/cpp/utility/variant https://en.cppreference.com/w/cpp/utility/variant) and other types so algebraic data types are now officially part of the standard. Of course, it's not as compact to write as in Pyret, especially since there's no pattern matching switch statement (yet).
- mlazos 5y agothey do have the godforsaken visit function which requires you to write the lambda syntax for each variant type, I end up writing chained if’s 99% of the time because it’s clearer.
- chakkepolja 5y agoThere's another way using switch if I recall properly. That said I don't like C++'s library additions just to stay modern. They are not expressive, increase build times, make debug builds slower and can fail compiler optimizers.
- jpolitz 5y agoIf it helps to think about the issue, we have a (free, online) book that manages this transition, so we've thought about this quite a bit and one co-author has been teaching a Pyret -> Python flow for several years. [https://dcic-world.org/2021-08-21/part_intro.html https://dcic-world.org/2021-08-21/part_intro.html]