Development
Setting up your development environment for building Sabre
Required Dependencies
Sabre requires the following dependencies to be installed.
# Homebrew can install all required dependencies
brew install git cmake ninja llvmNote (Windows): Visual Studio with the "Desktop Development with C++" workload is required to build Sabre. This can be installed using the appropriate wizard or through WinGet:
winget install "Visual Studio Community 2022" --override "--add Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Component.Git " -s msstoreOptional Dependencies
The CMake build-system also allows for the use of ccache or sccache depending on your preference, which significantly speeds up builds.
# Darwin Systems
brew install sccache
# Linux Systems
sudo apt install sccache
# Windows Systems (sccache only)
choco install sccacheSabre optionally requires bun for building the VSC extension, and enabling better scripting tools (until Sabre can do so).
curl -fsSL https://bun.sh/install | bashBuilding Natively
After cloning the Sabre repository, the project can be built natively visually or programmatically.
Visually
The project can be built visually using Visual Studio Code (or VSCodium) and the CMake Tools extension. It is recommended to use the previously installed Clang compiler.
Programmatically
To build the project programmatically, the following command can be invoked:
bun run compileProject Structure
The Sabre language consists of multiple working components. It can be more simply described with the underlying project-structure:
<project>/
├── cmake/ - CMake Configurations
│ ├── mono/ - Monorepo CMake Utilities
│ └── sabre/ - Sabre CMake Utilities
├── configs/ - Various Configuration Files
├── docs/ - Core Documentation Markdown
├── examples/ - Brief Examples Directory
├── scripts/ - Platform Specific Scripts
├── source/ - Monorepo Source Directory
│ ├── crates/ - Sabre Standard Libraries
│ ├── shell/ - Sabre Command-Line Executable
│ ├── sabre/ - Sabre Runtime/Compiler Library
│ ├── testing/ - C++ Testing Entry-Point
│ ├── vscode/ - Visual Studio Code Extension
│ ├── website/ - Static Website Generator
│ ├── xasm/ - JIT Assembler Package
│ ├── xhash/ - Various Hashing Utilities
│ ├── xinv/ - Dependency Injection Package
│ ├── xjct/ - Executable Bundling Package
│ ├── xlsp/ - Language Server Package
│ ├── xpc/ - Subprocess/Shell Package
│ ├── xsio/ - Concurrency/Scheduler Package
│ ├── xtdlib/ - Standard Library Utilities
│ ├── xtest/ - Custom Testing Framework
├── syntaxes/ - Editor Syntax Grammars
└── tools/ - Extraneous Project ToolingIn particular, the source/ folder contains all the C++ monorepos packages necessary to construct the source/sabre/ runtime library and the source/shell/ command-line executable for Sabre. All packages that begin with a x..., such as xtdlib and xsio, are standalone monorepo packages used by the core runtime. The project was implemented this way to allow other developers to consume these packages as dependencies to other potential projects.