Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functorize over the regex backend #1

Open
Drup opened this issue Aug 12, 2016 · 4 comments
Open

Functorize over the regex backend #1

Drup opened this issue Aug 12, 2016 · 4 comments

Comments

@Drup
Copy link
Owner

Drup commented Aug 12, 2016

This would be nice. In particular, it may allow to implement the whole thing on top of native javascript regex (which are probably faster when used in javascript).

@Drup
Copy link
Owner Author

Drup commented Aug 4, 2018

After #18, we are now in a much better position to do this, since we only use "vanilla" regular expression operators.

@Drup
Copy link
Owner Author

Drup commented Aug 5, 2018

So, I've made two early prototype to investigate this a bit:

  • https://github.com/Drup/tyre/compare/functorized Uses a functor to abstract over the backend. The issue with that version is typed regex written with one backend will be incompatible with any other backend. The upside is that the API is unchanged once the functor is applied.

  • https://github.com/Drup/tyre/compare/poly Add a type parameter to the Tyre.t type depending on the backend. This means there might be a chance to write backend-agnostic regexs, although that would require more work and I'm not sure the final result will be so nice. The downside is that we would require new functions for the compilation aspects, and the API will require some changes. It also seems a bit cumbersome.

@Drup
Copy link
Owner Author

Drup commented Aug 5, 2018

If anyone is interested and find one version or the other better, I'm open to suggestions.

@Drup
Copy link
Owner Author

Drup commented Aug 17, 2018

False alert, marks are still needed, sorry everyone. 📦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant