Squirrel

The programming language
Welcome to Squirrel Sign in | Join | Help
in Search

Debug interface and asyncrhonous execution

Last post 03-27-2008, 6:56 AM by ooo. 0 replies.
Sort Posts: Previous Next
  •  03-27-2008, 6:56 AM 2426

    Debug interface and asyncrhonous execution

    Found recently of this language, reading documentation seems be closest to what was searching, but found some features, that although at least debug one might not be hard to implement, could be useful for reviewing for inclusion.
    Reason of those features is due execution time constraints, scripts must return or abort in less than a certain short time.

    When using lua, implementing time limits is easy with debug hook, but if the user makes a mistake on script and ends with something like while (true) { if (false) ... } didn't see any way to catch this, as this kind of code might be single line and perform no call at all on debug hook. Although lua had the debug hook that where called every specified number of instructions, it actually isnt even needed that every instruction checks a counter. Same could be made only checking on conditional branches, as remaining instructions are bound to reach end at some point.

    On asyncrhonous execution, also might be useful be as implemented with above, allowing the debug function to suspend vm execution and return control to host, or as a full separate feature.
    This would allow to implement on host a queue of calls / event handlers, and on a loop, execute a certain ammount of vm time.
    A single thread could support for keeping a responsive gui, reading netork data that might add items to queue, etc, while execution of a script whose result of the call is not needed anyways and might require long enough execution time to exceed some response times host might require.

    Other uses of those might be as a step towards controlling untrusted code so can't hang the host, or just as a safeguard in case an user that don't even want to hang the host does a mistake in the code of the script accidentally entering an endless loop.
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems