Hacker News new | past | comments | ask | show | jobs | submit login
From Babylon to Pascal with Perl 6 (perl6.eu)
38 points by lizmat on Apr 16, 2019 | hide | past | favorite | 17 comments



I see Perl 6 trending a lot around here lately. As someone who has never touched it is there some reason for excitement around it? Or is it primarily people who already use Perl often?


Perl 6 a new Perl-ish language with grammars powerful enough to parse and run itself. You can use it to write FP or OOP or imperative or reactive code, or all of the above in the same program. Despite the sprawling feature set, there's a clearly defined specification, and it's written in the form of tests. Currently there's only one implementation that runs 6.d, but that implementation runs on MoarVM (C lang), the JVM, and (in progress) Javascript.

And of course the best thing that they fixed from Perl 5 is the community. If you have an interest in learning more about the language, come by on #perl6 on freenode and we'd be glad to help you out.


What was wrong with the perl5 community? I never really interacted with it.


One thing that I hope is a priority for "fixing" would be interaction with libraries. In 3rd year/Honours I had to code in Perl and I remember abandoning using some of them.



How would this influence popular types of one-liners?

As an example, if I run:

  perl -pi.bak -e "s/;/,/g" mycsv.csv
Would there be any difference?


I'm not sure -i has been implemented, and the regex syntax has gone through a major overhaul.

In your particular example, the global flag is now an adverb you put in front, and characters like ; now have to be backslash-escaped or quoted, ie

    s:g/\;/,/
Sadly, the Perl6 regex/grammar engine is rather slow, taking away from its potential as a 'killer feature'...


I've only dabbled with it a bit, but I think of it this way:

One could say that at its inception and heyday, Perl more or less defined what a "scripting" language could/should be, making things like string processing and list/dictionary handling very convenient, mixing multiple paradigms, and facilitating community modules. That certainly seemed to have influenced JS, Ruby, and Python (Perl's scripty siblings) but I think many people would say these are now considered better executions of those core ideas.

But are they really the apotheosis of this kind of language? How else could you grow/change a language like this in order to make it more convenient, powerful, or interesting? (Or less politely: what would make something as great as Ruby or Python look relatively blub-ish?)

I see Perl 6 as an answer to that question, perhaps in a similar way that one might say Rust answers that question for systems languages.


It's a powerful language that allows some fun syntax. I think it will make a mini-comeback when people rediscovered how much it does.

For someone who has never tried Perl I would suggest learning it and using it for scripting.


I use Perl at least once a week for regex. Occasionally I use it for extracting web pages or splitting columns or something like that. For my purposes, Perl 6 vs prior Perl does not influence functionality. If you write more complex programs I have heard/seen that there are more substantial changes.


EDIT: it does influence functionality a lot.[1] Now that I think of it I did know this but I have always used < Perl 5.

[1] https://en.wikipedia.org/wiki/Perl_6#Major_changes_from_Perl...


> 4 2^3 x 3^0 x 5^0 (1 x 3 x 1)

Should be 4 2^2 x 3^0 x 5^0 (4 x 1 x 1)


Insert grousing at the HN markup input and parser here


Wait a second! Is this really Perl 6 he's talking about??


Ugh, what a humorless bunch!


Humor was one of the things that needed breaking.


Yes.




Applications are open for YC Winter 2021

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: