Currently, the DSDL specification does not dedicate much attention to the default value initialization of DSDL fields. I suggest amending it by Cyphal v1.1 as follows:
-
Define and require zero-initialization of primitive-typed DSDL fields.
-
Extend the DSDL syntax to allow overriding the default initializer for primitive-typed fields as follows:
float32 PI = 3.14 # A regular constant.
float32 default_zero # A regular field, the default initializer is zero.
float32 default_custom <- 42.0 # A regular field with a custom non-zero default initializer.
float32 default_2pi <- PI * 2 # Ditto, with an expression.
float32[3] array # Default initializers for non-primitive types may be introduced later.