diff --git a/.vitepress/config/en.ts b/.vitepress/config/en.ts index 2be6fbea0..99280c83e 100644 --- a/.vitepress/config/en.ts +++ b/.vitepress/config/en.ts @@ -115,6 +115,7 @@ export const enConfig = defineLocaleConfig("root", { ], }, { text: "Performance", link: "/docs/learn/performance" }, + { text: "Terminology", link: "/docs/learn/terminology" }, { text: "References", link: "/docs/learn/references" }, ], "/docs/contribute/": [ diff --git a/src/docs/learn/terminology.md b/src/docs/learn/terminology.md new file mode 100644 index 000000000..c82518946 --- /dev/null +++ b/src/docs/learn/terminology.md @@ -0,0 +1,36 @@ +--- +title: Terminology +outline: deep +--- + +## Binding + +A value being assigned/bound within a scope. + +## Binding type + +The type of the binding: imported value, assigned value (let/const/var), exported value, func/class declaration, func/method arguments, etc. + +## Scope + +A block in which bindings can exist. A block is any code surrounded with {}, such as classes, functions, methods, callbacks, if/else, etc. Scopes have a hierarchy, with parents having children (not always), and children belonging to a parent. Bindings in a child shadow those in a parent if they have the same name. + +## Scope flags + +Metadata about the current scope (not inherited hierarchy scope): function, constructor, top-level (program), etc. + +## Symbol + +A binding wrapper with references to each usage/call site of the bound variable within the current source text. A symbol is assigned an ID in the order they are scanned, and reach reference points to the symbol by that ID. + +## Symbol flags + +Metadata about the symbol/binding. + +## Reference + +A symbol reference is the usage of a symbol (and in turn a binding), and is assigned an ID in the order they are scanned. Each reference is flagged as read, write, or both. + +## Span + +The start/end offset of the node within the source text.