Embedding Behl in C++

Learn how to embed the Behl scripting language in your C++ application.

Quick Start

#include <behl/behl.hpp>

int main() {
    behl::State* S = behl::new_state();
    behl::load_stdlib(S);
    
    behl::load_string(S, "print('Hello from Behl!')");
    behl::call(S, 0, 0);
    
    behl::close(S);
    return 0;
}

Guides

Philosophy

The behl C++ API is designed to be:

  • Familiar - Similar to Lua’s C API
  • Modern - Leverages C++20 features
  • Type-safe - Strong type checking with UIDs
  • Simple - Easy to integrate and use

Table of contents


Copyright © 2025 behl Project. Distributed under MIT License.

This site uses Just the Docs, a documentation theme for Jekyll.