So something like hello = 5 gets packed into 2 variable blocks - hello and 5. It's only when you get to some special cases (4 or less chars, plus a <16 bit integer) that it packs the two together. Either way, you do have some unique area of memory you can point to that corresponds to a specific variable.
I think we might be getting sidetracked from APA102s though. The single-char cache might work, but I'm wary that there may be some nasty edge cases - it'd be a case of trying it when I have some time, and seeing if it broke any of the language tests.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
It'd be worth looking at http://www.espruino.com/Performance and http://www.espruino.com/Internals... Espruino has the concept of a 'name' and an actual value.
So something like
hello = 5
gets packed into 2 variable blocks -hello
and5
. It's only when you get to some special cases (4 or less chars, plus a <16 bit integer) that it packs the two together. Either way, you do have some unique area of memory you can point to that corresponds to a specific variable.I think we might be getting sidetracked from APA102s though. The single-char cache might work, but I'm wary that there may be some nasty edge cases - it'd be a case of trying it when I have some time, and seeing if it broke any of the language tests.