Installation & Setup
🛠 Prerequisites¶
-
Supported OS
-
Windows 10+
- macOS 10.14+
- Linux (glibc ≥ 2.17)
-
C++ Toolchain (for building plugins & from-source)
-
Windows: MSVC 2019+ or MinGW-w64
- macOS: Xcode command-line tools
- Linux:
g++(GCC 8+) - Optional: SQLite3 development headers (for DB support)
⬇️ Download & Install (Binaries)¶
- Get the latest release from GitHub: https://github.com/simulanics/CrossBasic/releases
- Extract into your preferred folder:
# Linux/macOS
tar -xzf crossbasic-1.2.3-linux.tar.gz -C ~/crossbasic
# Windows (PowerShell)
Expand-Archive crossbasic-1.2.3-win.zip -DestinationPath C:\CrossBasic
crossbasicc CLI): # Linux/macOS
echo 'export PATH="$HOME/crossbasic/bin:$PATH"' >> ~/.bashrc
# Windows (PowerShell)
[Environment]::SetEnvironmentVariable(
"Path", $Env:Path + ";C:\CrossBasic\bin", "User"
)
🚀 Build from Source¶
1. Clone Repository¶
2. Install Dependencies¶
- libffi (for cross-platform plugin & API calls)
- libcurl (optional, for web-based plugins)
- Git (https://git-scm.com/downloads)
On Windows, use the CrossBasicDevKit for all necessary libs. You’ll only need Git and Rust (if building Rust plugins).
3. Automated Build¶
Run the provided scripts:
# Linux/macOS
chmod +x build_crossbasic.sh build_plugins.sh
./build_crossbasic.sh
./build_plugins.sh
# Windows
build_crossbasic.bat
build_plugins.bat
4. Manual Build¶
Compile with optimizations:
5. Run a Script¶
Create test.xs:
Function AddTwoNumbers(num1 As Integer, num2 As Integer) As Integer
Return num1 + num2
End Function
Public Sub Main()
Dim result As Integer = AddTwoNumbers(2, 3)
Print Str(result)
End Sub
Main()
Compile & run:
🔍 Debugging¶
Enable verbose trace with --d true:
The detailed log covers lexing, parsing, compiling, VM execution, and plugin loading.
Happy coding with CrossBasic! 🚀