Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nothing really surprising here.

Regexes are the only way to do more advanced text manipulation in JavaScript, so they're being used far more than in other languages. Lua is similar here, having only a couple most basic string operations built-in and relying on regexes for anything even slightly more advanced. This makes it natural for these languages' implementations to focus heavily on optimizing regexes.

Also, regexes are easily JITable and of course implementations having a JIT are going to be much more performant than normal interpreters. This explains the results of your [0] - I didn't check, but I suppose it's a vanilla Lua interpreter and not LuaJIT.



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

Search: