Currently, the compiler allocates every variable present in the scope.
Which means if you only use a small quantity of variables in the beginning and more later it will take up a lot more code size.
What I was thinking is that what if the compiler allocated enough and then when more variables appears it shifts the temp variables to the right
So then when a is declared only that is allocated. Every other variable technically exists in temp until it's declared.
This might also fix #35 since we could check if it is already declared.
The code below takes 276 bytes.
bf code for
a
andb
init:The code below takes 548 bytes.
bf code for
a
andb
init:Currently, the compiler allocates every variable present in the scope. Which means if you only use a small quantity of variables in the beginning and more later it will take up a lot more code size.
What I was thinking is that what if the compiler allocated enough and then when more variables appears it shifts the temp variables to the right So then when
a
is declared only that is allocated. Every other variable technically exists in temp until it's declared.This might also fix #35 since we could check if it is already declared.