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
2
u/CharlieJV13 Feb 15 '23
I find readability of initialisation for a small one-dimensional array, the format is pretty good. I'm just not picturing the readability of that syntax applied to a large two-dimensional array. I'll have to eventually look at examples and see what I think.
Constants versus variables in javascript, this article might be useful: https://medium.com/coding-at-dawn/are-let-and-const-faster-than-var-in-javascript-2d0b7f22a66
A search of the we seems to give a good number of hits, good or not: https://www.google.com/search?q=javascript+performance+constants+variables&rlz=1CATRYO_enCA1021CA1021&oq=javascript+performance+constants+variables&aqs=chrome..69i57j33i160l2j33i22i29i30i625.10153j0j7&sourceid=chrome&ie=UTF-8
But none of that would matter much. BASIC variables, arrays, and constants: none of them in BAM are translated into 1:1 javascript equivalents.
All variables, arrays, and constants are managed in a gigantic javascript memory structure, and each reference with an identifier gets translated into something that gets the related value from that memory structure.
I've been studying and altering wwwBASIC for the last 14 months, and I am nowhere near exactly figuring out how that side of things really works.