4 ms·
I'd love to be able to easily write Nim with the esp32 as target; please, say more!
by GeorgeTirebiter 6y ago
I'd love to be able to easily write Nim with the esp32 as target; please, say more!
- elcritch 6y agoCan do! I've got the basic OS target as `freertos`, so in theory any FreeRTOS device could work! FreeRTOS has a decent amount of POSIX API's but you'll want the `newlib` and/or `devfs` extra components for `select` (or using uart's with socket api's). The other big piece is `LwIP`, which has slightly different structs for IP addresses than standard *NIXes. Between FreeRTOS/LwIP you could cover a lot of embedded development and chips... Here's an example esp-idf project with a README describing the build and setup: https://github.com/elcritch/esp32_nim_net_example/blob/master/README.md https://github.com/elcritch/esp32_nim_net_example/blob/maste... Here's the Nim Forum thread, if you want to chime in and discuss/help out! https://forum.nim-lang.org/t/6345 https://forum.nim-lang.org/t/6345 It's pretty rough, but it surprisingly stable. Nim wraps enough OS level concepts you could easily use Nim only wrappers without needing specific RTOS idea's except when you want. Wrapping vTask's with Nim's thread api would be awesome. I don't know FreeRTOS hardly at all though. When Nim's async works with ARC, I wonder if it'd be possible to port LwIP or rewrite it in Nim. LwIP seems somewhat buggy. :-)