I think something that would really enhance the Teal experience would be to have an extra type "stdarray" that finally starts indexing at 0 like every other language out there. Normal arrays would stay the way they always have been while one would be able to use specifically declared stdarrays the way they are used to it from other languages.
A stdarray would be stored as an array, but an indexing call on a stdarray is always modified to be +1. Example:
local fooarray: {number} = {3, 4, 5, 6}
local bararray: stdarray{number} = {7, 8, 9, 10}
print(fooarray[1]) -- prints "3", just as one would expect
print(bararray[1]) -- internally converts the call to print(bararray[2]) and thus outputs "8"
When transpiling .tl->.lua, the stdarrays themselves stay the same, only their indexing calls have to be increased by 1.
I think something that would really enhance the Teal experience would be to have an extra type "stdarray" that finally starts indexing at 0 like every other language out there. Normal arrays would stay the way they always have been while one would be able to use specifically declared stdarrays the way they are used to it from other languages. A stdarray would be stored as an array, but an indexing call on a stdarray is always modified to be +1. Example:
When transpiling .tl->.lua, the stdarrays themselves stay the same, only their indexing calls have to be increased by 1.