Klyn: Python-Like Productivity, Native Performance
Inspiration
Python is exceptionally productive, but production systems often pay for that simplicity through runtime overhead, weaker static guarantees, or costly rewrites in C++, Rust, or Java.
Klyn was born from a simple idea: developers should not have to choose between productivity, safety, and performance.
The goal was to create a language that feels approachable and concise like Python, while offering strong static typing, native compilation, predictable behavior, and performance designed to approach optimized C++.
What Klyn Is
Klyn is a statically typed, LLVM-powered programming language combining concise, readable syntax with native compilation, specialized generics without boxing, fast incremental builds, and strong compile-time validation.
Developers write real Klyn code. The compiler validates it statically and produces native applications without requiring a second implementation in another language.
Klyn also provides a comprehensive standard library for collections, scientific computing, databases, networking, files, concurrency, reflection, graphical interfaces, cryptography, mathematics, and LLM integration.
Its LLM API enables developers to build OpenAI-powered applications and agentic workflows directly in a compiled, strongly typed environment.
The project currently includes:
- A native compiler and runtime
- An interactive REPL
- A broad standard library covering collections, I/O, SQL, entity management, cryptography, mathematics, and more
- Cross-platform graphical and terminal interfaces
- Native executable generation
- Source and binary archive formats through KAR and KAB
- An LSP server and VS Code integration
- A developer tooling suite including KlynDoc, Metrik, and KlynEditor, a modular IDE currently under intensive development
- A complete documentation, samples, and testing ecosystem
The codebase now contains more than 130,000 lines of C++ and over 160,000 lines of Klyn.
Performance
Current benchmarks show substantial performance gains over equivalent Python programs, with execution times moving toward optimized C++ while preserving a far more approachable syntax.
Vision
Developers should be able to build AI, scientific, business, and desktop applications with Python-like productivity, strong compile-time guarantees, and native performance.
Klyn is a practical foundation for the next generation of reliable, high-performance software powered by OpenAI models.
How I Built It and What I Learned
Klyn was developed through a deliberately controlled collaboration between human engineering decisions and AI-assisted implementation.
Codex was primarily responsible for producing and evolving the source code of the compiler, runtime, standard library, and development tools. However, I retained direct responsibility for defining the expected behavior and writing the Klyn test procedures.
A strict rule was established from the beginning: Codex was not allowed to modify the Klyn tests. Its role was to make the implementation satisfy the tests, not to adapt the tests to the implementation.
This created a clear separation of responsibilities:
- The human defined the language behavior, acceptance criteria, and test cases
- Codex implemented and corrected the production code
- The compiler and test suite provided objective feedback
- The human reviewed architectural decisions and validated the final behavior
The development loop was therefore:
- Define the expected language behavior
- Write or update the corresponding tests
- Ask Codex to implement the feature without changing the tests
- Compile the project and run the targeted test suite
- Analyze failures and refine the implementation
- Review the result and decide whether the feature met the intended design
This process allowed me to constrain the AI to follow the language specification rather than letting generated code redefine it.
The result was not uncontrolled code generation, but a test-driven engineering workflow in which AI accelerated implementation while the human retained authority over correctness, semantics, and project direction.
Built With
- c++
- codex
- gpt
- klyn
- llvm
Log in or sign up for Devpost to join the conversation.