microbit-foundation / dev-docs

The content of the tech.microbit.org site
https://tech.microbit.org
Other
56 stars 70 forks source link

software/micropython.md #251

Closed whaleygeek closed 3 years ago

whaleygeek commented 3 years ago

There is a technical error on this web page in the description of how MicroPython works.


The parse tree is compiled into a terse set of instructions called Python bytecode. Bytecode instructions are like CPU assembly language instructions, but they are targeted for a virtual machine, not for a real piece of computer hardware.

It is incorrect to say that a parse tree is the in-memory tokens. This is an Abstract Syntax Tree (AST). The parse tree is often implicit and represents all tokens including parenthesis and natural groupings like 'expression' and 'relational_expression'. The Abstract Syntax Tree is a real thing however, and is represented as a pruned version of the parse tree. The parse tree is the concrete syntax, and thus includes brackets and other syntactic markers and production groups, unlike the Abstract Syntax Tree, which does not.

https://en.wikipedia.org/wiki/Abstract_syntax_tree

So, just change 'parse tree' to 'abstract syntax tree' and it will correct this issue.