@@ -24,10 +24,9 @@ useful. The implementation plan looks a little like this:
2424 * Stage structure
2525* Build assembly language on top of that
2626 * assembler and disassembler
27- * Build control-flow graph IR
28- * Build tree-like POST (optional, POST may only be CFG level)
27+ * Add control-flow graph primitives (basic blocks linked by conditionals)
28+ * Build tree-like POST
2929* Build PAST
30- * Build simple language that exposes PAST very directly (or convert existing)
3130
3231Share as much across layers as possible. (We want only one
3332implementation/type for things like registers, variables, symbol
@@ -38,3 +37,26 @@ integer constant, remember that all the way down to the bytecode.
3837
3938After that, start building top-down. Add features to PAST and see if any
4039additional POST/CFG/bytecode features are needed to support it.
40+
41+ ## Languages
42+
43+ Both as a sanity check and as a kind of textual IR, it would be extremely
44+ useful to build extremely simple languages on top of several layers of
45+ PACT.
46+
47+ An assembly-esque language directly on top of our bytecode support classes
48+ allows for easy introspection of the output of the compiler. In addition,
49+ once a PACT assembly format stabilizes, it would be possible (and likely
50+ encouraged) to create a version of the assembler in C to function as a
51+ replacement for PIR/IMCC as the de facto standard for bootstrapping.
52+
53+ An extended assembly language on top of the opcode tree format would be
54+ easier for human production and let them use the same standard shortcuts
55+ the compiler tends to. Alternatively, this could be a viable target for a
56+ system-level language like Winxed.
57+
58+ A full language that exposes the high level AST as directly as possible is
59+ an excellent tool for testing new features and showing an example for new
60+ implementers. Ideally there will be many languages at this level, so an
61+ official in-core language is less vital but having some language use it as
62+ it is being developed will be key to creating a sane API.
0 commit comments