How does the interpreter switch the scope?

I ask this because I'm relatively new to interpreter development, and I wanted to know some basic concepts before inventing the wheel.

I thought about the values โ€‹โ€‹of all the variables stored in the array, which does the current scope, when I enter the function that the array changes, and the original array is put on some kind of stack. When you exit the function, the top element of the "scope" stack appears again and is used.

  • Is this basically correct?
  • Are arrays changing (which means moving a large amount of data) is not very slow and, therefore, are not used by modern translators?
+3
source share
2

? . , , , .

, . , .

+2

Python C, . , , , .

, . . , .

0

Source: https://habr.com/ru/post/1747038/


All Articles