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

Compiler objects #3

Open
no-defun-allowed opened this issue Apr 8, 2021 · 1 comment
Open

Compiler objects #3

no-defun-allowed opened this issue Apr 8, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@no-defun-allowed
Copy link
Collaborator

no-defun-allowed commented Apr 8, 2021

If we proceed with allowing more client specialization of code generated by one-more-re-nightmare, it would be necessary to introduce a representation for information for the compiler, and separate caches for code compiled with different specializations. Following the "backend" object Petalisp uses, we could introduce an object which stores this information, and classes which can be specialized on to introduce changes to the compiler.

It may also be useful to allow for different policies for holding onto cached code; a LRU cache may be more appropriate if many regular expressions are used, or a concurrent hash table if contention* over the cache table is somehow a problem.

The high level interface could be reused by providing a dynamic variable, say *compiler* which would default to a compiler object with the standard optimisations and hash table. The variable could be re-bound with another compiler object, and the provided functions would work with that compiler object.

*Our current cache is currently not thread-safe. Well, that was stupid not to do.

@no-defun-allowed no-defun-allowed added the enhancement New feature or request label Apr 8, 2021
@no-defun-allowed
Copy link
Collaborator Author

Instead of one compiler object, we may have a "backend" object, which produces compiler component objects (such as prefix generation strategy, array access generation, etc) based on information about the regular expression to compile.

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

No branches or pull requests

1 participant