Centralise common backend routines and continue backend interface#808
Merged
Conversation
michalhabera
reviewed
Jan 5, 2026
Contributor
michalhabera
left a comment
There was a problem hiding this comment.
Moving the language backend independent code looks good, but I am not in favor of flattening the module structure to generator_form, etc. If this is the implementation detail, why not force user to prepare the module structure with classes then?
Co-authored-by: Michal Habera <michal.habera@gmail.com>
Contributor
Author
|
Reverted the flattening of the interface to free functions. Maintains the namespaced |
michalhabera
approved these changes
Jan 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Centralises common backend logic for reusability in different backends.
template_keys: extracts template keys, used for checking all keys matched by input dataintegral_data: computes unrolled sorted integral data of aFormIRtensor_sizes: computes the sizes of the tensors associated with the kernel invocation of a form or an expressionConsistently names the implementation files in singular (
expressions.py->expression.py, etc.)All includes in code generation now pass though the module level, i.e.
__init__.pyofC/ornumba/- no longer enforcing a given file structure to be present in the backend (that's an implementation detail). This continues the work to define the language backend interface.The only thing that needs to be addressed/improved on after this for #805 is the handling of output files, the split into declaration and implementation (or header and source) should be generalised away from the backend.