dimitriv / Ziria

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

Consistent truncating down-casts #92

Open dimitriv opened 9 years ago

dimitriv commented 9 years ago

Currently the code generator (CgExpr.hs) downcasts integers as C would, but downcasts complex numbers with truncation (using functions from numerics.c). At the same time the static evaluator (Interpreter.hs) downcasts everything using C-style casts. We should instead be using truncating downcasts consistently everywhere (according to @bradunov) and perhaps have a flag for instead using C-style downcasts.