Hacker News new | comments | show | ask | jobs | submit login

Is Perl 6 fast now?

Since H. Merijn Brandt started working on the Perl 6 version of Text::CSV, he has kept a log of how long a specific test (referred to as test-t) too to run.


Since then, Rakudo Perl 6 has become more than 100x as fast, at least for this test. And more than 250x as fast using a concurrent version of the test (which was as simple as putting a `.race` in the code).

This makes it still slower than the Perl 5 version, which uses XS (all parsing logic written in C). But the gap is closing with another round of optimizations to be merged later this week after an extensive refactor that took about 2 months. Of which you will most certainly see a report on https://6guts.wordpress.com , the blog of Jonathan Worthington.

Quoting the blog post this HN article is supposed to be about[1]:

PS: You might read this and be reasonably surprised that Rakudo Perl 6 is not, after all this, very fast yet. I have a - not entirely serious - explanation for that:

All problems in computer science can be solved with a layer of indirection. Many layers of indirection make programs slow. Perl 6 solves many computer science problems for you ;-)

In the future, we'll continue to solve those problems, just faster.

[1] http://brrt-to-the-future.blogspot.com/2018/07/perl-6-on-moa...

It really depends. The question really should be, "Is Perl 6 fast enough?" For my purposes, the answer is almost always yes. I can imagine some applications where the answer would be no, but then I would probably be looking at C/C++ for a solution, anyway. Language bench-racing has really begun to look counter-productive to me.

Someone once posted code that they had written in both Perl 6 and C/C++. The Perl 6 code was shorter, arguably easier to understand, and they said it was also faster for their data.

My guess would be that the strings had to be copied more often in the C/C++ code.

MoarVM has recently gotten the ability to write optimization plugins in higher level code. This should make it easier to create certain optimizations as they will have access to the syntax tree.

So it may be that the rate at which it gets faster has gotten faster.

Applications are open for YC Winter 2019

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