Closed Spydr06 closed 2 years ago
Done and merged into main
Arrays now include their size making it possible to pass arrays of different sizes to functions and variables (VLAs, internally pointer to the array).
The len
operator now returns the first 8 bytes of the array.
Currently, Arrays in CSpydr get treated exactly like their C counterparts. Meaning only the data gets stored in memory.
Changes:
Arrays will be laid out in memory like this:
Change to the index operator
x[]
Add a simple offset of 8 bytes when an array type is detected. Interaction with pointers will not be changed to keep compatibility with C.Change of the
len
keyword: Thelen
keyword will now be able to get the first 8 bytes - the length of the array directly and is no longer bound to constant arraysDevelopment is going to happen in the new-arrays