What is K2?
K2 is a new programming language I created from the ground up with one goal:
Extreme execution speed in nanoseconds.
It's built for developers who want full control and performance, without all the extra overhead. Think of it as C meets Python, but optimized to fly through code in under 1000 nanoseconds per execution β seriously.
Why K2?
Modern languages have a lot of power, but also a lot of bloat. I wanted something that felt like writing in pure logic, no distractions. Thatβs how K2 was born.
β‘ Speed You Can Feel
K2 doesnβt interpret every time. It caches, then executes from RAM. That means:
First run compiles β cache
Next runs β instant execution
let x = 10;
let y = 5;
print(x * y); // Output: 50
Execution time? About 841 nanoseconds. No joke.
Core Features
β
Nanosecond execution time
β
Simple C-like syntax
β
Variable declarations with let, var, and const
β
Control flow with if, for, while, break, and continue
β
Functions and recursion support
β
Built-in algebra parsing
β
Decimal & Fraction math
β
Shell command interop
β
Includes other .kj and .py files
β
Turbo Cache Engine to re-use execution trees
β
Micro/nanosecond timers built-in
And soon: a full GUI framework called Nahir UI and native apps using Talanolius GUI.
How to Try K2
Visit π k2lang.org and start coding directly in the browser!
Online compiler, examples, docs β everything you need to get started.
Example: Fibonacci in K2
func fib(n) {
if n <= 1 {
return n;
}
return fib(n - 1) + fib(n - 2);
}
print(fib(10)); // Output: 55
This runs in microseconds and showcases recursion and return logic beautifully.
Final Thoughts
I built K2 for speed lovers, learners, and creative coders like you.
If you love performance, simple syntax, and extreme responsiveness, youβll love K2.
π Try it at k2lang.org
π Built with β€οΈ by a dev who just wants things to be FAST.
Top comments (0)