Krypton
Krypton is a work in progress C transpiler.
Goals
High performance
Krypton is designed with performance in mind, and ensures the same performance as C, by directly compiling to C99.
Krypton might be even faster than C as it encourages use of more performant patterns such as arena allocators, and working directly with bits.
Truly seamless C and C++ interoperability
No bindings, no wrappers, Krypton compiles to C99 for full compatbility with C and C++. You may also generate a single-header C file from multiple Krypton source files to include as a library in your existing C/C++ project.
Calling a C function is as easy as importing it and calling it.
Types and functions are C-compatible and use the C abi.
To achive this, Krypton uses the concept of "foreign imports" which skips type checking of
foreign variables and functions.
This tradeoff was deemed acceptable as building the project requires using a C compiler,
which will detect any errors.
It's also possible to manually or automatically generate type-infomration bindings to get
better errors and type-safety.
Simple but powerful
Krypton aims to be as simple as possible while allowing enough flexibility with it's features to be powerful enough while not over complicating the language.
This doesn't mean the language is simple (no language is), but rather avoiding pointless complexity with little to no benefit to the programmer.
The programmer should have an easy time forming a mental model of the language, it's semantics and syntax, and how it works.
Designed for good programmers
Krypton is designed to be a "sharp knife". unlike other languages such as Rust, which hand-hold and restrict the programmer, Krypton believes programmers are compotent, and as such aims to provide them with powerful tools even if those tools can be misused.
Zen of Krypton
- Favor simplicity over ease of use
- Performance matters
- Runtime crashes are better than bugs
- Compile errors are better than runtime crashes
- Semantic compression over premature abstraction
- Errors are values
- Bits are high level
- Assume as much as possible
- You know the most about your code
Contributing
If you wish to contribute, read the project guidelines.
Always make an issue first before submitting a PR, unless the PR addresses an existing bug.
To become a maintainer, reach out to me via mail.
License
Krypton is copyright (C) 2025 Kyren223 <contact@kyren.codes>
.
All source code under the src/
directory is licensed under the MIT license.
All logos and artwork in the assets/
directory are copyrighted works of Kyren223 and are licensed under CC BY-NC-SA 4.0.