The place where random ideas get written down and lost in time.
2020-12-18 - Kotlin and Rust
Category DEVI keep circling back to these and I think it’s time I consider some “real” project for it.
I tried Rust for rig4, and I wasn’t impressed. I think of C and Rust as “embedded” development languages, not server ones.
In fact the main reason I’ve never been impressed by neither Kotlin nor Rust is the debilitating amount of hype around them. Rust, like Go, has a lot of idiosyncrasies, not to mention arbitrary conventions on what should go where. It seems to be the new trend to endocrine the structure at the compiler level.
I see Kotlin as pure hype. There’s nothing Kotlin seems to add that can’t be done in plain ol’ Java. Software engineers are kids, they always look at shiny new toys and disregard the perfectly valid ones they already have.
So anyhow, are there serious projects I can try to slowly accomplish on both? Ideally they would not be long-term projects, quick yet good enough to get some real sense of the languages and move on?
Wannabe projects I have around:
- ESP32 grade crossing. Would be ideal for Rust, except I don’t see good ESP32 support.
- Conductor 2… Currently Groovy + Java. Could use Kotlin as a DSL instead of Groovy.
- I did try Kotlin back then but its DSL was not enough for my needs.
- Rig4… Currently Java, with a (failed?) attempt at Rust. Could be using Kotlin.
One of the new directions for Rig4 is to have 2 tools (fetch + produce) so it’s possible for each to be in their own language. Seems a bit messy and quite undesirable though. If anything, it means dealing with two toolchains.
On the Android side, I have no immediate small project. Otherwise Kotlin would be a good choice there. I have some small game idea, and those would be in Godot / GDScript likely.
There seems to be something for ESP32 with Rust:
- https://github.com/esp-rs
- https://github.com/MabezDev/rust-xtensa
But one thing to remember is that I don’t just want “Rust on ESP32” (via llvmc, why not). What I really want is the Espressif SDK w/ FreeRTOS API, and e.g. access to the camera, hardware, etc. As the project author says “I've laid the compiler ground work, it's simply a case of writing the drivers and HAL's for it”, but really that’s the most important part of the project, there’s nothing of a “simple case” here. Without that, there’s an obvious chicken-and-egg problem.
The other side of the coin is that the whole point of the grade crossing project is to use OpenCV, which means I need OpenCV Rust bindings. There are some, but who knows how good they are on ESP32 (I don’t care if Rust + OpenCV works on desktop).
So conclusion:
- Rust: No candidate.
- Kotlin: Maybe Rig 4.3 reboot or Conductor 2.1 ?