Skip to content

alexeev-prog/sleaf-llvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

🌿 sleaf-llvm

System programming language made with C++ & LLVM


Static Analysis CI Build
Color Palette

Caution

SLEAF is currently in active alpha development. While core functionality is stable, some advanced features are still evolving. Production use requires thorough testing.

πŸš€ Technical Overview

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]
Loading

Examples

Hello World

// SLEAF example code
func main() -> i32 {
    const string hello = "Hello, World!";

    printf("%s\n", hello);
    return 0;
}

πŸ“¦ Installation & Usage

System Requirements

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

Build Instructions

# 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

How To Use

Please, build and install lib. Instruction here.

You also can read Hacking

Core Technical Features

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

Plans

  • Lexer
  • Parser
  • AST
  • Codegen
    • Basic Codegen
    • Variables, const, create and set, types.
    • Export printf function
  • IR>bin
  • VSCode Extension
  • Standard library
  • Package manager

SLEAF Manifesto

"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."

Contributing

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

Contribution Guidelines

  1. Issue Tracking - Report bugs via GitHub Issues
  2. Pull Requests - Follow CONTRIBUTING.md
  3. Code Standards - Adhere to specifications
  4. Performance - Validate changes with benchmarks
  5. Documentation - Update relevant documentation

License & Support

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

βš–οΈ License

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