Re:ChaiScript – Easy to Use Scripting for C++
by Erlich_Bachman on Thursday July 25, 2019 @04:02PM
(#20529004)
Very interesting, can you outline your thought process on why you did not want to write complex code in lua? It's very stable and fast, and has many language constructs etc? It would be completely understandable if your answer is just "this other thing looked cool and I wanted to try it", which is everyone's own choice, but I am wondering if there were any technical reasons for that decision?
Re:ChaiScript – Easy to Use Scripting for C++
by bbmario on Thursday July 25, 2019 @05:25PM
(#20529906)
I can't talk about the others, so I'll compare Wren and Lua. I dislike Lua's approach to objects, feels clunky and prototype-ish. I also dislike the local/global stuff.
Wren has exception-like error handling and concurrency. And the object model is very similar to C#.
Re:ChaiScript – Easy to Use Scripting for C++
by bsenftner on Thursday July 25, 2019 @04:43PM
(#20529481)
I used to develop a game engine that used an embedded version of Visual Studio to allow C/C++ scripting which compiled into dlls and were hot loaded with any change. And if I recall correctly, that is exactly how the feature film compositor Shake worked: their shader language and entire node graph system is C macros and templates to disguise the fact that it's really C++, and one's compositor projects are really disguised visual studio projects.
Re:ChaiScript – Easy to Use Scripting for C++
by bbmario on Thursday July 25, 2019 @05:26PM
(#20529914)
Re:ChaiScript – Easy to Use Scripting for C++
by earenndil on Thursday July 25, 2019 @06:34PM
(#20530495)
Yep. I write my engine in D, which is nicer than c++ for prototyping, but regardless I embed a scheme for scripting.
could you tell me more about the D/scheme integration - specifically what scheme you used, and what you had to do to integrate it with D? i spent a couple of days trying to integrate chibi with D, but gave up because it made too much use of preprocessor macros.
Re:ChaiScript – Easy to Use Scripting for C++
by earenndil on Thursday July 25, 2019 @07:48PM
(#20531017)
I shopped around quite a bit and eventually decided that s7 scheme[1] would be the best for me. It's been fairly painless to integrate so far, I've just copy-pasted the function prototypes I've needed, as I've needed them. No macros. Engine is closed-source atm so I can't show code, but it's a pretty straight translation from the c examples.
In my case, it is Wren. Some people prefer Chai, AngelScript, Lua, mruby, etc.