Earlier quoted context omitted.
IIRC, Perl 6 grammars are parsing expression grammars (PEGs). I don't know if these are compiled down to recursive descent or packrat parsers; my guess would be the latter (since that's typical for PEGs).
The sibling post says that they have both || and |. The || operator sounds like ordered choice from PEGs, and | sounds like a non-deterministic choice from regexes and CFGs. So it's basically a mix of paradigms, which muddies the waters in terms of what computational complexity guarantees you can get. Pure regular expressions can be matched in linear time; CFGs in cubic time and some subsets in linear time; packrat p…
Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?
141–150 of 163 posts
Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?
#142Substantial amount of Perl6 goodness is already baked one way or another in ES6/7, Python 3.x, Scala and even the modern C# and C++14/17. Speaking of stuff like concurrency, C3 resolution, object proxies (a.k.a AUTOLOAD), introspection/reflection, promises, reasonable regex engine, etc. As far as speed is concerned - with the modern approach to concurrent programming, it does not really make a difference which of the…
"Perl devs are probably 2x the price of a JS guy..." Funny that here in France it is quite the contrary which leads me and others Perl dev friends accepting JS work as Perl5 and even more Perl6 work are harder and harder to find.
Unfortunately (as I happen to be a relatively big fan of Perl5) the market for even "core" Perl developers (e.g. a core perl/module/framework developer with name recognition and solid track record) is less than half the going rate of the equivalent in Node.js for example. Perl unfortunately (as a hiring manager) seems very stratisfied too - there is a whole lot of exceptional talent, and a whole lot of horrible talent - and not a lot in the middle.
I don't know if there is really a market for "below average" Perl programmers these days like there is for JS or PHP - so entry level and other code janitor positions likely do pay more simply due to there being a lack of junior devs learning Perl these days. Those left taking those lower paying Perl jobs are likely not exactly the team of the Perl crop, much less programming crop.
That is the harsh reality of being a Perl shop these days, for better or worse. However the language is much stronger and much more modern than most on HN give it credit for. Properly written Modern Perl in 2017 is much different than the Perl you wrote as a 17 year old making $300 on his first CGI app. It may however be a case of too little too late.
Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?
#143Earlier quoted context omitted.
The sibling post says that they have both || and |. The || operator sounds like ordered choice from PEGs, and | sounds like a non-deterministic choice from regexes and CFGs. So it's basically a mix of paradigms, which muddies the waters in terms of what computational complexity guarantees you can get. Pure regular expressions can be matched in linear time; CFGs in cubic time and some subsets in linear time; packrat p…
Aside from perhaps protecting against adversarial input, the general philosophy of Perl has always been for programmers to not need to worry themselves about underlying implementation details. The exact algorithms (and with that the exact computational complexity bounds) might very well be implementation dependent.
I'm not saying nobody wants Perl to work like that... but I am saying I wouldn't use such a tool. It's not right for the problems I need to solve.
I also think it's good if programming languages use algorithms with well-known behavior, rather than a mish-mash of heuristics. Heuristics are OK if there is nothing better known, but these problems have been studied.
Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?
#144Substantial amount of Perl6 goodness is already baked one way or another in ES6/7, Python 3.x, Scala and even the modern C# and C++14/17. Speaking of stuff like concurrency, C3 resolution, object proxies (a.k.a AUTOLOAD), introspection/reflection, promises, reasonable regex engine, etc. As far as speed is concerned - with the modern approach to concurrent programming, it does not really make a difference which of the…
Hang on. Python 3.x is an interpreter with a GIL. So, strike one lang from your list.
> C3 resolution
Perl 6 uses C3 by default for its own default object model but it's carefully designed to also interop with languages whose MRO is NOT C3.
That strikes out another couple of langs on your list (unless you don't care about nice lang interop).
> reasonable regex engine
Perl 6 parses itself with its rules engine. Try that with a reasonable regex engine. :)
Just as significant, most "reasonable regex engines" are tuned for dealing with codepoints, not characters[1]. In 2017, that's looking increasingly unreasonable.
> I'll need a very long list of assurances to convince any client/manager/colleague to take this road.
I think it'll be another few years before the list can get long enough for your situation. Maybe we'll see you further down the road?
Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?
#145Earlier quoted context omitted.
Aside from perhaps protecting against adversarial input, the general philosophy of Perl has always been for programmers to not need to worry themselves about underlying implementation details. The exact algorithms (and with that the exact computational complexity bounds) might very well be implementation dependent.
Right, but the point is that you don't need to worry until you do. See the post I linked. I'm not saying nobody wants Perl to work like that... but I am saying I wouldn't use such a tool. It's not right for the problems I need to solve. I also think it's good if programming languages use algorithms with well-known behavior, rather than a mish-mash of heuristics. Heuristics are OK if there is nothing better known, but…
Basically: Perl 6 tokens and rules imply :ratchet, which means no backtracking. You can use raw regexes if for some reason you do need backtracking, but otherwise it looks like a Perl 6 grammar is backtracking-free (and grammars in the real world hopefully use tokens/rules exclusively).
So it might actually be at least tolerable for the problems you need to solve (though it's hard for me to say without knowing the problems in the first place (: ). The main remaining question is the exact algorithm in use; I'd be very surprised if Perl 6 grammars didn't compile down to at least some variation on packrat parsers, which would mean linear complexity, but this is probably - again - implementation-dependent in the "we don't care what you do so long as it passes the Perl 6 test suite" sense. I've yet to find a definitive answer by spelunking through Rakudo's code, but it's reassuring that even Rakudo's grammar for Perl 6 itself seems to be devoid of backtracking (meaning that it's clearly possible to do without it; there are quite a few generic subs/methods in there, though, which could prove me wrong here).
Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?
#146Substantial amount of Perl6 goodness is already baked one way or another in ES6/7, Python 3.x, Scala and even the modern C# and C++14/17. Speaking of stuff like concurrency, C3 resolution, object proxies (a.k.a AUTOLOAD), introspection/reflection, promises, reasonable regex engine, etc. As far as speed is concerned - with the modern approach to concurrent programming, it does not really make a difference which of the…
> Speaking of stuff like concurrency Hang on. Python 3.x is an interpreter with a GIL. So, strike one lang from your list. > C3 resolution Perl 6 uses C3 by default for its own default object model but it's carefully designed to also interop with languages whose MRO is NOT C3. That strikes out another couple of langs on your list (unless you don't care about nice lang interop). > reasonable regex engine Perl 6 parses…
Speaking of C3 - Python is C3 by default, and while others are not, JS guys figured mixins, which give pretty much the same expression of "horizontal-composition". Besides, all dev moves towards functional programming, and people care less about MRO's as functional paradigms replace some complex OO paradigms.
Reasonable REGEXP engine means, that every sane language out there has some level of Perl5 (or PCRE) support. That is reasonable, as long as you don't get to parse mini-langs with grammers everyday. Don't get me wrong - I'm huge fan of Perl6 BNF-like notation for grammars, but see - grammars, FSMs, regexpes, so forth... these are different names/views/uses for the same thing. Most important is to understand the tools in a toolbox, not just to be happy about how shiny a particular screwdriver is.
I'm prepared to not take offense by your last comment. Its been days and I don't see a single comment of s.o. using Perl6 for enterprise stuff.
And, please, don't give me the Booking.com example, as its a bastion of Perl devs, that was started as Perl5 one, when Perl5 was big in a very different sense that Perl6 is today.
UPDATEL Just for the record - I've been waiting/following Perl6 news for ages, shaked Larry's hand at FOSDEM when he announced it, and still fail to find a reason to move to language with no CPAN, no BOOKS, with a very complex and comprehensive syntax and (as many pointed) no big enterprise to back its adoption...
Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?
#147I pulled Perl6 in after seeing some of what it was capable of last year. Generally I like tools that make hard things easier, and easy things trivial. I don't like tools that require huge amounts of boilerplate code to even start using them productively.
Perl6 is definitely in the category of making hard things easier. It is not Perl5, and doesn't pretend to be. Perl5 is immensely powerful on its own, definitely one of my go-to tools.
Perl6 brings in many of the things that I've been using in other languages for a while, with some aspect of "perl-ness" about it, which, to me, makes it more comfortable. Its ability to connect with/call anything positively blows me away. Perl5 has Platypus::FFI which can do some of this, but Perl6 is a compiled language (to an underlying VM). This has been one of my major concerns with P5 for a while (and still a concern in Python and others ... yeah, I know of PyPy, but I want a compiler built into Python 3.x).
Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?
#148Earlier quoted context omitted.
> Speaking of stuff like concurrency Hang on. Python 3.x is an interpreter with a GIL. So, strike one lang from your list. > C3 resolution Perl 6 uses C3 by default for its own default object model but it's carefully designed to also interop with languages whose MRO is NOT C3. That strikes out another couple of langs on your list (unless you don't care about nice lang interop). > reasonable regex engine Perl 6 parses…
I fail to see how the GIL stops you from creating concurrent code. JS i spretty much the same as Python when it comes to one-thread-per-process limitation. But concurrency is not about multi-threading, it is a different approach to multiprocessing. Basically Python's Twisted, and JS's Node expose similar concepts, as do Coro, IO::Async, etc. It's about coroutines and cooperative mutiltasking, so GIL is not an obstacl…
The good news for Perl 6 is that books are incoming. O'Reilly has taken on both Learning Perl 6 (by the formidable teacher brian d foy) for a summer 2017 release, and Think Perl 6 (a translation of Think Python by Laurent Rosenfeld and Allen B. Downey; unedited draft available now). Moritz Lenz is developing his manuscript of Perl 6 by Example publicly on his blog (perlgeek.de), and Ken Youens-Clark has released an e-book on doing metagenomics in Perl 6, which includes a substantial Perl 6 tutorial.
As to CPAN, with Inline::Perl5 the entire Perl 5 CPAN is available to Perl 6 -- and if you call now, we'll throw in Inline::Python for no additional cost!
Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?
#149Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?
#150Earlier quoted context omitted.
> Speaking of stuff like concurrency Hang on. Python 3.x is an interpreter with a GIL. So, strike one lang from your list. > C3 resolution Perl 6 uses C3 by default for its own default object model but it's carefully designed to also interop with languages whose MRO is NOT C3. That strikes out another couple of langs on your list (unless you don't care about nice lang interop). > reasonable regex engine Perl 6 parses…
I fail to see how the GIL stops you from creating concurrent code. JS i spretty much the same as Python when it comes to one-thread-per-process limitation. But concurrency is not about multi-threading, it is a different approach to multiprocessing. Basically Python's Twisted, and JS's Node expose similar concepts, as do Coro, IO::Async, etc. It's about coroutines and cooperative mutiltasking, so GIL is not an obstacl…
I misread what you wrote. My apologies.
> concurrency is ... not about multi-threading
Agreed.
(Fwiw, I think part of what threw me is that almost all proglangs can do some concurrency -- folk have been forking with Perl for nearly 30 years -- but that reminds me of the notion that most proglangs are turing equivalent.)
> all dev moves towards functional programming, and people care less about MRO's as functional paradigms replace some complex OO paradigms.
Agreed.
> Reasonable REGEXP engine means ... PCRE
OK.
> grammars, FSMs, regexpes, so forth... these are different names/views/uses for the same thing.
(Agreed in a sense analogous to forking and SIMD being different names/views/uses of concurrency/parallelism/async.)
> Most important is to understand the tools in a toolbox, not just to be happy about how shiny a particular screwdriver is.
Agreed.
> I'm prepared to not take offense by your last comment. Its been days and I don't see a single comment of s.o. using Perl6 for enterprise stuff.
Apologies for the confusion but please note that I simply agreed with you and closed with a hopeful parting:
>>> I'll need a very long list of assurances to convince any client/manager/colleague to take this road.
>> I think it'll be another few years before the list can get long enough for your situation. Maybe we'll see you further down the road?
> Booking.com ... was started as Perl5 one, when Perl5 was big in a very different sense that Perl6 is today.
Agreed.
> still fail to find a reason to move to language with no CPAN
I think "no CPAN" doesn't do justice to where things are at.
1. In "IRC::Client: Perl 6 Multi-Server IRC (or Awesome Async Interfaces with Perl 6)" the author shows this code:
use IRC::Client;
use Mojo::UserAgent:from;
class Bash {
...
has $!ua = Mojo::UserAgent.new;
...
method !fetch-quotes {
$cache.send:
$_ for $!ua
.get($BASH_URL)
.res
.dom
.find('.qt')
.each».all_text
.lines
.join: ' ';
}
}
Are you not willing to count this sort of use of CPAN's Perl 5 Mojo::UserAgent as part of Perl 6's virtual CPAN as it were?2. Yesterdays blog post about the Perl Toolchain Summit[1] includes this:
> there are people looking to leverage Perl 5 and CPAN in Perl 6, which is why we also invite Perl 6 toolchain developers
I don't think it'll be helpful to get into details in this comment, but from my vantage point the Perl community is not remotely as fractured as some folk seem to think. Perl 5 and Perl 6 are two very distinct and individually great languages that have been moving towards working with each other since the 2012 Perl Reunification Summit. (It's just gonna take time to make sure it's done in such a way that the language combination is worth more than the sum of its parts.)
> no BOOKS
One just came out and two O'Reilly titles are due this year, 'Think Perl 6' due in a couple months and bdfoy's 'Learning Perl 6' driven by his kickstarter campaign which raised $40K. Others are in progress too.
> with a very complex and comprehensive syntax
Well, that's a thing.
While I had a great time with Perl in the 90s, I have long struggled a bit, and sometimes more than a bit, with Perl 5 when going beyond real basics. It seemed to me to have a very complex and comprehensive syntax overall even after I'd begun reaching up to the 3rd and 4th levels of Perl mastery.
Perl 6 seems sooooo simple in comparison!
> and (as many pointed) no big enterprise to back its adoption...
Yes.
One bit of good news is that this hasn't and won't stop the evolution and maturation of Perl 6.
Another is that the project's improvement is grounded in its test suite. This provides the interesting possibility of corporations funding development and smoking of particular tests that matter to them. (Do you know if that is happening in Perl 5 space, Python, etc.?)
[1] http://blogs.perl.org/users/book/2017/02/about-the-perl-tool...
[2] http://perl6.party/post/IRC-Client-Perl-6-Multi-Server-IRC-M...