Hacker News new | past | comments | ask | show | jobs | submit login

Actually for someone using C only for microcontroller, it is an interesting approach.

Hardware drivers, like USB, SPI, etc could be done in C and wiring up things and pushing data around in a more high level language.

After considering micropython for exactly that purpose, I was disappointed because of the implementation complexity and slowness of computations on that platform.

What are your thoughts on this?




You could use Nim [0] for this purpose. It looks like Python, compiles to C and there are people doing embedded stuff in Nim [1].

[0] https://nim-lang.org/

[1] https://github.com/dinau/nimOnAVR


C++ has decent industry acceptance in embedded nowadays, or at least that has been my impression.

After C++, rust is likely the most popular, quite a lot of effort has been put into running rust on embedded, see eg https://github.com/rust-embedded. However, once again to my understanding, industry acceptance is still highly marginal.

After that, there's a bunch of toy-ish efforts to run other languages. Zig, nim, python and javascript variants, etc. Usually anything that has C ABI compatibility should be possible to get up and running (without writing a compiler backend from scratch). I've had fun with some toy projects using nim for ARM cortex-M targets (https://github.com/EmbeddedNim/svd2nim, https://github.com/auxym/nim-on-samd21, https://github.com/EmbeddedNim/picostdlib).

Using Nim (and eg svd2nim to generate the equivalent of CMSIS headers for register access in pure nim), it would be entirely possible to write even the low level stuff (SPI drivers and whatnot) in 100% nim, with the same performance as C and better safety (better static type system and compile-time checks, etc). Runtime (eg overflow) checks and garbage collection are available (at the cost of some performance) but optional. See eg. a pretty basic higher-level API for GPIO access, that provides native performance, since the abstraction is implemented as macros (compile-time abstraction): https://github.com/auxym/nim-on-samd21/blob/master/src/port....


That is one of the use cases I would say are perfect for Vely. A combination of a low-level and high-level approach, which is often needed, and not just in this arena.

IOT (Internet Of Things) is a major application area for Vely. Obviously what you mentioned may fall into that. But also for example IOT-edge systems, where the communication with multiple near-devices converges, gets processed and then delivered to a cloud server for congregation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: