From b3b7b29045bfcedbda65a2e591df6422a60c2495 Mon Sep 17 00:00:00 2001 From: nocturn9x Date: Tue, 28 Sep 2021 18:12:35 +0200 Subject: [PATCH] Updated readme --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 350e030..d3e577f 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,11 @@ The compilation toolchain has been designed as follows: - After the AST has been built, it goes trough the optimizer. As the name suggests, this step aims to perform a few optimizations, namely: - constant folding (meaning 1 + 2 will be replaced with 3 instead of producing 2 constant opcodes and 1 addition opcode) - - Name resolution checks. This is possible because NimVM's syntax only allows for variables to be defined in a way that - is statically inferrable, so "name error" exceptions can be caught before any code is ran or even compiled. This means - that NimVM, like many others, enforces block scoping + - name resolution checks. This is possible because NimVM's syntax only allows for named to be defined in a way that + is statically inferrable (sorta), so (most) "name error" exceptions can be caught before any code is ran or even compiled. + Note that this only applies to names defined as static (which means all of them unless they are explicitly marked as `dynamic`). + This is a tradeoff to avoid enforcing block scoping while still retaining the performance of static name resolution (yes, even + globally) most of the time - throw warnings for things like unreachable code after return statements (optional). The optimization step is entirely optional and enabled by default