rebcabin / masr

Meta ASR: replacement for aging ASDL
MIT License
4 stars 0 forks source link

Scalar detection #53

Open rebcabin opened 1 year ago

rebcabin commented 1 year ago

Some compile-time checks can tell whether a numerical term like Integer or Character is a scalar. Scalar types are helpful for checking array indices, for example. Each index should be an integer scalar. Character scalars are useful for checking Strings that should contain a single character.

Other terms like Var often cannot be checked at compile time for a scalar property, but sometimes they can by a propagation of the scalar property from a constant into the variable.

We should debate whether such a level of checking is worth the work needed to implement it.