Search code examples
compiler-constructionprogramming-languagesinterpreter

Do interpreted languages use a symbol table at runtime?


I understand that a symbol table is used only at compile-time for semantic analysis in statically typed languages, but how are they used for interpreted languages that execute byte code? Is the symbol table ever used during runtime for interpreted languages such as Python or JavaScript?


Solution

  • Well, and identifier must be mapped to a place where the variable is stored. If it doesn't exist an entry is created. At least simple interpreters work that way.

    You could call that a symbol table, but it is dynamic and one of the byproducts of the interpretation, not a compilation process.

    More complex scripting languages like you name have to integrate this with their garbage collection.