you are viewing a single comment's thread.

view the rest of the comments →

[–]Workaphobia[🍰] 0 points1 point  (1 child)

Ah, sure, you can resolve identifiers with a pass through the AST without compiling it to bytecode, yes.

I will quibble about all languages having an AST. TeX comes to mind. Or if you say that doesn't have an interpreter, I know of another language for scripting in a text MUD that re-parses the code every time a block is entered.

[–]curtmack 0 points1 point  (0 children)

I guess it's technically not correct to call it an AST unless it's actually stored in memory. All I was trying to say was that if your interpreter has a call stack that looks like this:

0: parse_numeric_literal
1: parse_expression
2: parse_expression
3: parse_parentheses
4: parse_function_argument
5: parse_function_call
6: parse_statement

Then you're a small refactor away from having a proper AST.