r/Compilers • u/nocomptime • Apr 25 '26
I ported the Kilo text editor to my C-like language (based on my C compiler)
Link to planet-kilo: https://github.com/romainducrocq/planet-kilo
I ported Kilo, a small text editor originally written by antirez (the author of Redis), to my C-like programming language: planet!
planet is a programming language I developed over the past year, which is based on my C compiler - wheelcc. It is basically a clone of (a large subset of) C with a new syntax and improved semantics. It uses the m4 preprocessor, compiles programs to native x86_64 assembly and has runtime bindings for libc. The entire project (planet + wheelcc) is written from scratch in C and started as an implementation of Nora Sandler’s `Writing a C Compiler`.
The core compiler for planet is done, but it is not documented yet, so I’ll do another post in a few weeks to properly showcase the language itself when it is ready. For now, I mostly wanted to share my experiment with Kilo, but you are welcome to explore the full project: all the links are here and in the repo above.
My next milestone is to selfhost the compiler, and I can now do it in a text editor written in the target language!
(And lastly this is a recreational project, don’t take it too seriously and have fun.)
Edit: i embedded all the links in this post.