2009-08-06 04:22:13 +00:00
bin Moving project files into subdirs 2009-05-28 18:13:06 +00:00
contrib Move test files to contrib/test and added one liner to readme 2009-07-13 13:18:26 +00:00
include/chaiscript Favor filtering of functions during dispatch over exceptions to determine appropriate function to call. Results in approximately 50% reduction in runtime for long running scripts 2009-08-06 04:22:13 +00:00
msvc add example.cpp to build for VC++, fix minor bug in passing of & parameters to functor<>, move bootstrap functions into bootstrap namespace and clean up function names and add "retro" support for reversing of ranges. 2009-07-23 04:35:15 +00:00
samples Add error to CMakeList.txt on missing Boost. Fix if sample 2009-07-26 13:33:58 +00:00
src Cleanup comment in example.cpp 2009-07-25 13:48:44 +00:00
unittests Added 'clear'. Added 'push_back' to string. Added char. Added simple reverse 2009-07-23 17:01:07 +00:00
build_package.sh A couple touchups. Fixed package builder 2009-07-10 15:37:10 +00:00
CMakeLists.txt Add error to CMakeList.txt on missing Boost. Fix if sample 2009-07-26 13:33:58 +00:00
license.txt First bit of work making a package build 2009-07-09 14:51:12 +00:00
readme.txt Move test files to contrib/test and added one liner to readme 2009-07-13 13:18:26 +00:00
run_unit_tests.sh Touchup to unit test runner 2009-07-09 20:16:22 +00:00

ChaiScript v1.0 
http://www.chaiscript.com
(c) 2009 Jason Turner and Jonathan Turner
Release under the BSD license, see "license.txt" for details.

[Introduction]

ChaiScript is one of the first (and perhaps only) embedded scripting language designed from the ground up to directly target C++.  Being a native C++ application, it has some advantages over existing embedded scripting languages:

1) It uses a header-only approach, which makes it easy to integrate with existing projects.
2) It maintains type safety between your C++ application and the user scripts.
3) It supports a variety of C++ techniques including callbacks, overloaded functions, class methods, and stl containers.

[Requirements]

ChaiScript requires a recent version of Boost (http://www.boost.org) to build.

[Usage]

* Add the ChaiScript include directory to your project's header search path
* Add "#include <chaiscript/chaiscript.hpp> to your source file
* Instantiate the ChaiScript engine in your application.  For example, create a new engine with the name 'chai' like so: "chaiscript::ChaiScript_Engine chai"

Once instantiated, the engine is ready to start running ChaiScript source.  You have two main options for processing ChaiScript source: a line at a time using "chai.evaluate_string(string)" and a file at a time using "chai.evaluate_file(fname)"

To make functions in your C++ code visible to scripts, they must be registered with the scripting engine.  To do so, call register_function:

dispatchkit::register_function(chai.get_eval_engine(), &my_function, "my_function_name");

Once registered the function will be visible to scripts as "my_function_name"

[Examples]

ChaiScript is similar to ECMAScript (aka JavaScript(tm)), but with some modifications to make it easier to use.  For usage examples see the "samples" directory, and for more in-depth look at the language, the unit tests in the "unittests" directory cover the most ground.

For example of how to register parts of your C++ application, see "example.cpp" in the "src" directory.