Embeddable C++11 Scripting Language
🚧 This project is premature and not ready for production user 🚧
The roadmap for this project can be found on Trello.
#include <bia/engine.hpp>
// create a simple engine with the default settings and allocator
bia::Engine engine;
// register a function and the io module
engine.function("hello_world", [] { std::cout << "Hello, World - C++\n"; });
engine.use_bsl();
// bia script
std::stringstream code;
code << u8R"(
// prints 'Hello, World' to the console
import io
io.print("Hello, World! - Bia")
// calls the C++ function and print 'Hello, World - C++' to the console
hello_world()
)";
// execute
engine.execute(code);
And the corresponding CMake:
find_package(bia REQUIRED)
add_executable(example example.cpp)
target_link_libraries(example PRIVATE bia::bia)
- CMake >=3.1
- C++11 compatible compiler
- Git for cloning
Bia can be built without any third-party dependencies! However, some are recommended for performance gains and more features:
- Catch2 for testing
git clone https://github.com/bialang/bia.git
mkdir bia/build
cd bia/build
cmake ..
cmake --build .
ctest
cmake --build . --target install
Bia is distributed under the BSD-3-Clause.