Engineering calculations
Stress, bolt joints and unit conversions. kilat eval "print(90 km/h in mph)" prints 55.9234073014.
Kilat is a small programming language for engineering calculations and safe scripts. 2 m + 3 kg is refused instead of printing a number.
The whole language is one program of 1.3 MB with no dependencies.
It is not better than Python overall.
Stress, bolt joints and unit conversions. kilat eval "print(90 km/h in mph)" prints 55.9234073014.
Let the model write Kilat, run it in the WebAssembly engine with a fuel and memory limit, and send any type or unit error back to the model.
A program can only reach the outside through one function, host(name, payload), which the app supplies. That is where an app adds http_get, ask_ai or anything else it wants to allow.
Go to juw12.github.io/kilat.
Set force to 1200 N and area to 58 mm^2, then print force / area in MPa.
Add a length to a mass. Kilat refuses before running: unit mismatch: cannot add m and kg.
Write 1200 N divided by 58 mm^2 and print it in MPa: stress = 20.7 MPa. Adding metres to kilograms is an error that points at the line and the column.
On 20 small programs with one realistic mistake each, Kilat refused all 20 before running. mypy --strict caught 14 and CPython alone caught 0. The author of Kilat wrote the programs, so read it as a demonstration, not an independent benchmark.
round_to(2.675, 2) gives 2.68. Division by zero, the square root of a negative number and integer overflow stop the program with an error. A misspelt name gets a "did you mean" hint.
The kilat program is 1,271,808 bytes and needs only files that are part of Windows. Start-up costs 5 ms of CPU.
Files can only be read with --allow-read and written with --allow-write. A fuel limit and a memory limit stop a runaway program. The WebAssembly engine has 0 imports, so it cannot reach anything the page does not hand it.
Copy kilat.js and kilat.wasm next to your page, load the engine and call kilat.run() on the program text.
Copy kilat.py and the built library next to your script. kilat.run() returns the output and kilat.check() returns the unit or type error.
Install the plugin from juw12/kilat and a code block marked kilat shows its result under the code. It was tested in the Cairn web app in a headless browser (8 of 8 checks). The in-app install from GitHub and the desktop build were not tested.
From the README’s “Run a calculation” section. Full options, requirements and troubleshooting are there too.
Open the README$ kilat --version prints kilat 0.2.0
$ kilat run examples\hello.kilat
$ kilat check examples\bolt_joint.kilat
$ kilat eval "print(90 km/h in mph)" prints 55.9234073014
Straight from the README, so you know what you're getting before you try it.
143 files in the repo · last updated 11 Nov 2026.
Browse the codeInstall.cmd: point to the release download when kilat.exe is missing
0.2.0 work: pool allocator, faster maps, mean/median/stddev, worker mode
Initial release: Kilat language, CLI, sandbox, WebAssembly playground and Cairn plugin
Web, CLI. You can try it in the browser with nothing to install.
The commands in the “Run a calculation” box above come straight from the README. Paste them into a terminal; the README covers options and troubleshooting.
Files can only be read with --allow-read and written with --allow-write. The WebAssembly engine has 0 imports, so it cannot reach anything the page does not hand it.
Not overall. Python has the libraries, the tools and the community, and Kilat has none of that.
Over 10 benchmarks the geometric mean is 3.06 times faster than CPython 3.13 for the whole process and 2.62 with start-up taken out.
The same engine runs in a web page, inside Python and as a Cairn plugin.
No packages and no library ecosystem. No classes, traits, async or threads.
Not yet: it's marked “live” and still changing. The README always has the current state.
Units and types are checked before the program runs.