BSL Quick Start

Now that you have BSL successfully installed on your system, it is time to learn how to interact with the interpreter, set up your code editor, and write your very first script.

BSL CLI Basics

The primary way you will interact with BSL is through your system's Command Line Interface (CLI), such as Command Prompt on Windows or Terminal on Linux/macOS. When you install BSL, it registers the bonezegei command globally on your system. Here are the three most important commands you need to know:

1. Checking the Version
To verify that BSL is installed correctly and check which version you are running, use the --version flag.

bonezegei --version

2. Running Inline Scripts
You don't always need to create a file to test BSL code. You can run small snippets of code directly from your terminal using the --inline flag.

bonezegei --inline "print(\"Running BSL directly from the terminal!\");"

3. Executing .bzg Files
This is how you will run your actual programs. Once you have written a BSL script and saved it with the .bzg extension, you pass the file name to the interpreter to execute it.

bonezegei myscript.bzg

BSL Development Environment

While you can write BSL code in any basic text editor like Notepad, using a dedicated code editor will make your development process much smoother. Using Visual Studio Code (VS Code) is highly recommended.

To get the best experience:
1. Download and install Visual Studio Code.
2. Open VS Code and navigate to the Extensions tab (or press Ctrl+Shift+X).
3. Search for the "Bonezegei Scripting Language Formatter" extension.
4. Click Install.

This extension provides syntax highlighting, auto-formatting, and snippet suggestions specifically tailored for BSL, making your code easier to read and write.

BSL Hello World

It is a long-standing tradition in computer science that your first program in a new language should simply print "Hello World" to the screen. Let's write yours!

1. Open VS Code and create a new file named hello.bzg.
2. Type the following code exactly as shown:

// Try it Yourself:

print("Hello, Bonezegei!");

3. Save the file.
4. Click "Run Script" on the upper right of the editor or open your terminal, navigate to the folder where you saved hello.bzg, and run the following command:

bonezegei hello.bzg

Output

Hello, Bonezegei!

Congratulations! You have successfully configured your environment and written your first BSL program.