Start Here
What CK is, what it can do, and where to begin.
CalcKernel (CK) is a small programming language for writing focused calculations that can be used inside a larger program. A reusable piece of calculation like this is often called a kernel. The word sounds technical, but here it simply means a small job such as finding a total, calculating a price, or changing a list of numbers; it does not mean your computer's operating system.
You do not need special hardware or a computer science background to start learning CK. Begin with ordinary numbers, named steps, and simple choices. First, you will make a small program run on your computer. Later, you can learn how to share a calculation with another program.
What can I make with it?#
CK is useful when you want the calculation itself to be clear and predictable. You can write a step once, give it values, and get a result back. Examples include:
- calculating a total or average;
- applying a discount or score to one item;
- repeating the same calculation for many items;
- providing a small calculation for an existing application to call.
CK focuses on calculations. It does not currently handle screens, websites, files, or general text input and output. A larger app can handle those parts and call a CK calculation when it needs one.
When you build a program for your computer, CK generates native machine code: the instructions your processor can run directly. CK can also optimize repeated calculations when a particular loop is suitable for it. See Performance for a plain-language introduction.
Your first look at CK#
This complete program multiplies a number and prints the result:
fn main() -> i32 {
let answer: i32 = 6 * 7;
print_i32(answer);
print_newline();
return 0;
}
It prints 42. main is where the program starts when you run it. answer is a name for a whole number, and the last three lines show it, move to a new line, and report that the program finished successfully. The first-program tutorial walks through each step, including how to save and run this file.
The beginner path#
- Get started: download the compiler and run your first program, step by step.
- Learn the language: work through numbers, variables, functions, choices, and repetition.
- Try short exercises: make a few small changes and check what they do.
When you are ready for more#
You can later learn how CK connects to other programs and output formats in Backends, or look up individual commands in the CLI reference. Memory & Safety explains how to share data with a host program. Compiler internals and profile-guided builds are advanced topics; they are not needed to write your first CK program.
For the full language rules, see the language reference.
Repository reference links follow the main branch and may describe features newer than the latest downloadable release.