Live data from Hacker News

Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?

news.ycombinator.com

71–80 of 163 posts

Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?

#71
post #35
post #32

Substantial 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…

I chuckled the first time I saw 'use strict'; at the top of the javascript file. Node.js seems to be morphing more and more into Perl 5 with every new release.

I still chuckle, and try to remind everyone in the room that:

1) Node did not invent concurrency, Hoare did (if a single person should ever be credited on this), others understood the concept some 20 years.

2) Node was originally based on a library by a very-controversial, still largely acclaimed Perl contributor

3) 'use strict' is indeed a Perl idea, but (to a certain extent) is the JSON format

4) The first JS repository was not npm, but JSAN, and it was started (guess) by Perl guys back in 2005 (if I remember), now long abandoned.

Basically - after teaching JS and Perl for many years (10+ Perl, 4+ JS) I can confidently say that JS has always had a thing about Perl5 while Perl5 devs knew very well how to express stuff in JS from day 1, as both languages are originally very lexical, very dynamic and lazy, etc.

In fact the languages Perl / JS / Python are quite similar by nature. So what? We don't have Python in the browser, even though transpiling would've been so straightforward.

I fail to understand how it was not so-obvious-for-everyone that devs would spare syntax for cleaner source code. Its a very broad statement, but ES*, Python and Scala - all these have very clean syntax, and are very likely here to stay (probably Go should be in this list also). In fact - universities started using Python to teach introductory classes, rather than C. Guess why - strict rules, clear syntax, easy learning curve.

The motivation for this is that DEVs get easily replaced as a resource. And that's big in terms of planning and HR. Back in the 90's, Perl5 was a definite power-horse, because no dynamic language combined different coding phenomena so well. With all due regards for all the great minds that worked on Perl6 - nowadays, there are many smart languages. And Perl needs to do more than syntax/context/name-it magic to win back confidence.

Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?

#72
post #65
post #3

Earlier quoted context omitted.

I use perl for new code all the time. It's not a trendy language, so it won't get much coverage on HN, but the language and libraries are great IMO. Also, perl 6 is effectively a completely different language from 'normal' perl (i.e. perl 5.x). The difference between the two is far far bigger than say python 2 -> 3. As a perl programmer, I see no obvious benefit from switching from perl 5 -> 6, it would be the same a…

Perl6 is not, IMHO, a completely different language and I can't understand why the Perl6 community beat this drum so hard. "use ;" "my" variables, context awareness, $@% variable identifiers, list emphasis. At the syntactic level Perl6 is very similar to Perl5. OK, it's OO under the hood, unlike Perl5. If it's a completely different language why name it Perl6?

The OO part is actually one of the tiniest of changes. You can get basically the same thing in Perl 5 by using Moose.

It has signature, and subsignature parsing, built-in concurrency, not to mention over a dozen other features that are not in Perl 5. The main reason it is called Perl 6 is how the project began. It started out as Perl 5 minus a few warts.

As someone who well versed in both, they are very similar, and very different at the same time.

I like to categorize the differences like this:

Perl 4 is to C, as Perl 5 is to C++, as Perl 6 is to Haskell,Scheme,C#,D,Go,BNF...

That is Perl 6 brings in features from many diverse programming languages, and combines them in such a way that it feels like they have always belonged together.

Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?

#73
post #29

Perhaps you should look at this two presentations first: https://media.ccc.de/v/31c3_-_6243_-_en_-_saal_1_-_201412292... https://media.ccc.de/v/32c3-7130-the_perl_jam_2

Those presentations were abhorrent and the conference should be embarrassed for giving such a buffoon the stage (twice!). He doesn't know the language and then lampoons it when he gets it wrong. Here are some rebuttals (one of which is mine) to the second talk https://gist.github.com/preaction/978ce941f05769b064f4. There are other rebuttals for the first one which can be found without too much difficulty.

Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?

#74
post #55

Biased core dev here... I've used Perl 6 for IRC bots. The ease of writing parallel code, nice OO model, multi dispatch, and subsets make it very pleasant to do them in Perl 6. Here's a bot I wrote that listens for GitHub webhooks and reports new commits and PRs: https://github.com/perl6/geth and here's another one that's just a bunch of random features: https://github.com/zoffixznet/perl6-buggable/ I also heard peop…

Do you know what algorithm grammars use under the hood? I don't see it mentioned in documentation like this: https://docs.perl6.org/language/grammars "Group of named regexes that form a formal grammar" Are Perl 6 "regexes" as powerful as a context-free grammar? I guess they use the same kind of backtracking algorithm and ad hoc recursion as Perl 5? That is, does the algorithm for regexes differ from Perl 5, or only t…

> Are Perl 6 "regexes" as powerful as a context-free grammar?

TL;DR If you can code it, you can code it using Perl 6 grammars.

Perl 6 is designed as a collection of "slangs" (short for sub-languages) that recursively embed each other. (There are about a half dozen slangs in standard Perl 6 but you can add more.)

So the full power of the "main" Perl 6 slang is available within the regex slang (and vice-versa). During execution each slang automatically tracks the interesting state of the other slangs.

So, while the compiler is free to analyze a given rule and generate a suitably optimized DFA or NFA, they are, in general, capable of turing complete power.

> I guess they use the same kind of backtracking algorithm

The main answer is No.

There are four types of "rule". Only one of these, using the `regex` declarator, backtracks in the usual regex way.

Most extant grammars contain nothing but `rule`s, `token`s, and occasionally `method`s.

The fact that the latter are just ordinary methods hints at what's going on; the "regex slang" is really just a built in recursive ascent/descent parser generator with a convenient DSL (slang) for writing grammars.

Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?

#75
post #71
post #35

Earlier quoted context omitted.

I chuckled the first time I saw 'use strict'; at the top of the javascript file. Node.js seems to be morphing more and more into Perl 5 with every new release.

I still chuckle, and try to remind everyone in the room that: 1) Node did not invent concurrency, Hoare did (if a single person should ever be credited on this), others understood the concept some 20 years. 2) Node was originally based on a library by a very-controversial, still largely acclaimed Perl contributor 3) 'use strict' is indeed a Perl idea, but (to a certain extent) is the JSON format 4) The first JS repos…

Whenever Node comes up somewhere, I wonder what happened to the original author of it, he was called Ryan, IIRC.

Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?

#76
Hi there! I used Perl5 for about 10 years. Web programming, sys admin tools, parses, so on. It's true (IMHO) that Perl5 tends to be a language "with hard to find job". So, recently I tried something new. I had some experience with Ruby/chef but I wanted something I feel more familiar in my background and I noticed a Perl6 a halve year ago, it was just around a time when first stable release appeared ( maybe 1-2 years before, but anyway ... ). Well what I can say? Perl6 is certainly proper choice for former Perl5 developers ( not only for them, but I am looking from my perspective ). Yeah there is lack of modules in comparison with CPAN but I don't treat this a big issue, all great projects started in the past with little eco system, so I guess it is only a question of nearest 5 years. Take a look at http://modules.perl6.org/ - new modules get added weekly!

Another thing - you may start a brand new code with Perl6, it is always a green field in automation / ops tasks.

Do I use a Perl6 in production? Yes I do. Recently I have updated ~ 500 servers with the help of Sparrowdo - http://sparrowdo.wordpress.com/ - a configuration management tool written on Perl6.

So for sure - Perl5 folks please look at Perl6. Other people as well :) It's neat, modern language.

Regards

Alexey

Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?

#78
I like many things about Perl 6, but I mention only the ones I used in my project. MAIN subroutine makes it very easy to create simple CLIs, multiple dispatch, gradual typing, subsets, the object system, roles, Unicode support, being multi-paradigm.

Also, Perl 6 makes it easy to write short and concise code that will also be very readable.

The project I wrote is a command line tool[1] for fetching football(soccer) data, which uses a module[2] I wrote for getting the data from http://football-data.org

[1] https://gitlab.com/CIAvash/App-Football

[2] https://gitlab.com/CIAvash/WebService-FootballData

Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?

#79
post #11

I followed the development of perl 6 for a bit. I was quite impressed for a while, as Larry Wall disolved most of the warts, corner cases, and ad-hocisms of perl 5 into a language which was cleaner and more abstract. Then he used the cognitive space thus provided to load up the langauge with as many features as he could pack in, and I gave up on it.

>I followed the development of perl 6 for a bit. To put it mildly.

I petitioned Ars Technica 3 times to add Perl 6 to their Top 10 Vaporware list. I think, being a Perl shop at the time, they allowed personal bias to drive their ruling.

Re: Ask HN: Perl 6: Do you use it, how do you like it, what do you do with it?

#80

I worked on Perl 5 projects professionally for about 15 years, then switched to a new job that uses Node.js. I enjoyed coding in Perl 5, but it was hard to find and retain Perl 5 developers. Our later hires preferred to code in C#, Python and Ruby-- This was before Node.js took off. Looking at language trajectories on http://modulecounts.com/ The momentum that JavaScript has compared to Perl is amazing-- CPAN growth…

How much do you attribute the growth disparity to CPAN literally already having solved most problems vs. the Node community naturally having gaps because they haven't been around as long?
Post reply on HN