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++.
48
questions
0
votes
0
answers
54
views
How to include advanced c++ classes from a module into cython
I am trying to make it so that the Chaiscript module for c++ will work with python. My problem is that the main class I need to use is more advanced then what is used in the tutorials, making it ...
1
vote
2
answers
103
views
Compiling Chaiscript with i686-w64-mingw32-g++ fails
I am trying to compile a simple chaiscript example for windows from Linux using the i686-w64-mingw32-g++ compiler. I have already gotten it to work with g++, but when compiling my app using the ...
0
votes
1
answer
51
views
chaiscript returning user defined type in script function
For the following code:
#include <chaiscript/chaiscript.hpp>
struct Str {};
Str cppfun() { return Str{}; }
int main()
{
chaiscript::ChaiScript chai;
chai.add(chaiscript::fun(&...
0
votes
1
answer
52
views
Chaiscript, how to convert a char to a string
I need to loop every characters of the string. Whether I use a for loop or a range, I get stuck with characters and I can't convert them back to a string.
var str = "abcd"
var a = str[0]
...
2
votes
1
answer
137
views
Return more than one value in ChaiScript?
In Lua it's possible to return more than one value, For example:
function math.pos(x1, y1, x2, y2)
return x2 - x1, y2 - y1
end
distanceX, distanceY = math.pos(100, 100, 300, 300) --> distanceX = ...
0
votes
1
answer
44
views
Including a certain header file causes errors from SFML
I'm trying to use ChaiScript with SFML for my game engine. All the SFML stuff works fine, until I include chaiscript.hpp in my game object header file. My GameObject header file looks a little like ...
1
vote
0
answers
94
views
How to use templates with ChaiScript
I'm working on a game engine, and I'm working on adding scripting to it using ChaiScript. In my engine, I have a simple Entity Component System that uses templates. It has a struct for each object, ...
1
vote
1
answer
83
views
exposing nonstatic member function of class to chaiscript
I have a project that tries to implement keyboard macro scripting with chaiscript. I am writing a class based on xlib to wrap the xlib code.
I have a member function to add a modifier key to an ...
0
votes
1
answer
227
views
How do I get ChaiScript to run under Linux and Windows with CMake?
I am working on a Student Project and we want to use ChaiSript (6.1) as scripting Language. We are using CLion and CMake on Linux and Windows. Also we are using SFML, so the whole thing has to be ...
1
vote
1
answer
680
views
Passing a C++ Object to a ChaiScript Function
I am trying to pass a custom c++ object reference to a simple chai script so that the chai script can eventually read/access/call public variables & methods.
I'm not certain if this is even ...
0
votes
1
answer
46
views
Chaiscript string problem between Visual Studio and Xcode
I've hit a very weird bug or most probably I'm missing something. My script runs perfectly when compiled with VS 2015 but fails when I switch to Mac and use Xcode 9.
The problem is, on Mac, ...
0
votes
1
answer
329
views
How can I add a global std::map to chaiscript?
I would like to pass a std::map to chaiscript. However, I'm not sure how to do this. My code is currently as follows:
#include <map>
#include <string>
#include <chaiscript/chaiscript....
0
votes
1
answer
356
views
How does chaiscript handle big objects?
I am considering using chaiscript for my project. However, I have a question about performance. Maybe it has been answered already somewhere, but I couldn't find it...
I have a simulation using large ...
1
vote
1
answer
213
views
Documentation about AppScript and ModScript (Serena)
I'm currently working for a bank as an analyst developper. The bank uses SBM from Serena (recently buy back by Micro Focus). The problem is that the scripts are coded in AppScript (VBScript 4.0) and ...
0
votes
2
answers
177
views
Using Chaiscript without dynamically loaded libraries
I'm working with Intel SGX and would like to use Chaiscript inside an enclave. SGX forbids the use of dynamically loaded libraries inside an enclave. Is there any way to use Chaiscript in such ways (I ...
2
votes
2
answers
2k
views
Temporarily Disable Compile Warnings in Visual Studio for Includes
I'm running Visual Studio 2017. I'm trying to add a Scripting Language called ChaiScript to my project, but it generates A LOT of warnings when I have /Wall on, and I also have treat warnings as ...
0
votes
0
answers
309
views
Cannot register type in chaiscript
I want to register a type in chaiscript for transfering data from a chaiscript function to the c++ space:
class Layout {
std::string device_id;
std::string address;
std::...
1
vote
0
answers
86
views
What is the C++ performance monitoring tool being refered to in the following cppcon video?
What is the name of the performance monitoring tool being referenced in this talk: https://youtu.be/uzF4u9KgUWI?t=50m11s?
1
vote
1
answer
254
views
Error: "Can not find object: use"
I am currently using ChaiScript version 6.0.0 and Visual Studio 2017.
In my C++, I am retrieving a reference to a function on_init() from a script file, and executing it. The ChaiScript object was ...
1
vote
1
answer
177
views
How call a constructor with std::initializer_list of a user type in ChaiScript?
I have the next definition class:
class MyType {
public:
MyType();
MyType(int x);
MyType(std::initializer_list<MyType> list);
}
I register my custom class and its constructors in ...
0
votes
1
answer
246
views
How register overloaded template member function in ChaiScript?
I have the next definition class:
class MyType {
public:
template <typename T>
MyType& put(const std::string& s, T&& val);
template <typename T>
MyType&...
1
vote
1
answer
141
views
Move semantics and std::unique_ptr in chaiscript
How can I register a method that relies on move semantics and std::unique_ptr with chaiscript's engine? Here's an example piece of code I cannot get to work using chaiscript 5.8.5 :
class Element;
...
1
vote
1
answer
175
views
Recommendations for returning const char * as a string value using chaiscript?
Running into a very odd challenge with Chaiscript today, I'm sure it's lack of understanding but I haven't been able to resolve it yet. Hoped lefticus or others could shed some light on it.
When my C+...
1
vote
2
answers
457
views
Can chaiscript string split like lua?
I am porting lua to chaiscript. The original lua code uses split:
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, ...
0
votes
1
answer
179
views
Compile error Chaiscript Visual Studio 2015 Community
The error:
Error C2664 'void chaiscript::detail::Dispatch_Engine::add(const chaiscript::Type_Info &,const std::string &)': cannot convert argument 1 from 'double (__cdecl *const )(int,...
2
votes
1
answer
580
views
Can I parse/compile a ChaiScript script once and invoke it many times?
I'm trying to determine whether I can use ChaiScript but so far I'm very concerned that there doesn't seem to be a way to compile a script to use later. This would be a problem if a script has to be ...
0
votes
1
answer
620
views
Not able to Compile ChaiScript with C++11 enabled using CMake GUI for Android
I am not able to build ChaiScript library for android.
Initially I tried to built the ChaiScript for linuxMint using CMake GUI as below mentioned step
Source Path + binary Path -> Configure -> ...
-2
votes
1
answer
227
views
Basic example from chaiscript.com throws an exception at runtime [closed]
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 ...
1
vote
1
answer
271
views
ChaiScript: loading preprocessed script file from memory
In ChaiScript, there is a .use() function which takes a file path and loads the file and makes every function and variable available in the script. This is great functionality if you want a file from ...
2
votes
1
answer
795
views
How can I check if a function is defined in the chaiscript and how can I execute it with typed arguments?
I just discovered chaiscript and I like it a lot.
Now I want to add support for my very simple opengl 3d engine.
I have C++ math-classes: vec2T, vec3T, vec4T, mat2T, mat3T, mat4T, ... (they are ...
3
votes
2
answers
515
views
How do I access members of a type defined in a script?
I am trying to access from C++ file members from a type I defined in a script. The problem is that Boxed_Value::get_attr always return a null value.
Here is my C++ file:
#include <chaiscript/...
3
votes
2
answers
630
views
compare std::wstring type and represent of wstring literal in ChaiScript
I want to write ChaiScript code using std::wstring type like below c++ code.
#include <iostream>
int testfunc(std::wstring s, std::wstring t)
{
if(s==t)
{
std::cout << "1"...
2
votes
1
answer
359
views
std::wstring in ChaiScript
I am a beginner for ChaiScript.
I try to use std::wstring type in ChaiScript.
std::string type is works well.
#include <iostream>
#include <chaiscript/chaiscript.hpp>
#include <...
1
vote
1
answer
263
views
Coroutines or Stateful/resumable tasks with Chaiscript
I would like to use Chaiscript to let users of my application implement tasks or stateful algorithms by using a scripting language. These algorithms "depend on events during time". In other words, ...
3
votes
2
answers
184
views
Chaiscript #include statement mapping in biicode.conf
I want to create a biicode block that depends on the chaiscript block (lefticus/ChaiScript). If I include the chaiscript headers this way
#include <lefticus/ChaiScript/chaiscript/chaiscript.hpp>...
4
votes
1
answer
821
views
Is it possible to add breakpoints to a ChaiScript execution?
Does ChaiScript support debugger-like behavior? For instance, can I set breakpoints at which should the execution pause, and allow me to inspect the stack before resuming? If so, how?
0
votes
1
answer
277
views
ChaiScript std lib on Mac / c++ looking for dll at runtime
I'm trying to integrate ChaiScript into my little Mac / c++ project. While I'm able to use it just fine by building chaiscript_stdlib.hpp / using ChaiScript chai(Std_Lib.library()), I really would ...
0
votes
1
answer
1k
views
Assign value to Chaiscript variable through user-type object gives unexpect behaviour
I've got a peculiar problem with C++ and Chaiscript, hope somebody can help me with it, and
I'll try to give it as much information as it is needed.
Basically, calling a c++ function defined in c++ ...
1
vote
3
answers
2k
views
C++11 std::function: Binding a method without a particular instance
Continuing this thread I'd like to split it off into another more specific question. I want to bind a function using ChaiScript, and I can do that using std::function, but I can't seem to let std::...
0
votes
2
answers
1k
views
Binding functions with multiple arguments results in C2027
I'm using ChaiScript 5.3.1, and I'm trying to bind functions to my own class, specifically a setPosition function which can take either a Vector3 or 3 floats.
The class and it's relevant methods are ...
13
votes
1
answer
33k
views
Clang linking with a .so file
I keep getting
ld: library not found for -lchaiscript_stdlib-5.3.1.so
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When trying to link to a .so file.
I'm using this ...
2
votes
1
answer
699
views
ChaiScript and STL
I am trying to use a std::list<arnAddr> (arnAddr being a custom Struct) in a Chai scriptfile.
But I get an error during parsing :
Error: "Missing clone or copy constructor for right hand side ...
3
votes
1
answer
806
views
Evaluate chaiscript file within a chaiscript file
I'm starting to learn chaiscript and couldn't find this in the documentation.
I know there is API to evaluate a chaiscript file from C++ by calling ChaiScript::eval_file
But is it possible to do the ...
0
votes
0
answers
1k
views
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. ...
2
votes
0
answers
659
views
How to expose C++ Code to another scripting language
Background:
I have C++ DLL's which are part of a web application. I'm in the position where the UI, which is invoking parts of my code is under development and the C++ code is being developed as well. ...
0
votes
2
answers
482
views
Inheritance problem when binding C++ native methods in Chaiscript
I use this code to validate some properties of a set of Qt objects in ChaiScript:
/// initialize the engine
boost::shared_ptr<chaiscript::ChaiScript> chai;
chai.reset(new chaiscript:...
4
votes
1
answer
551
views
Is it possible to use custom c++ classes with overloaded operators in QtScript?
Does anyone know if it is possible to have a C++ class with overloaded operators such as +,-,* and declare it somehow (this is where the magic happens) to a QtScriptEngine such that js-expressions ...
0
votes
1
answer
759
views
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, ...