stanc3 icon indicating copy to clipboard operation
stanc3 copied to clipboard

Clean up drivers stanc3, stancjs

Open WardBrian opened this issue 3 years ago • 0 comments

These have sort of grown over time to use some odd patterns.

TODO list:

  • [ ] Debugging.ml is used for printing things like the typed_ast, but not the MIRs or anything else. We should move more of that code in there. We should also generalize Debugging.ml to allow its usage in stanc3js so it doesn't always just print
  • [ ] There is a lot of nested if-else style logic which shouldn't need to be there if we encapsulate the debug logic into Debugging.ml. Because we use the with_return pattern in stanc3js (which I don't love but has some benefits in a JS driver), and can exit in stanc, I think the drivers could both just be straight lines of assignments and processing
  • [ ] Make sure they both do the same thing - see https://github.com/stan-dev/stanc3/issues/751#issuecomment-1033865785
  • [ ] Expose all the same functionality - stanc3js lacks several more of the debug flags

WardBrian avatar Jun 17 '22 14:06 WardBrian