These are chat archives for ChaiScript/ChaiScript

18th
Mar 2015
Jason Turner
@lefticus
Mar 18 2015 04:45
as far as I know, there is nothing for Qt types. I personally assumed with MOC that qtscript would be more appropriate if you were already using Qt. But if you want to write some chaiscript bindings, that'd be cool. Seems like the kind of thing that should live in the ChaiScript_extras repository https://github.com/ChaiScript/ChaiScript_extras
Andreas Reischuck
@arBmind
Mar 18 2015 08:02
@lefticus I have used QtScript. It works but is very slow for our use case. The boxing and unboxing kills every performance. I am looking for something faster and ChaiScript seems to have no real slowdown for box/unbox.
Andreas Reischuck
@arBmind
Mar 18 2015 09:13
What is the best approach to work with QVariant? Is there a reference like boost::any or something similar? Is it enough to add type-casts to all the types QVariant can hold?
Jason Turner
@lefticus
Mar 18 2015 13:35
it's an interesting question. You could provide automated type conversion to and from anything QVariant can hold... so if you try to use one in the context of a string, it would just work... I think there's some risk not always getting the exact conversion you thought you would get if you go that road, but it might be worthy trying
If you provide a function, it uses the function, if you do not, it uses the conversion that C++ finds at compile time: