Bonezegei Scripting Language

What is BSL?

Before we start writing code, it is important to understand what the Bonezegei Scripting Language (BSL) actually is and why you might want to use it.

BSL is a lightweight, dynamically typed programming language. It is powered by a custom-built interpreter written entirely in the C programming language. If you have ever written code in JavaScript, C, or C++, you will feel right at home! BSL was intentionally designed with a familiar, easy-to-read syntax so developers can pick it up instantly. All BSL script files are saved with the .bzg file extension.

What is BSL used for?

BSL is incredibly versatile. While you can use it to write standalone scripts, its true power lies in being a "glue language." Here is what BSL is primarily used for:

1. Embedded Logic: Software developers can embed the BSL engine inside their larger C/C++ applications to allow users to write custom scripts or mods without recompiling the main program.

2. Rapid Prototyping: Because you don't need to declare data types or set up complex environments, you can write and test ideas in seconds.

3. Automation: Writing quick command-line scripts to automate repetitive system tasks.

4. Inter-Process Communication (IPC): Using libraries like BSL_pipe to connect different programs and system commands together seamlessly.

Why use BSL?

1. It is Simple: The syntax is clean and predictable. You don't have to worry about memory management (it has a built-in garbage collector) or strict data typing.

2. It is Complete: Despite being lightweight, BSL is fully Turing-complete. It supports standard modern programming features like arrays, user-defined functions, and full Object-Oriented Programming (classes, constructors, and methods).

3. It is Extensible: BSL allows you to easily load native C/C++ libraries (like .dll or .so files) directly into your script. If BSL doesn't have a feature you need, you can just plug it in!

4. It has a Built-in Package Manager: You can easily install extra libraries (like pipes) straight from your terminal using the bzg install command.