CoreDump: COOL, RxJS for code generation.

Geometric Cartooning by Dr Bheemaiah Anil K

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….

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Using React Refs and Animating between Modals — Part 2

5 things that happen every time you require a file in Node.js

Remove UserDefaults boilerPlate code using PropertyWrapper

A Modular Approach To Routing With React Router 4

Multiple File Upload Form

Development — Trading bot based on Binance Api (Part 2)

VUE WITH TYPESCRIPT — SETUP USING VUE-CLI — Scaling Vue

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anil Kumar B

Anil Kumar B

More from Medium

How to fix unfortunately gallery /Photos has stopped android

CS371p Spring 2022: Winnie Chang

Use Object Relational Managers Judiciously!

CS373 Spring 2022: Luca Santos