dimitriv / Ziria

A domain-specific-language and compiler for low-level bitstream processing.
92 stars 18 forks source link

Variable and array initialization #79

Open bradunov opened 9 years ago

bradunov commented 9 years ago

We often have nasty bugs that are caused by uninitialized variables. For example the same code that passes a unit test fails in a testbed run because the default memory layout is different. The best solution would be to do static checks. But this is sometimes difficult (e.g. zero_complex16 is an external C function that zeros a complex array but Ziria knows nothing about its behaviour).

A simple (and orthogonal) solution is to automatically initialize all variables and arrays that have standard types to the corresponding default values (zeros). This way even if there is a bug, it will be consistently observed in different execution environments.