stanc3
stanc3 copied to clipboard
Clean up drivers stanc3, stancjs
These have sort of grown over time to use some odd patterns.
TODO list:
- [ ]
Debugging.mlis 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 generalizeDebugging.mlto 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 thewith_returnpattern 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