CoreDump: COOL, RxJS for code generation.

Dump 12.13.2021.09.43
Trio: We can use Rx and HOF to map the parse tree from Jison Debugger to a code generator, can we convert the parse tree to a data stream, and use an iterable mapping to code generation functions, a set of them we call [f].
Gecko: That is straight forward in RxJS, we need to figure out a target architecture, maybe byte code or a virtual machine, in the case of Stanford’s course, it is a 32 bit MIPS architecture, we may use the RISC V Instruction Specs.
We consider a 32 bit RISC V architecture and design a set of functions as lambdas to create a mapping from the JSON parse tree to code, with semantic analysis and type checking.
We will short circuit the whole process of type checking to an abstract syntax tree and mapping it to byte code with a a set of reactive filters and maps.
Using reactiveX.io
.pipe(
filter(lambda x.f(x)),
map(lambda x.m(x))
)
We need to define f(x) for all type checked terminals to be code generated from the AST generated. Leaving the rest for error correction.
We need to define m(x) as a map to snippets of byte code from the AST to be generated for refactoring for optimization.

We need to convert the JSON parse tree into a stream object as an observer stream…., Maybe we could leave this to the reader to explore on his own….