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

Pretty amazing work to put this all together in perl! My only worry is commandment #45 as a lot of the perl I've seen is mostly regular expressions.

Thou Shalt Not: 45. Use Regular Expressions, Smart Match, q Quoting Mechanisms, Unicode/UTF-8, Or String Interpolation




That sounds like stuff that isn't implemented yet, not impediments to speed. Quoting and interpolation are mostly compile-time issues. Smart matching is on its way out anyway...

And the performance of Perl's regular expressions is rarely something that slows down actual code. Using it in the first place (instead of more specific parsing) might be an item, though...


Yeah, what is Perl - Regex? Couldn't they manage to compile regex to pcre?


Yes. perl5 has the possibility to switch to better and faster regex engines, like russ cox' RE2 or pcre with jit support. It's just not done in rperl.

In my perl variant I'm planning to improve the inefficient and overly simple and troublesome Spencer two-pass compiler with backtracking support to use the faster Thompson NFA without backtracking (RE2), and/or switch to pcrejit when no pcre-incompatible ops are used, like unicode character classes. The first pass which calculates the space can be easily used for that.

But a better regex compiler should get away with one-pass and extend the ops dynamically.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: