Is it possible somehow to program Arduino or ESP8266 microcontrollers on Kotlin? Same question about single-board computers (i.e. Raspberry Pi).
Yes. Microcontrollers are still computers. if python can be used in Raspberry. then Kotlin can also be used.
First you need compile, JVM(Open source e.g OpenJDK) with that microcontroller toolchain. Then run the image in the microcontroller. Now create a kotlin file, compile it and run it with that JVM. Thats if the microcontroller runs on a kernel e.g linux
Make sure that microcontroller have enough memory.