r/Basic • u/CharlieJV13 • Feb 15 '23
BAM Update: For one dimension arrays: 🆕 Array initialisation 🆕 Constant Arrays
https://basicanywheremachine-news.blogspot.com/2023/02/for-one-dimension-arrays-array.html
3
Upvotes
View all comments
Show parent comment
1
u/zxdunny Feb 15 '23
It would be interesting to see. As I said, the value of consts in SpecBAS are not so much that they can't change - it's that they don't have to be looked up at runtime. SpecBAS has a pre-runtime system that injects const variable values into the bytecode when run, and not having to compare several hundred strings to find the variable in the var space is a huge saving.
That said, I have added var caching so that lookup is only ever done once, but consts are still very much faster as they're a single push rather than an offset/read/push which a variable is in the very best case.