Are there any resources available to look at on how to implement a kernel for a compiled domain specific language?

I am just getting into this and implement my first “kernel” this weekend. I’ve got an executable that I pass a file to, that executable compiles and executes the domain specific code in the file and returns a result.

My stank kernel that I wrote over the weekend simply tracks the code blocks passed to do_execute and writes all the code blocks do_execute has received to a file and passes it to the compiler using subprocess and streams the result back to the notebook. Although this is very simplistic I had to start somewhere :slight_smile: . There are obvious issues introduced when a users edits and re-executes a cell or deletes a cell. If a user edits a cell, the code block would be logged and the original entry would not be edited. If a cell were to be deleted, the kernel would not know this.

Are there signals or messages the kernel can receive when a cell is edited or deleted?

I do know the compiler is generated from the c++ implementation of Coco/R. I am not sure of the work required to write an interpreter. Are there examples of kernels being written for compilers in the past? The Xues-Cling kernel uses the Cling C++ interpreter. Which is leading me down the path of looking at ways to wrap my compiler I’ve got in a REPL shell.

I just wanted to see if the community here had any input.
Thanks

1 Like