Easy scripting in C++.
- Simple and familiar syntax
- Object Oriented
- Auto-binding of c++ functions to Loris
- Mark and Sweep Garbage Collection
- Easy to embed in c++ applications
- Easy to extend
- Pre-compilation
#include "loris/loris.hpp"
double multiply(double a, double b)
{
return a * b;
}
int main()
{
loris::Loris loris;
loris.AddSource(R"(
def hello()
{
return multiply(5, 10);
}
)");
loris.AddFunction("multiply", loris::Def(multiply));
loris.Compile();
double result = loris.ExecuteFunction<double>("hello");
}
//class named Hello
class Hello
{
//constructor
Hello()
{
print("this is a constructor");
}
//member function
def Greet()
{
//call print function
print("hello world!");
}
}
def main()
{
var hello = new Hello();
hello.Greet();
}
https://github.com/njbrown/dragonscript/blob/master/SYNTAX.md
or
andand
statements are parsed but the bytecode isn't generated and will cause errors if used- garbage collection sometimes causes random crashes