emjun/tisane

RFC on strategy/design doc for Tisane R

emjun opened this issue · 2 comments

emjun commented

Goal: Create an R version of Tisane

Considerations:

  • Keep user-facing API as R-idiomatic as possible
  • Reduce duplicate maintenance efforts. So that changes to Tisane in Python will improve/update Tisane R package.

Pipeline at 10,000 ft

R API (user input code) --> Python script --> JSON --> Tisane GUI --> R Code (output statistical modeling code)

Note: The new part is R API --> Python script. The rest is already how Tisane (Python implementation) works.
Put another way, the goal is to "transpile" R into Python.

How to compile/transpile R into Python?

  • Strategy 1: Build up internal graph IR in R, traverse graph to produce Python code
  • Strategy 2: Parse R script into AST, traverse AST, generate Python code from AST
  • Strategy 3: Build up internal graph IR in R, output graph IR in some format (maybe DOT or something like that), read in graph output, write Python code from graph

In all of these: Key thing is to control Python script execution through a bash script, which we can call from R.

Current/next steps

As of January 18, 2022: I opt for Strategy 1 first because (i) I suspect the syntax of Tisane is likely to change more than the graph IR and (ii) outputting the graph to read it back in might not be necessary.

TODOS related to Tisane R:

emjun commented

@audreyseo @shreyashnigam Did this capture our discussion? Anything you would change/add?

RFC looks good. Nothing to add