Page 1 of 1

UA Matchers, without lookahead asserts.

Posted: Mon Dec 15, 2014 11:45 am
by slawomir.pryczek
Would it be possible for you to convert the regex code used by APIs to not include "?!" (lookahead assertion), as that would allow to reimplement the API in some languages that are not using PCRE but RE2 engine (rust, golang)?

Re: UA Matchers, without lookahead asserts.

Posted: Mon Dec 15, 2014 12:53 pm
by Elliotfehr
Slawomir,

I will have to discuss with the engineering team to see the possibility of this. However, it may not be possible. Are you able to let me know which API you are currently testing?

Thank you,

Elliot

Re: UA Matchers, without lookahead asserts.

Posted: Mon Dec 15, 2014 2:50 pm
by oddbear
Hi Elliot, we're porting the PHP API to golang...

Would be much easier if we could just port the regexes 1:1

Re: UA Matchers, without lookahead asserts.

Posted: Mon Dec 15, 2014 6:28 pm
by luca.passani
Limiting the expressiveness of the WURFL API across all the major platforms to make space for ports to less known programming languages does not sound like a very wise strategy for the API future. In other words, it is unlikely that those changes will ever happen in the official WURFL API

Thanks

Re: UA Matchers, without lookahead asserts.

Posted: Tue Dec 16, 2014 2:10 pm
by slawomir.pryczek
Hey Luca,
sorry for using multiple accounts, actually i have forgotten to logout from company account. We ported that already (to golang), it was finished yesterday and passed our tests... results compared with php in single threaded benchmarks are very nice (queries are 10x faster on average). These regexes were some issue but not so severe. Why does it matter? Because of cold cache problem. We can actually aggregate queries in go... while in php it isn't possible and slow performance adds to the problem...

Actually i was hoping that over time you'll be dropping usage of these complex regexes (by not creating new ones), for the platform to be more compatible with new web languages that are gaining mass currently, and are very fast because of simplified implementation of many things...

So if you'll be forced to pick between 2 solutions when adding UA's in the future (simple regex or lookahead) pls keep in mind that simplified regexes would be probably much easier for more people to deal with ;)