Skip to content

Files

Latest commit

d3f9979 · Apr 30, 2025

History

History

kclvm

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 27, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 30, 2025
Apr 18, 2025
Apr 18, 2025
Mar 10, 2025
Feb 5, 2025
Apr 28, 2025
Jul 29, 2024
Apr 18, 2025
Apr 18, 2025
Apr 18, 2025
Apr 27, 2025
Apr 18, 2025
Dec 4, 2023
Apr 27, 2025
Jul 27, 2022

KCLVM

A high-performance implementation of KCL written in Rust that uses LLVM as the compiler backend.

Building and Testing

Firstly, see KCLVM CONTRIBUTING to build KCLVM. Secondly, we need to download the Rust, SWIG, LLVM 12, and add the LLVM installation location to LLVM_SYS_120_PREFIX and the $PATH.

export LLVM_SYS_120_PREFIX=<your LLVM 12 install location>
export PATH=<your LLVM 12 install location>/bin:$PATH

To build everything, run:

make

After building, we can add the following command line parameters to use the KCL high-performance version:

kclvm_cli run main.k

To test, run:

make test

Building and Testing in Docker

  1. make -C .. sh-in-docker
  2. make build
  3. export PATH=$PATH:/root/kclvm/_build/dist/ubuntu/kclvm/bin
  4. kcl ./samples/hello.k
  5. cd kclvm && make test

IDE

You can choose any IDE you like for development, but we recommend a combination of VS Code and the rust-analyzer plugin.

Notes

  1. If you wanna start over, you MUST clean up all cached building files, such as LLVM build files, kclvm/target, etc.
  2. If your updating-cargo-index is extremely slow, setup ~/.cargo/config file.
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'

[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"