Sapphire is currently under active development.
The language is now focused on a grid-based rendering system, with a spreadsheet-like architecture already functional. Current work includes:
-
Making the syntax more flexible, including:
- Optional semicolons
- Automatic type inference
- Automatic number-to-string conversion
-
Language improvements and new features:
forloopsenumsconst- Vector2D and Vector3D
- Better error treatment
- General syntax and usability enhancements
-
What is already accomplished?
- Vector2D and Vector2d
- Solved the grid problem, it is working flawlessly.
- Automatic type inference, now just do: x = 10;
Current Development Version:* Sapphire v1.0.7 Check out the preview of 1.0.7! It is bundled with a simple raycaster made solely with Sapphire!
Sapphire is a hybrid programming language designed with a strong focus on:
- Performance
- Simplicity
- Clarity
It aims to combine the speed of compiled languages with the ease of use of high-level scripting, making it suitable for tools, UI-driven applications, and system-level tasks.
- Perform complex mathematical and logical expressions
- Declare variables, functions, classes, and arrays
- Build native UI systems easily
- Communicate with the operating system
- Handle HTTP, JSON, file I/O, and more
- Write clean, readable, and efficient code with minimal boilerplate
- C++ — Core language used to build the compiler and runtime
- CMake — Project build system
- SFML — Window creation and rendering
-
SapphireUI Native Immediate Mode GUI bundled directly with the executable
-
Arithmetic Operations From basic math to advanced operations via built-in Math functions
-
Garbage Collector Efficient Mark-and-Sweep GC implemented in C++
-
JSON Parsing Native JSON parsing support
-
HTTP Library Built-in HTTP features (ping, download, requests, etc.)
-
System Utilities File I/O, colored terminal output, debug tools, and more
-
Simple Declarations Easily declare functions, classes, and arrays (
ListUtil) -
Low Learning Curve Create a UI window in minutes
-
Built-in Layout Engine (WIP) Flexbox and grid-based layout system
-
Static Typing Designed for maximum performance
-
SVM (Sapphire Virtual Machine) Fast, custom-built virtual machine
-
Mine: Plugin Repository Download plugins directly from the Sapphire CLI
-
Bytecode Compilation Compile scripts into
.sbcbytecode -
Lightweight & Standalone Fully statically linked executable (~30 MB, no DLLs required)
Since the installer is still in development, installation is manual.
You may need:
- 7-Zip or WinRAR (optional, for extraction)
- Download the latest release from the repository
- Extract the archive
- Open the Sapphire root folder
- Add the
builddirectory to your system PATH - Open a new terminal
Run a script with:
Sapphire your_script.spThis executes the script using Sapphire’s hybrid interpreter.
string btnLabel = "Click here!";
UI.CreateStyle("BlueTheme", "#1a1a2e", "#e94560", "#0f3460", 2.0, "#16213e", 10.0, "Arial", 18);
function updateUI() void {
UI.Begin();
UI.PushStyle("BlueTheme");
UI.SetBGColor("#16213e");
UI.Text("Native UI!");
UI.Spacing();
if (UI.Button(btnLabel, 200.0, 50.0)) {
print "Button was clicked!";
}
UI.PopStyle();
UI.End();
}
while (true) {
updateUI();
}
(Use Windows Terminal for ANSI color support)
function main() void {
IO.printColor("cyan", "--- Starting Integration Test ---");
IO.printColor("yellow", "Fetching API data...");
string url = "http://jsonplaceholder.typicode.com/todos/1";
string response = HTTP.get(url);
if (len(response) > 0) {
IO.printColor("green", "HTTP Response received successfully!");
class data = JSON.parse(response);
IO.printColor("cyan", "Data ID:");
print data.id;
IO.printColor("cyan", "Title:");
print data.title;
string path = "backup_api.json";
IO.printColor("yellow", "Saving backup to disk...");
if (IO.writeFile(path, response)) {
IO.printColor("green", "File saved: " + path);
}
if (IO.exists(path)) {
IO.printColor("green", "Verification: File exists on disk.");
string localContent = IO.readFile(path);
IO.printColor("cyan", "Content read from file:");
print localContent;
}
} else {
IO.printColor("red", "Error: Could not connect to the API.");
}
IO.printColor("green", "--- Test Finished ---");
}
main();
Contributions are welcome!
You can help by:
- Reporting bugs
- Suggesting features
- Submitting pull requests
When opening an issue, please include:
- Clear description of the problem or suggestion
- Steps to reproduce (if applicable)
- Expected vs actual behavior
- Environment details (OS, compiler, etc.)
foxzyt
This project is licensed under the MIT License. Please steal my code.
See the LICENSE file for more information.