These are chat archives for ChaiScript/ChaiScript

17th
Nov 2017
Tomasz Frydrych
@ksanderon
Nov 17 2017 21:01
Is it possible in chai script to set timeout for eval or for example stop execution from another thread?
Tomasz Frydrych
@ksanderon
Nov 17 2017 21:12
or maybe something like "evalSingleStep"
Jason Turner
@lefticus
Nov 17 2017 21:23
There is a mechanism that was added in the last release that makes that possible, but it's untested @ksanderon
By using call tracing, which is a template parameter. Here is an example of our you would plug in your own tracer: https://github.com/ChaiScript/ChaiScript/blob/develop/unittests/compiled_tests.cpp#L1004-L1018
Tomasz Frydrych
@ksanderon
Nov 17 2017 22:33
If it's possible then ChaiScript have very unique feature - could be used to execute server side user provided / untrusted code after sandboxing without process spawning (for example infinite loops can be stopped)
Currently i'm looking around for interpreter which can be sandboxed (have disabled i/o operations, external modules, stdlib operations which can crash in way which cannot be handled by exception handlers etc. ) and which execution can be externally managed. I need it to give users expose option to add their own event handlers in server aplication on which i'm working.
Tomasz Frydrych
@ksanderon
Nov 17 2017 22:41
For now I have it done with my implementation of llvm ir interpreter but this it to fragile to extend ;)
at least for long term maintenance, so I'm looking for something much less complex.
ChaiScript looks anyway very promising even if performance is not so high as it could be.
Jason Turner
@lefticus
Nov 17 2017 22:50
I think your main problem for what you describe is that ChaiScript tries to be safe, but really is as unsafe as whatever functions you provide to it. It doesn't have any kind of VM or sandboxing
so it's harder to make any guarantees about its safety for server side work, compared to something like java. But on the other hand, Java has had many security flaws of its own