Kavach Home
Also known as: what is kavach compiled interpreted scripting language static typing garbage collector overview introduction
● Beginner4 min
Kavach (कवच) is a compiled, statically typed, general-purpose programming language: as quick to try as a script, and checked and fast like a systems language.
What kind of language is Kavach?
- Compiled or interpreted?
- Compiled.
kavach buildturns your program into machine code: one executable file, which needs no Kavach, interpreter or virtual machine to run. While you learn,kavach runstarts a program at once through a built-in interpreter, with the same results. - decision 0014
- Is it a scripting language?
- No, but it is as quick to try as one. A file can be a single line,
print("Hello"), with nomain, no project and no imports. The difference: Kavach checks the whole program before it runs, and the same file compiles to fast native code. - spec 10
- How are types handled?
- Statically typed. Every value's type is known and checked before the program runs, so a wrong type is a message, not a crash. You rarely write types yourself: the compiler works them out.
- decision 0002
- Who manages memory?
- Kavach does, without a garbage collector: a value is freed the moment nothing uses it, so there are no pauses.
- decision 0003
- What is it for?
- It is general-purpose: command-line tools, servers, data processing, AI agents, GPU work, and libraries other languages call.
- vision
- What is it built with?
- The compiler and runtime are written in Rust, a memory-safe language, with
unsafeRust allowed in one place only: the small runtime library linked into programs. Machine code comes from LLVM, or from Cranelift for quick runs. Much of the standard library is written in Kavach itself: HTTP, gRPC, logging and random numbers among it. - how it is built
- How fast is it?
- Faster than C++ in 31 of our 36 published benchmarks, measured on one machine, with the losses published too.
- benchmarks
A whole program
This file is a complete Kavach program. Save it as hello.kav and run kavach run hello.kav:
print("Hello, Kavach!")
const year = 2026
print("Written in {year}")The program ran and printed:
kavach run script.kav
Hello, Kavach!Written in 2026
How this tutorial works
Every page teaches one idea. When an idea has several forms, each form gets a page of its own under it: the For Loop page has "Over a list", "Over a range" and more. Every example runs, and the output under it is what the real compiler printed when this site was built.
A page then has a Try it yourself task, a box saying what Kavach does for you there, and a closed Go deeper part with the why, for readers who want it.
Where to start
- Never written a program? Start with Your First Program and read the pages in order.
- You know another language? Read What Kavach Does for You and Classic Mistakes, Fixed, then skim Basics.
- Looking something up? Use search: it knows other languages' words too, so "array" finds lists.
- Wondering whether something already exists? The Reference lists every built-in type, every built-in method and every standard-library module, with what each is and the file that defines it.
Who makes Kavach
Kavach (कवच) is created and led by Mithlesh, who also writes this course. It is open source: the language, its compiler and this site live in one repository, and every page links to the code and measurements behind it.