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.
- 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
simd128profile 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.
- Download the compiler for your system.
- Follow the first-program tutorial to create and run a CK program.
- 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.
- 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.
The default feature set builds and tests the frontend, C, and WebAssembly components without LLVM:
cargo test --locked
cargo build --release --lockedNative 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 --lockedThis 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.
Contributions are welcome. Please read the contributing guide, security policy, and code of conduct.
CalcKernel is distributed under the MIT License.