3 ms·
Just come to Perl6...has all the nice things Python3 has plus a bunch in a really nicely designed package. Seriously, it is much prettier than the linenoise peo
by throwaway7645 10y ago
Just come to Perl6...has all the nice things Python3 has plus a bunch in a really nicely designed package. Seriously, it is much prettier than the linenoise people think of with Perl5. The only problem is the implementation is very young and immature (but it gets daily fixes and improvements). Perl6 is a completely new language designed from the ground up over 15 years. It has some syntactical similarities though. Sometimes I wish Python would do the same thing and start over on LLVM like Crystal, or do something closer to Perl6. If you just want a simple scripting language, Lua and Rebol are nice and Red (when finished) will be like Rebol on steroids.
- vram22 10y agoInteresting. What online resources and books would you recommend to learn Perl6?
- throwaway7645 10y agoThere is an excellent Perl6intro tutorial out there for a lightweight overview along with learn x in y minutes to start. Diving deeper, there are several books that either just came out or are about to come out. I think they have links on the Perl6.org site. In particular, there is a recent O'REILLY release that you can read now, but still has a month until the paper edition is finished (Think like a Data Scentist with Perl6 by Laurent Rosenfeld) and it is very good as something that covers a lot, but not too crazy. Brian d Foy had a successful kickstarter to do a Learning Perl6 book (he has written several versions of Learning Perl5). There is a rumor that Larry Wall is working on a Perl6 version of his Programming Perl (Camel book). Probably one of the best resources is Rosetta Code. I really like how you can still use it for quick and dirty code, yet still write beautiful OO or FP code. It has what they call gradual typing in that it is dynamic like python, but you can add types to functions that help to catch lots of errors. Curtis "Ovid" Poe gave a Perl6 talk (slides and video online) that show how you can take something like the standard recursive Fibonacci sequence and restrict the input to an int that is greater than or equal to zero (it can even be more powerful than that). Despite what some might call feature overload, I've been pleasantly surprised by how easy parts are to grok and how well it fits together. Grammars as part of the language are especially cool. They've even built grammars to parse and execute Python, Lua, Perl5, and Scheme. So you can essentially use any Python library in your P6 script.
- vram22 10y agoThanks a lot for the detailed answer and resources - will check them out over time. I had bought the Camel book and had read most of it, years ago. I know Curtis a bit, nice guy. >It has what they call gradual typing in that it is dynamic like python, but you can add types to functions that help to catch lots of errors. Is this something like in Haskell, where I've read (not sure of the details) that you can define types related to the parts of the application or business domain / business logic, which then enables more error-checking by the compiler when you use those types in your code? It may be things like instead of using just an int, if it is meant to represent say height of humans, you might add constraints like height > 0 and height <= 10 feet (because you think or know that no human can be taller than that). Then the compiler will warn you or give an error if you try to assign a value to a height variable, which is outside that range. Pascal has a version of this feature oo, but maybe Haskell has more support for this stuff - not sure.
- throwaway7645 10y agoNever got too far into Haskell despite reading up on it several times and writing a little code, but adding constraints does sound exactly like this. One of the prototype P6 implementations was written in Haskell, so P6 stole some features. The only thing I'm not sure about is Haskell does this at compile-time and P6 does this at run-time I believe.
- vram22 10y agoGot it, thanks.
- vram22 10y agoSpeaking of Python and Perl, that reminds me - I blogged this a few days ago - just for fun: Perl-like "unless" (reverse if) feature in Python: https://jugad2.blogspot.in/2017/02/perl-like-unless-reverse-if-feature-in.html https://jugad2.blogspot.in/2017/02/perl-like-unless-reverse-...