Carpet

Carpet

2M Downloads

[Suggestion] Adding abortion and step-by-step evaluation for scarpet apps

Ghoulboy78 opened this issue ยท 2 comments

commented

I think we should be able to abort apps which are stuck in an infinite loop and maybe even allow to step-by-step evaluate them.
How I envision it is this:
For the abortion, you specify in the config something like:

__config() -> {
    'under_development' -> true
}

And that would, at each statement or something, check a flag, and if that flag is not set, continue evaluating, but if it is, then it should stop. Programmers could then set that flag via /script <scriptname> abort or something.

And the next suggestion would be to add the ability to go step-by-step through the app (with a similar thing in the config), and that would allow you to do like do /script <scriptname> step x to step that many times through the program's evaluation.

I am aware that both are likely unrealistic, considering scarpet evaluation, but I hope they are actually possible somehow.

commented

Probably more elegant to use this as the config flag, but agreed, proper debugging tools for scripts would be amazing.

__config() -> {
    'debug' -> true
}
commented

Actually...

Edit: Nah, probably too complicated as well.