About ChaiScript

ChaiScript is the first and only scripting language designed from the ground up with C++ compatibility and modern design in mind. It is an ECMAScript-inspired, embedded functional-like language.

ChaiScript is licensed under the BSD license.

Download

Due to an increased release schedule, and the nature of ChaiScript being a header-only library, binary releases will be made less often. Previous releases can be found on github.

Version: 4.2.0 Released: 12/1/2012
(Requires Boost)
Source (tar.bz2)
Source (zip)

Version: 5.2.0 Released: 12/1/2012
(Requires C++11 Compiler)
Source (tar.bz2)
Source (zip)

ChaiScript 3.1.0 Released

Changes since 3.0.0

  • Numeric operations performance increased approximately 10x
  • Looping operations performance increased up to 2x
  • Engine start up time decreased
  • Several parsing bugs related to index operators fixed
  • Added full support for all C algebraic types: double, long double, float, int, long, char, uint8_t, uint16_t, uint32_t, uint64_t, int8_t, int16_t, int32_t, int64_t
  • Enhanced support for capturing of exceptions thrown from ChaiScript in C++

Download it from github.

Excellent work! Thanks. I

Excellent work! Thanks.
I wait for the full documentation on scripting language.

Could you clarify what

Could you clarify what documentation you are looking for? The documentation currently posted is fairly robust.

Thanks,
Jason

Language Tutorial/Specification

BNF is not very easy to read so could you put a more comprehensive tutorial up. Also, With it being c-like could you put what features are NOT available in ChaiScript, which can be much more important really.Also! I cannot find out if I can cast.

In that vain, how would I go about the following (for example).

In c++ I have a function: function(int a, double b) { /*BLAH*/ }

In chai is write the following (which is wrong!):

for ( var i = 0; i < 1000; ++i)
{
	function(i,(double)i); //is this legal/how do you do it?
}

It's much more useful to

It's much more useful to think of ChaiScript as C++ than as C like. That said, I could see adding a section on "what's not in ChaiScript."

Be sure to check out all of the relevant "ChaiScript Language" sections of the documentation too.

As far as your specific question, use the constructor syntax that you might use in C++:

for ( var i = 0; i < 1000; ++i)
{
  function(i,double(i)); //is this legal/how do you do it?
}

-Jason

Support ChaiScript by sharing it with your friends: