-
-
Notifications
You must be signed in to change notification settings - Fork 150
Architecture of Various Interpreters
Ilya Sher edited this page Sep 18, 2019
·
3 revisions
-
Bash and all shells I've looked at: lexer/parser -> AST -> tree interpreter.
- (but note that they do dynamic parsing too)
-
CPython: parser -> parse tree -> "transformer" -> AST -> compiler -> graph of bytecode objects -> bytecode assembler ->
.pyc
files -> bytecode interpreter. -
Lua: No tree representation! It constructs bytecode for a register machine while parsing. I believe this style came from Pascal compilers.
-
R: It was a tree interpreter, but they added bytecode around 2011.
-
Ruby: I believe the same is true; it was a tree interpreter, but they added bytecode.
-
Next Generation Shell: PEG parser -> AST -> bytecode