Caution
SLEAF is currently in active alpha development. While core functionality is stable, some advanced features are still evolving. Production use requires thorough testing.
sleaf-llvm is a statically-typed systems programming language compiler targeting LLVM IR. The implementation provides:
- LLVM 19 Backend: Direct IR generation via C++ API
- Modern C++20 Codebase: Leveraging metaprogramming and template features
- Cross-Platform Support: Generates binaries for Windows/Linux/macOS
- Modular Architecture: Separated lexer/parser/IR generation components
Current Status: Alpha development (v0.1.0). Core compilation pipeline functional. Not production-ready.
graph LR
A[Source Code] --> B[Lexer]
B --> C[Parser]
C --> D[AST Generation]
D --> E[IR Generation]
E --> F[LLVM Optimization]
F --> G[Machine Code]
// SLEAF example code
func main() -> i32 {
const string hello = "Hello, World!";
printf("%s\n", hello);
return 0;
}
Component | Minimum Version | Notes |
---|---|---|
LLVM | 19.x | Development libraries required |
Clang | 15.0+ | C++20 support mandatory |
CMake | 3.20+ | Build system |
Python | 3.8+ | Scripting utilities |
# Clone repository with submodules
git clone --recurse-submodules https://github.com/alexeev-prog/sleaf-llvm.git
cd sleaf-llvm
# Build full project
./build.sh all
./build/bin/sleafllvm -h
Please, build and install lib. Instruction here.
You also can read Hacking
Feature | Technical Implementation | Performance Impact |
---|---|---|
LLVM19 Backend | Direct LLVM IR generation via C++ API | Near-native execution speed, advanced optimizations |
Cross-Platform | Single IR β Windows/Linux/macOS binaries | Consistent behavior across platforms |
- Lexer
- Parser
- AST
- Codegen
- Basic Codegen
- Variables, const, create and set, types.
- Export printf function
- IR>bin
- VSCode Extension
- Standard library
- Package manager
"We reject the false choice between performance and expressiveness. We reject the old methods imposed by backward compatibility with long-dead legacy products. SLEAF is a new era in researching programming that combines the simplicity of classic C-syntax with the functionality of C/C++. Thanks to the purity of the project and its versatility, you can create anything and everything you want."
We welcome contributions! Please see CONTRIBUTING.md for guidelines. Key areas for contribution include:
- Additional test cases for thread-local scenarios
- Performance optimization proposals
- Extended version format support
- IDE integration plugins
- Issue Tracking - Report bugs via GitHub Issues
- Pull Requests - Follow CONTRIBUTING.md
- Code Standards - Adhere to specifications
- Performance - Validate changes with benchmarks
- Documentation - Update relevant documentation
This project is licensed under GNU GPL 3.0 License - see LICENSE. For commercial support and enterprise features, contact [email protected].
Explore Documentation | Report Issue | View Examples
System programming language made with C++ & LLVM
Copyright (C) 2025 Alexeev Bronislav
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Copyright Β© 2025 Alexeev Bronislav. Distributed under GNU GPL 3 license
β Back to Top βMade with LLVM 19