A New RegExp Engine in SpiderMonkey
I wrote the JavaScript regex engine in Hermes [1], and also regress in Rust. I want to explain what&#x27;s sucky about this decision, but first some ES regexp background.<p>The regexp grammar portion of the ES spec is <i>different</i>, in that it&#x27;s not sufficient. You can implement JavaScript from the ES spec, but NOT regexp. The grammar doesn&#x27;t really make sense [2]. The Chakra team found the same thing [3].<p>I have not confirmed this but I have been told the regexp portion is tightly controlled by Google, more than most parts of the spec. When v8&#x27;s regexp implementation is found to deviate from the spec, the spec gets changed. This makes sense (why risk breaking websites), but it illustrates how little weight the regexp spec actually has.<p>With Firefox using irregexp, it further cements this unfortunate reality.<p>1: <a href="https:&#x2F;&#x2F;hermesengine.dev" rel="nofollow">https:&#x2F;&#x2F;hermesengine.dev</a><p>2: Example: the NonemptyClassRangesNoDash production may include a dash<p>3: <a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;archive&#x2F;blogs&#x2F;ie&#x2F;chakra-interoperability-means-more-than-just-standards#whats-the-real-regular-expression-grammar" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;archive&#x2F;blogs&#x2F;ie&#x2F;chakra-int...</a>