An intermediate language for statically typed array-oriented DSLs