Page 2 of 2

Re: Chaiscript, anyone?

Posted: Tue Oct 13, 2009 3:16 pm
by lefticus
Berserker wrote: 1) Why did you implement a custom api instead of the "common" boost one (boost::python or luabind)?
Great question. The short answer is, "because I didn't really look good enough at boost::python first." The long answer is that we really are doing something different than anyone else has. ChaiScript was developed specifically to work with C++, and it built around C++'s needs. At no point do we have to shoehorn C++ to fit into a preexisting language, like python or lua.

Looking closer at boost::python now, I see that would certainly could do many things like they are, and even discussed similar things early on, but it ended up being unnecessary because it was more verbose than ChaiScript needed.

It certainly would be possible to match the form of boost::python, if it would make a big difference in usability for some people.
Berserker wrote: 2) Are you going to support an "autowrapper"? I mean something like Py++. In my experience of embedding scripting engines (spydermonkey, python, lua ecc..), the most tedious part is when I have to expose my C/C++ library: at the moment I'm trying to automate this process using Py++ but with a lot of problems (mostly related to the CPython's GIL :twisted:, you can read some posts of mine in the Py++ mailing list) .

I'm always interested in looking at new scripting engines because I didn't found the "perfect" solution for me yet :lol:
We could easily write a sort of pre-processor for chaiscript that would dump some module code from a .hpp file, I would think. The goal of chaiscript was to make it straightforward enough that a preprocessor would be unnecessary, but I could see the utility in something that just helped you bootstrap the process.

IMO for anything less than 20 functions/types the bootstrapping would just get in the way, because you would then have to hand pick which methods you wanted to forbid the script from using. I'll add this idea to our bug tracker and see if we can follow up on it.

Re: Chaiscript, anyone?

Posted: Tue Oct 13, 2009 3:57 pm
by ppClarity
How heavily tied to boost::thread are you? While I like boost for a lot of things, I've been seeing some compelling arguments for TBB.

Re: Chaiscript, anyone?

Posted: Tue Oct 13, 2009 5:49 pm
by lefticus
ppClarity wrote:How heavily tied to boost::thread are you? While I like boost for a lot of things, I've been seeing some compelling arguments for TBB.
We use boost::mutex for a few data structures and boost::thread_specific_ptr for stack management.

My gut says that what we use could possibly work within TBB, since the thread handling is all automatic. But maybe not? The crux of the question is whether or not boost::thread_specific_ptr would see two different TBB created threads as being different. If they use pthread underneath (or windows threads) then I would expect that it would work.

-Jason

Re: Chaiscript, anyone?

Posted: Tue Oct 13, 2009 9:19 pm
by nikki
Question: What's the story behind the name? :P

Re: Chaiscript, anyone?

Posted: Tue Oct 13, 2009 11:07 pm
by haffax
Curious question. Tea is no more strange than moon or squirrel. ^^

Re: Chaiscript, anyone?

Posted: Tue Oct 13, 2009 11:38 pm
by jacmoe
You assume that 'Chai' means spiced tea.
Which it does most of the time.

However, 'Chai' also means 'living' in Hebrew - and seeing that the Chaiscript guys are Christian coders, maybe it stands for 'Life' ? :)

Alternatively, it could also mean A wine shed, or other storage place above ground, used for storing casks, common in Bordeaux. :mrgreen:

Re: Chaiscript, anyone?

Posted: Tue Oct 13, 2009 11:46 pm
by haffax
Oh, didn't knew about the hebrew meaning. But tea or life or moon or squirrel or falcon or whatever. Pick a word, any word, you've just invented a scripting language name... :lol:

Re: Chaiscript, anyone?

Posted: Wed Oct 14, 2009 4:30 am
by lefticus
jacmoe wrote:You assume that 'Chai' means spiced tea.
Which it does most of the time.

However, 'Chai' also means 'living' in Hebrew - and seeing that the Chaiscript guys are Christian coders, maybe it stands for 'Life' ? :)

Alternatively, it could also mean A wine shed, or other storage place above ground, used for storing casks, common in Bordeaux. :mrgreen:
The name is meant as a play on JavaScript, to kind of evoke the idea of being related to ECMA Script, but not to be as obtuse as Lua, Python or Ruby. So you see ChaiScript and you think, "oh, that must be a scripting language."

Not sure if it matters here or not, but just to make sure there's no misrepresentations, I am a Christian, but my partner on this project does not identify himself as such.

Re: Chaiscript, anyone?

Posted: Sun Oct 18, 2009 3:13 pm
by nullsquared
ChaiScript looks good but can I ask why in the world it's header-only? Compile times take longer with ChaiScript than even LuaBind, which was already slow enough.

Hm... what happens if you have an "unknown" value?

Code: Select all

var foo

// what's foo? how can I check if it's valid?
And what about NULL pointers?

Code: Select all

script.add(var(shared_ptr<int>()), "nullPtr");

// chai
// how to check if nullPtr points to anything?