These are chat archives for ChaiScript/ChaiScript

17th
Oct 2015
hia3
@hia3
Oct 17 2015 10:52
Hello all! Does ChaiScript has something like Microsoft's IActiveScriptSiteInterruptPoll (this interface allows a host to specify that a script should terminate). For example, if script "while (true){};" is running it allows to terminate an application gracefully.
Jason Turner
@lefticus
Oct 17 2015 14:36
@hia3 It does not currently. There has been some discussion about it. I know where it would be implemented but I haven't tested it yet to see what the performance impact would be, which is my first concern before I would make it mainstream
hia3
@hia3
Oct 17 2015 15:41
@lefticus Thanks for you answer! Btw, is it faster than Python? (which is relatively slow)
hia3
@hia3
Oct 17 2015 16:19
When native function throws (say std::exception) and ChaiScript catches and rethrows, host gets an exception of type Boxed_Value (in other words, exception is not unboxed by default). This is because chaiscript::exception_specification has been in invented before std::current_exception? Or for some other reason?
Jason Turner
@lefticus
Oct 17 2015 22:35
Yes, exception_specification was created before c++11 was available. I don't know if it would be possible to use current_exception or exception_ptr. I kind of need to know the underlying type of the exception so that it's possible to catch it inside of chaiscript
Jason Turner
@lefticus
Oct 17 2015 22:44
@hia3 oh, and regarding performance: it's probably faster than any other language when it comes to the ability to call C++ functions/methods, but slower than any other language if you're trying to run raw performance metrics. But really, if you want speed just write the code in C++ then call it from ChaiScript, that's the advantage to using chaiscript, calling C++ is so easy