Skip to content

bialang/bia

Repository files navigation

Bia

C/C++ CI

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.

Embedded Example

#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)

Building

Prerequisites

  • CMake >=3.1
  • C++11 compatible compiler
  • Git for cloning

Dependencies

Bia can be built without any third-party dependencies! However, some are recommended for performance gains and more features:

  • Catch2 for testing

Compilation

git clone https://github.com/bialang/bia.git
mkdir bia/build
cd bia/build

cmake ..
cmake --build .

ctest

cmake --build . --target install

License

Bia is distributed under the BSD-3-Clause.

Releases

No releases published

Languages