← Back
luxine

luxine/CalcKernel

CalcKernel compiler, runtime, tests, examples, documentation, and public releases

View on GitHub ↗https://calckernel.org ↗
compilerprogramming-languagerustwebassembly
Stars
157
Forks
4
Watchers
157
Open issues
0
Contributors
2
Language
Rust
License
MIT License
Default branch
main
Created Sep 27, 2026Updated Oct 1, 2026

Star growth

Today—
This week—
This month—

Star history will appear here once this repo has been tracked for a couple of days.

README

CalcKernel

Website · Get started · Documentation · Download · VS Code extension · Performance measurements · MIT license

CalcKernel (CK) is a statically typed language for numerical computation kernels: focused calculations that can be called from a larger application. Write a .ck source file and use ckc to check, run, or build it. CK can produce native programs and libraries, or emit C and WebAssembly for integration with existing systems.

CK is designed to handle the calculation while your application keeps responsibility for the surrounding work, such as user interfaces, input and output, and data storage. Its typed function interfaces and caller-owned data slices make that boundary explicit.

The latest stable release is 0.15.2, a WebAssembly performance and correctness update.

Why CalcKernel

  • Focused numerical code. Express calculations with typed functions, structures, integer and floating-point values, conditions, and loops.
  • Native builds. Compile CK programs and libraries to native machine code, with compiler optimizations for eligible calculations.
  • Flexible integration. Build a native library with a C ABI, or emit C source or a WebAssembly module.
  • WebAssembly optimization. O3 can use guarded bulk-memory operations for eligible copies and byte fills. The opt-in simd128 profile vectorizes supported array maps and integer reductions; unsupported cases keep scalar code.
  • Explicit data ownership. Applications provide and retain ownership of memory passed to CK. Native and C builds can also enable integer-overflow and slice-bounds checks.

Start using CK

  1. Download the compiler for your system.
  2. Follow the first-program tutorial to create and run a CK program.
  3. Use any text editor, or install the optional CalcKernel extension for Visual Studio Code.

The extension provides CK syntax support, live diagnostics, code navigation, and commands to check, run, and build the current file. See the VS Code guide for setup details.

Learn more

  • Language introduction
  • Full documentation
  • Performance guide and measurements
  • Performance chart
  • Source code

Performance depends on the algorithm, implementation, libraries, and target machine. The linked measurements describe specific workloads and are not a general ranking of languages.

Build from source

The default feature set builds and tests the frontend, C, and WebAssembly components without LLVM:

cargo test --locked
cargo build --release --locked

Native builds require the pinned static LLVM prefix specified in native/llvm/manifest.toml. The bootstrap script checks the source archive's SHA-256 before building it:

rustc_host="$(rustc -vV | sed -n 's/^host: //p')"
llvm_archive="$PWD/llvm-project-22.1.8.src.tar.xz"
curl -fL 'https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.8/llvm-project-22.1.8.src.tar.xz' -o "$llvm_archive"
llvm_prefix="$PWD/build/llvm/prefix-$rustc_host-release"
./scripts/bootstrap-llvm.sh --archive "$llvm_archive" \
  --prefix "$llvm_prefix" --target "$rustc_host" --profile release
CKC_LLVM_PREFIX="$llvm_prefix" cargo build --release --features native-toolchain --locked

This prefix is needed to build CalcKernel's Native feature; release binaries do not require it at runtime. Windows MSVC build requirements are described in the getting-started guide.

Community

Contributions are welcome. Please read the contributing guide, security policy, and code of conduct.

License

CalcKernel is distributed under the MIT License.