Lesma is a compiled, statically typed, imperative, and object-oriented programming language with a focus on expressiveness, elegance, and simplicity without sacrificing performance.
- π Fast Compilation: compiling at a rate of β230k loc/s, because waiting for code to compile is a thing of the past
- β‘ Blazing Fast Execution: because it should be, it's as fast as C, using LLVM's state-of-the-art optimizations, but it won't ever oblige you to make an extra effort just for the sake of performance
- π¬ Statically Typed: because IDE completion is like heaven, while unknown behaviour and runtime exceptions are like hell
- π§βπ¨ Simple: because the code should be easily readable, and it shouldn't make you guess what it does or take long to learn
Every Lesma release contains archives with the binary and standard library which you can grab. Alternatively, you can use the installer script to do all the work for you. The get-lesma.sh script downloads and installs the latest release.
Run the following in your terminal:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/alinalihassan/Lesma/main/scripts/get-lesma.sh)"In order to build Lesma, you need Clang, LLVM (17+), vcpkg, and Ninja installed. It's currently only supported on Linux and macOS. For a more comprehensive guide, and more information on how to install the prerequisites, read the documentation on Getting Started
Required:
- CMake 3.24+
- Ninja
- Clang
- LLVM 17+ (with Clang)
- vcpkg
vcpkg is used to manage C++ dependencies. Install it in your home directory or another location:
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
cd ~/vcpkg
./bootstrap-vcpkg.sh # On Linux/macOSThen set the VCPKG_ROOT environment variable (add to your shell profile for persistence):
export VCPKG_ROOT="$HOME/vcpkg"
export PATH="$VCPKG_ROOT:$PATH"brew install llvm
export LLVM_DIR=$(brew --prefix llvm)/lib/cmake/llvm
export Clang_DIR=$(brew --prefix llvm)/lib/cmake/clang# Ubuntu/Debian
sudo apt-get install llvm-dev clang libclang-dev
# Or for a specific version (e.g., LLVM 17)
sudo apt-get install llvm-17-dev clang-17 libclang-17-devThis option builds LLVM from source using vcpkg. It takes significant time (~1-2 hours) but works on any platform.
# Configure with LLVM build enabled
cmake . -Bbuild -DLESMA_BUILD_LLVM=ON -G Ninja
cmake --build build-
Clone the repository
git clone https://github.com/alinalihassan/Lesma cd Lesma -
(Optional) Create a local CMake user preset for your vcpkg installation
cp CMakeUserPresets.json.example CMakeUserPresets.json # Edit CMakeUserPresets.json to set your VCPKG_ROOT pathIf
VCPKG_ROOTis already set in your environment, you can skip this step. -
Run CMake to configure and build
# Using presets (recommended) cmake --preset Debug cmake --build --preset Debug # Or manually cmake . -Bbuild -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -G Ninja cmake --build build
-
Run tests (optional)
cd build/Debug # or build/Release ctest --output-on-failure
Pull requests are welcome. For major changes, please open an issue to discuss your proposal and what you'd like to change.
- To keep updated with releases, consider starring the project.
- Check the code of conduct and contributing guidelines
This software is licensed under the MIT Β© Alin Ali Hassan.