Massive refactoring to support better type systems. Read on for more. The previous compiler had a simple pipeline, best outlined as: (1) Parsing and name binding -> AST (2) Storage allocation -> AST (3) Semantic Analysis (SemA) -> AST (4) Bytecode Compilation (BC) -> Code This pipeline, unfortunately, had two problems. First, name binding cannot be performed in one pass if we wish to have multi-file support in the form of modules. Name binding must be two-pass. Second, because SemA was only capable of annotating AST nodes with a single type, most coercion work had to be duplicated in the BC phase, as coercion was not explicit in the SemA output. This made introducing new type rules extremely difficult, and all but precluded concepts like operator overloading (or overloading at all). This patch rewrites most of Keima's backend. Of interest are the following changes: (1) CompileContext has been refactored around future multi-file support. (2) Parsing no longer performs any name binding. (3) The grammar for type-and-name has been changed from: (Label | Identifier)? Identifier to: Type? Identifier where: Type ::= OldType | NewType OldType ::= Label NewType ::= Identifier (. NewType)* Although we do not implement the full production for Type yet, this distinction is important. A type identifier is now affixed to the AST as an Expression (right now, always a NameProxy), so it can fully participate in name binding. (4) Immediately after parsing, the AST goes through a NamePopulation phase. This phase creates Scope objects for every scope which declares a name, and if those names are declaring types or functions, a Symbol is created and entered into the scope. Symbols entirely replace the old BoundName classes. (5) After NamePopulation comes NameBinding. This phase performs three steps: (a) Links Scope objects together, to form a tree. (b) Binds any free name to an existing name in the scope chain. (c) Creates and registers any Symbols for names which have not yet been added to the scope (for example, local variables). In accordance, all "allocation" and "binding" concepts have been removed from Scopes, which are now lightweight container classes. (6) SemA now generates bytecode for each statement in the AST. Expression compilation is performed via a separate mechanism called HIR (High-level Intermediate Representation). To analyze an expression, SemA will walk the AST, and produce a HIR object for each node. HIR is typed, and SemA may insert coercion nodes, or even expand an AST node into multiple HIR nodes. The result of evaluating an expression in SemA is therefore the the root of a HIR tree, which SemA then sends to the HIRTranslator, which performs bytecode generation. As before, SemA still performs full semantic analysis. However, not it also produces each function's bytecode. This split allows us to decompose potentially complex semantics into a more fine-grained, AST-like structure, which can have very simple code-generation logic. For example, (1.0 + 5) might look like: HAdd(HFloat(1.0), HConvert(HInteger(5), )) As part of this decomposition, many opcodes have been removed. Rather than using typed jumps, we now expand jumps into longer tests. For example: jge.f