Why package is not generated in one Python module? #446
Locked
mikir
announced in
Design Notes
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For Python users, it would be much more convenient if all package symbols (constants, structures, etc...) will be generated in one module.
Currently, this is not possible because of the following problems:
Symbol dependencies
Zserio compiler allows dependencies which are defined after reference. Example:
Python does not allow such dependencies, each referenced symbol must be defined before it is used.
Cyclic imports
Zserio allows cyclic imports. Python does not support cyclic dependencies at all. However, Zserio does not allows indirection recursion. Thus when e.g.
StructureA
needs field ofStructureB
, it can never happen that alsoStructureB
will needStructureA
as a field. Putting these two things together, the approach with seperate module for each Zserio entity works even if target language does not support cyclic dependecies at all.See Also:
Beta Was this translation helpful? Give feedback.
All reactions