Environment setup
Environment setup
Please download the program package from the official website. There are two files in the package, one bt program and one bt-app program.
-
btis a BT language interpreter, used to compile and run BT language programs. -
bt-appis a BT desktop application engine (built-in BT language interpreter) for desktop software development.
If you need to develop Web projects and API interfaces, you only need bt. If you need to develop desktop application projects, you only need bt-app.
You can keep the interpreter beside your project and run it directly, or install it for your user account as described below. A plain text editor is sufficient to write BT programs.
Install the interpreter
Availability: the installation commands below are pending the next release and require a build containing this feature. Existing release downloads may not yet support them.
Function
Explicitly install the currently running interpreter into a fixed user directory, configure the user PATH, and register .bt files for desktop execution. Installation is optional and does not require an administrator account. Opening the interpreter or running a script never installs or updates BT automatically.
Syntax
In Windows PowerShell, run from the extracted directory:
.\bt.exe install
On Linux or macOS, run from the extracted directory:
./bt install
If necessary, first grant execution permission with chmod +x bt. The equivalent alias is ./bt --install or .\bt.exe --install. At the bt> interactive prompt, enter install or --install without the executable prefix.
Parameters
| Command | Arguments | Meaning |
|---|---|---|
bt install | None | Install or update the currently running interpreter for this user. |
bt --install | None | Equivalent alias for interpreter installation. |
bt install <name> [version] [--project <dir>] | An extension name is required. Version and project directory are optional. | Install an official extension; see extension installation. |
Interpreter installation accepts no destination or version parameter. To upgrade, run the installation command from the downloaded newer interpreter; it does not download another interpreter version.
Result
The command reports installation or retention of the existing interpreter and platform integration results. Failures are reported in the terminal. It is a command-line operation and does not return a BT language value.
| Platform | Installed interpreter | Desktop integration |
|---|---|---|
| Windows | %USERPROFILE%\.bt\bin\bt.exe | User registry entries for PATH and .bt file associations. |
| Linux | ~/.local/bin/bt | User shell PATH; a terminal .desktop launcher and MIME association when a desktop session is available. Headless systems skip desktop integration. |
| macOS | ~/.bt/bin/bt | User shell PATH; generated ~/Applications/BT.app receives .bt files from Finder and opens Terminal. |
Open a new terminal after installation so it can load the updated PATH. The interpreter remains an independent binary. On macOS, BT.app is a generated desktop helper, not the bt-app desktop application runtime; the download ZIP does not need to contain this helper.
Example
Save this as demo.bt:
// Output: hello BT print 'hello BT'
After installation, open a new terminal and execute bt demo.bt. You can also select BT as the default application for .bt files and double-click demo.bt: a terminal displays the output and waits for Enter after the script finishes. See usage.
Notes
- A missing installed interpreter is copied from the running executable. A newer semantic version replaces the installed binary; the same or an older version preserves it. A downloaded older interpreter still runs its own version when opened directly. File associations use the fixed installed path.
- On Windows, an installed interpreter that is still in use may be locked. A failed replacement preserves it; close programs using the installed BT and retry installation from the downloaded interpreter. The installer does not forcibly terminate running programs.
- On Linux/macOS, a manually changed installer-managed
PATHblock is reported for repair rather than overwritten. File or profile permissions can leave installation only partly configured. Correct the reported problem and reruninstallto complete integration. - User
PATHmakesbtdiscoverable in a terminal; file associations separately enable double-click execution. Another executable earlier in the terminal's search path may still take precedence; use the full installed path when selecting an exact interpreter. - The operating system may require you to choose BT as the default application once. Existing explicit user choices are respected. Linux double-click execution requires a desktop environment and a compatible terminal; macOS may require permission for the helper to control Terminal.
- Ordinary invocations perform no installation-directory, installed-version, or installation-related
PATHchecks and add no exit pause. Only explicitinstallor--installstarts installation. - Desktop execution waits for Enter after normal completion, errors, or
exit(). It does not edit the source or appendpause(); it does not pause a still-running service or protect against closing the terminal itself.
Code editor:
VS Code + bt-lang extension: open the bt-lang extension directly in VS Code.
bt-lang extension support:
- Support BT language keywords, functions, strings, etc. highlighting
- Intelligent code completion and context-aware completion
- Display the parameter list and current parameter position when calling a function
- Support cross-file function jumps to quickly locate definition locations
- Automatically scan and index functions in all BT files
- Automatically identify and parse function definitions in include files
- Display the function structure of the current file in the sidebar
- Support system function prompts and automatic completion
- Quickly execute the BT program in the current workspace
Other editors:
-
HBuilderX+bt-lang extension: install it from the HBuilderX plugin marketplace. -
Sublime Text+bt-lang extension: download it from GitHub and place it under[installation directory\Data\Packages].