Bulk memory in baseline
The baseline Wasm profile permits bulk-memory operations for array copies and fills.
THE CALCKERNEL LANGUAGE
CalcKernel (CK) is a statically typed language for focused numerical workloads. It compiles CK programs to native machine code, with C and WebAssembly outputs for integration into existing systems.
CK is designed for small, compute-heavy routines embedded in larger applications. Its type system, defined numeric rules, and explicit data interfaces help developers reason about what a kernel reads, changes, and returns.
Function signatures name each input and result type. CK checks calls and assignments while you compile.
fn scale(x: f64) -> f64Learn more 02 / 04Conversions are explicit and floating-point rules are defined. Checked integer overflow is available in Native and C builds.
i32 · f64 · checkedLearn more 03 / 04A typed slice carries an address and length. Your application supplies and owns the memory that a kernel reads or updates.
slice<f64> · data · lenLearn more 04 / 04Build a Native executable or library, emit C with an ABI header, or produce a WebAssembly module for a compatible runtime.
Native · C ABI · WasmLearn more This kernel scales each value in a caller-provided f64 slice by a factor. The typed input and in-place update make the data boundary clear; the compiler only applies transformations when their correctness conditions and the target allow them.
Explore the languageexport fn scale(
values: slice<f64>,
factor: f64
) -> void {
let i: u32 = 0;
while i < values.len {
values[i] = values[i] * factor;
i = i + 1;
}
}slice<f64> · while · export fnChoose a workload to see the original comparison alongside new WASM measurements.
1,048,576 u32 values · sequential sum modulo 2³²
| Language | Median per call | Speedup vs JavaScript |
|---|---|---|
| CK Native | 0.0357 ms | 7.1x |
| Rust | 0.0356 ms | 7.1x |
| C++ | 0.0356 ms | 7.1x |
| Java | 0.2312 ms | 1.1x |
| JavaScript (Node.js) | 0.2518 ms | 1.0x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Rust WASM | 0.2533 ms | 1.0x |
| CK WASM | 0.2563 ms | 0.99x |
| Clang WASM | 0.2548 ms | 0.99x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Clang WASM | 0.1233 ms | 1.0x |
| CK WASM | 0.1241 ms | 0.99x |
| Rust WASM | 0.1242 ms | 0.99x |
v0.15.1: JavaScript = 1.0x · strict WASM: faster compatible same-profile Clang/Rust = 1.0x · Apple M5 Max · compressed bar scale. Times and ratios across reports are not directly comparable. Strict timings were not measured with the official v0.15.2 binary. CK WASM includes Node.js call time; setup and input copy are excluded.
256 × 256 f64 matrices · row, inner, column loop order; no BLAS
| Language | Median per call | Speedup vs JavaScript |
|---|---|---|
| CK Native | 1.9950 ms | 5.2x |
| C++ | 1.9798 ms | 5.2x |
| Rust | 2.0394 ms | 5.1x |
| Java | 3.4306 ms | 3.0x |
| JavaScript (Node.js) | 10.3170 ms | 1.0x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| CK WASM | 3.5093 ms | 1.0x |
| Clang WASM | 3.6087 ms | 1.0x |
| Rust WASM | 7.1704 ms | 0.50x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Clang WASM | 2.5720 ms | 1.0x |
| Rust WASM | 2.6213 ms | 0.98x |
| CK WASM | 2.6415 ms | 0.97x |
v0.15.1: JavaScript = 1.0x · strict WASM: faster compatible same-profile Clang/Rust = 1.0x · Apple M5 Max · compressed bar scale. Times and ratios across reports are not directly comparable. Strict timings were not measured with the official v0.15.2 binary. CK WASM includes Node.js call time; setup and input copy are excluded.
1024 × 1024 f64 pixels · Gaussian weights, zero border
| Language | Median per call | Speedup vs JavaScript |
|---|---|---|
| CK Native | 0.5494 ms | 5.1x |
| C++ | 0.9910 ms | 2.8x |
| Rust | 1.4008 ms | 2.0x |
| Java | 1.7006 ms | 1.7x |
| JavaScript (Node.js) | 2.8178 ms | 1.0x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| CK WASM | 1.1388 ms | 1.0x |
| Clang WASM | 1.1821 ms | 1.0x |
| Rust WASM | 1.7024 ms | 0.69x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| CK WASM | 0.7476 ms | 1.0x |
| Rust WASM | 0.7557 ms | 1.0x |
| Clang WASM | 1.1787 ms | 0.64x |
v0.15.1: JavaScript = 1.0x · strict WASM: faster compatible same-profile Clang/Rust = 1.0x · Apple M5 Max · compressed bar scale. Times and ratios across reports are not directly comparable. Strict timings were not measured with the official v0.15.2 binary. CK WASM includes Node.js call time; setup and input copy are excluded.
262,144 f64 values · degree-seven Horner evaluation
| Language | Median per call | Speedup vs JavaScript |
|---|---|---|
| CK Native | 0.1222 ms | 2.0x |
| C++ | 0.1219 ms | 2.0x |
| Rust | 0.1226 ms | 2.0x |
| JavaScript (Node.js) | 0.2443 ms | 1.0x |
| Java | 0.2444 ms | 1.00x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| CK WASM | 0.2356 ms | 1.0x |
| Clang WASM | 0.2420 ms | 1.0x |
| Rust WASM | 0.2427 ms | 1.00x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Rust WASM | 0.1258 ms | 1.0x |
| Clang WASM | 0.1261 ms | 1.00x |
| CK WASM | 0.1265 ms | 0.99x |
v0.15.1: JavaScript = 1.0x · strict WASM: faster compatible same-profile Clang/Rust = 1.0x · Apple M5 Max · compressed bar scale. Times and ratios across reports are not directly comparable. Strict timings were not measured with the official v0.15.2 binary. CK WASM includes Node.js call time; setup and input copy are excluded.
1,048,576 deterministic points · π hit count, including RNG
| Language | Median per call | Speedup vs JavaScript |
|---|---|---|
| Java | 1.0429 ms | 3.9x |
| CK Native | 2.0477 ms | 2.0x |
| Rust | 2.0393 ms | 2.0x |
| C++ | 2.0498 ms | 2.0x |
| JavaScript (Node.js) | 4.0760 ms | 1.0x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Rust WASM | 1.1140 ms | 1.0x |
| Clang WASM | 1.1172 ms | 1.00x |
| CK WASM | 1.1388 ms | 0.98x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Clang WASM | 1.1118 ms | 1.0x |
| Rust WASM | 1.1172 ms | 1.00x |
| CK WASM | 1.1359 ms | 0.98x |
v0.15.1: JavaScript = 1.0x · strict WASM: faster compatible same-profile Clang/Rust = 1.0x · Apple M5 Max · compressed bar scale. Times and ratios across reports are not directly comparable. Strict timings were not measured with the official v0.15.2 binary. CK WASM includes Node.js call time; setup and input copy are excluded.
262,144 f64 values · one loop combines multiply, add, and subtract
| Language | Median per call | Speedup vs JavaScript |
|---|---|---|
| CK Native | 0.0499 ms | 2.0x |
| C++ | 0.0499 ms | 2.0x |
| Rust | 0.0500 ms | 2.0x |
| Java | 0.0916 ms | 1.1x |
| JavaScript (Node.js) | 0.0978 ms | 1.0x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Clang WASM | 0.1070 ms | 1.0x |
| Rust WASM | 0.1085 ms | 0.99x |
| CK WASM | 0.1161 ms | 0.92x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| CK WASM | 0.0675 ms | 1.0x |
| Clang WASM | 0.0698 ms | 1.0x |
| Rust WASM | 0.0699 ms | 1.00x |
v0.15.1: JavaScript = 1.0x · strict WASM: faster compatible same-profile Clang/Rust = 1.0x · Apple M5 Max · compressed bar scale. Times and ratios across reports are not directly comparable. Strict timings were not measured with the official v0.15.2 binary. CK WASM includes Node.js call time; setup and input copy are excluded.
8,388,608 f64 values · 128 MiB input plus output streaming transform
| Language | Median per call | Speedup vs JavaScript |
|---|---|---|
| CK Native | 1.0922 ms | 1.8x |
| C++ | 1.0888 ms | 1.8x |
| Rust | 1.0892 ms | 1.8x |
| Java | 1.2688 ms | 1.5x |
| JavaScript (Node.js) | 1.9619 ms | 1.0x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Clang WASM | 1.6348 ms | 1.0x |
| Rust WASM | 1.6670 ms | 0.98x |
| CK WASM | 1.7009 ms | 0.96x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| CK WASM | 1.2464 ms | 1.1x |
| Clang WASM | 1.3770 ms | 1.0x |
| Rust WASM | 1.3875 ms | 0.99x |
v0.15.1: JavaScript = 1.0x · strict WASM: faster compatible same-profile Clang/Rust = 1.0x · Apple M5 Max · compressed bar scale. Times and ratios across reports are not directly comparable. Strict timings were not measured with the official v0.15.2 binary. CK WASM includes Node.js call time; setup and input copy are excluded.
1024-vertex dense graph · O(V²) minimum selection
| Language | Median per call | Speedup vs JavaScript |
|---|---|---|
| CK Native | 2.2883 ms | 1.7x |
| C++ | 2.2825 ms | 1.7x |
| Java | 2.3657 ms | 1.7x |
| Rust | 2.3675 ms | 1.7x |
| JavaScript (Node.js) | 3.9375 ms | 1.0x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Clang WASM | 2.5771 ms | 1.0x |
| Rust WASM | 2.6047 ms | 0.99x |
| CK WASM | 2.7245 ms | 0.95x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Rust WASM | 2.6271 ms | 1.0x |
| Clang WASM | 2.6547 ms | 0.99x |
| CK WASM | 2.7301 ms | 0.96x |
v0.15.1: JavaScript = 1.0x · strict WASM: faster compatible same-profile Clang/Rust = 1.0x · Apple M5 Max · compressed bar scale. Times and ratios across reports are not directly comparable. Strict timings were not measured with the official v0.15.2 binary. CK WASM includes Node.js call time; setup and input copy are excluded.
262,144 f64 values · four ordered branches
| Language | Median per call | Speedup vs JavaScript |
|---|---|---|
| C++ | 0.2207 ms | 6.2x |
| Rust | 0.8266 ms | 1.7x |
| CK Native | 0.8360 ms | 1.6x |
| JavaScript (Node.js) | 1.3766 ms | 1.0x |
| Java | 1.3771 ms | 1.00x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| CK WASM | 0.3102 ms | 3.8x |
| Rust WASM | 1.1857 ms | 1.0x |
| Clang WASM | 1.1943 ms | 0.99x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| CK WASM | 0.1342 ms | 1.1x |
| Rust WASM | 0.1464 ms | 1.0x |
| Clang WASM | 1.2204 ms | 0.12x |
v0.15.1: JavaScript = 1.0x · strict WASM: faster compatible same-profile Clang/Rust = 1.0x · Apple M5 Max · compressed bar scale. Times and ratios across reports are not directly comparable. Strict timings were not measured with the official v0.15.2 binary. CK WASM includes Node.js call time; setup and input copy are excluded.
262,144 f64 values · min–max normalization in two passes
| Language | Median per call | Speedup vs JavaScript |
|---|---|---|
| CK Native | 0.1599 ms | 1.3x |
| Rust | 0.1612 ms | 1.2x |
| JavaScript (Node.js) | 0.2009 ms | 1.0x |
| Java | 0.2405 ms | 0.84x |
| C++ | 0.2877 ms | 0.70x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| CK WASM | 0.1797 ms | 1.1x |
| Clang WASM | 0.1954 ms | 1.0x |
| Rust WASM | 0.2028 ms | 0.96x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| CK WASM | 0.1472 ms | 1.1x |
| Clang WASM | 0.1669 ms | 1.0x |
| Rust WASM | 0.1739 ms | 0.96x |
v0.15.1: JavaScript = 1.0x · strict WASM: faster compatible same-profile Clang/Rust = 1.0x · Apple M5 Max · compressed bar scale. Times and ratios across reports are not directly comparable. Strict timings were not measured with the official v0.15.2 binary. CK WASM includes Node.js call time; setup and input copy are excluded.
262,144 f64 pairs · ascending-index accumulation
| Language | Median per call | Speedup vs JavaScript |
|---|---|---|
| CK Native | 0.1273 ms | 1.2x |
| C++ | 0.1266 ms | 1.2x |
| Rust | 0.1272 ms | 1.2x |
| Java | 0.1312 ms | 1.1x |
| JavaScript (Node.js) | 0.1489 ms | 1.0x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Clang WASM | 0.1537 ms | 1.0x |
| Rust WASM | 0.1539 ms | 1.00x |
| CK WASM | 0.1671 ms | 0.92x |
| Language | Median per call | Throughput vs faster Clang/Rust reference |
|---|---|---|
| Rust WASM | 0.1537 ms | 1.0x |
| Clang WASM | 0.1537 ms | 1.00x |
| CK WASM | 0.1664 ms | 0.92x |
v0.15.1: JavaScript = 1.0x · strict WASM: faster compatible same-profile Clang/Rust = 1.0x · Apple M5 Max · compressed bar scale. Times and ratios across reports are not directly comparable. Strict timings were not measured with the official v0.15.2 binary. CK WASM includes Node.js call time; setup and input copy are excluded.
The same fixed inputs for every displayed implementation.
| Language | Median per call | Speedup vs tuned JavaScript |
|---|---|---|
| CK | 1.8697 ms | 5.4x |
| C++ | 1.8661 ms | 5.4x |
| Rust | 1.8935 ms | 5.3x |
| Java | 3.1163 ms | 3.2x |
| JavaScript | 10.0876 ms | 1.0x |
Historical same-machine cross-runtime view · tuned variants only · JavaScript = 1.0x. This earlier report predates the v0.15.1 suite and contains no CK Wasm result. NumPy is omitted because it delegates matrix multiplication to Apple Accelerate.
Apply the same nine-point weighted filter to every interior pixel; border pixels are zero.
| Language | Median per call | Speedup vs tuned JavaScript |
|---|---|---|
| C++ | 0.5323 ms | 4.1x |
| Rust | 0.5477 ms | 4.0x |
| CK | 0.5972 ms | 3.7x |
| Java | 1.0417 ms | 2.1x |
| JavaScript | 2.2031 ms | 1.0x |
| NumPy | 3.4438 ms | 0.64x |
Historical same-machine cross-runtime view · tuned variants only · JavaScript = 1.0x. This earlier report predates the v0.15.1 suite and contains no CK Wasm result. The NumPy result is retained for this image-blur workload.
CK is designed for numerical kernels embedded in a larger system: data transforms, repeated scoring or simulation, and other compute-heavy routines. Keep the data contract at the boundary and let the host application handle orchestration, storage, and user-facing features.
Normalize, scale, or otherwise process numeric arrays supplied by the caller.
slice<f64> → valuesExpress repeated domain calculations with typed inputs, explicit branches, and predictable numeric rules.
score(input) → f64Package the same focused computation as a Native library, C interface, or WebAssembly module.
Native · C ABI · WasmCK focuses on computation kernels. The host application owns memory and handles I/O, networking, and presentation around them.
v0.15.2 improves eligible WebAssembly kernels while preserving strict floating-point behavior, safety proofs, and the caller-owned-memory ABI.
The baseline Wasm profile permits bulk-memory operations for array copies and fills.
At O3 with simd128 enabled, eligible contiguous maps and reductions can use vector instructions; other loops keep scalar code.
Schema 2 records the selected Wasm profile and its digest so hosts can check compatibility.
The existing caller-owned-memory ABI stays the same, so the host continues to own and pass the data.
Keep your application in the tools you know. Use CK where a focused numerical kernel has a clear job and a clear boundary.
Use them when they already fit your project. CK is a narrower language for numerical kernels: one source can become a Native library, C source, or WebAssembly module for an existing host. That focused boundary is the advantage; measure your workload before choosing on speed.
See the measurementsLook for a repeated calculation that profiling shows is costly, with numeric inputs and a boundary you can describe clearly. It is most useful when that kernel must also be shared across applications or targets.
Explore output optionsExport a CK function, build a module, then call it through a host interface. Node.js can load WebAssembly; Python and Rust can call a Native library through its generated C ABI. The host still owns data and memory.
Read the language overview, run a first kernel, then compare results using the same inputs and target machine.
Writing CK in VS Code? Get highlighting, live diagnostics, completion, and navigation. Explore the extension