Questions tagged [chaiscript]

ChaiScript is an embeddable scripting language inspired by JavaScript. It is designed as header-only library that is directly targeted at C++.

ChaiScript describes itself as an easy to use embedded scripting language for C++. Some key features:

  • Header only; no external library is necessary, just a C++11 compiler.
  • Thread safe by default
  • Portable; tested on 32 and 64 bit Windows, clang++ and g++
  • BSD licensed

More info:

A tiny example:

#include <chaiscript/chaiscript.hpp>

std::string helloWorld(const std::string &t_name)
{
  return "Hello " + t_name + "!";
}

int main()
{
  chaiscript::ChaiScript chai;
  chai.add(chaiscript::fun(&helloWorld), 
           "helloWorld");

  chai.eval("puts(helloWorld(\"Bob\"));");
}
48 questions
0
votes
1 answer

ChaiScript troubles

I'm using script language ChaiScript with c++ and Qt. I've defined such function: void ChaiPainter::drawRectangle(QPainter *painter, int x, int y, int height, int width) { painter.drawRect(x, y, width, height); } And in application…
Max Frai
  • 61,946
  • 78
  • 197
  • 306
0
votes
0 answers

ChaiScript: Exposing data member variables of a class

I'm trying to expose Ogre::Vector2 class to ChaiScript. I want to expose the x and y of the class and as-per this post on their forum, it seems like you just need to add it like any other function. But that doesn't work for me and it gives me the…
Vite Falcon
  • 6,575
  • 3
  • 30
  • 48
-2
votes
1 answer

Basic example from chaiscript.com throws an exception at runtime

I added the include directory of chaiscript to my Projects Additional Dependencies and compiled this example successfully. If I execute it though, it throws this exception: Unhandled exception at 0x753D5B68 in CHAISCRIPT_TEST.exe: Microsoft C++…
sro5h
  • 322
  • 2
  • 12
1 2 3
4