I have released a preview of my new pet project KTCC. It is not complete, but does a lot of things already.
It is a C Compiler written in Multiplatform Kotlin (with implementations for the browser, the JVM and Native). It generates Kotlin from C code and also provides the parsed tree of a C program to be used in Kotlin.
You can try it online:
I have created it to be able to use libraries in Multiplatform Kotlin without having to manually convert them.
I plan to use this to convert libraries like minimp3, stb_image, libwebp or ffmpeg to be usable inside Kotlin to use in my
You can always use them on Kotlin/Native, and even convert them to JS/WebAssembly using emscripten, even create a native library for all the JVM targets you can use, and then call each function for each target.
This simplifies that a lot, and since it preserves a lot of useful information (like field names in structures), it is easier to port later to normal plain Kotlin.
It uses Kotlin inline classes to wrap integers that act as pointers, but also provide type information like normal access to fields, etc.
- GitHub page:
- Online demo:
- Small docker image (45MB including ubuntu) with the compiler compiled with K/N:
- Forum (ask questions here):