webppl icon indicating copy to clipboard operation
webppl copied to clipboard

Decide whether stack transform is necessary

Open stuhlmueller opened this issue 8 years ago • 2 comments

We currently have a code transform that, when we enter a function body, makes the current address available in special local and global variables throughout the execution of the body (added in #570). When an error happens, this is used to find the location in a webppl program that is closest to the error location. It's conceivable that something similar could be accomplished by (a) extending the address whenever we enter a function body and (b) somehow making this address available to the error handler. This issue is about investigating whether this is possible, and if so, whether it looks like it would be a significant simplification over the current scheme.

stuhlmueller avatar Jul 28 '16 21:07 stuhlmueller

I would not be surprised if there was a better way to implement this than the way I came up with.

It's certainly possible to implement the desired error handling in other ways. I considered a few alternatives (though some turned out not to work) and of those, this was the best.

Andreas has a hunch about how we might implement this differently, and I agree that this is likely to be worth investigating. However, the current sketch doesn't lead me to concrete alternative, so to make progress I think this needs fleshing out.

Something that may help is for me to spend more time explaining in detail how the current implementation works.

null-a avatar Jul 31 '16 18:07 null-a

Sounds good. I should add that I don't think this is high priority—I just wanted to have an issue in place so that we can revisit this at an opportune time, for example if webppl enters a feature-freeze period where we only do refactoring and cleanup.

stuhlmueller avatar Jul 31 '16 18:07 stuhlmueller