3 ms·
As soon as I read "I originally used the Arduino IDE, writing my program in C. I had a bad time with that and rewrote it in Rust," I was pretty sure that I'd be
by sokoloff 3y ago
As soon as I read "I originally used the Arduino IDE, writing my program in C. I had a bad time with that and rewrote it in Rust," I was pretty sure that I'd be reading the root cause as being "Arduino C has 16-bit ints" (as I'd had the same experience in some delay-based relay control code I wrote a decade ago). Sure enough, that was the issue.
As a long-time C programmer and Rust newbie, it seems like a really long way 'round to switch languages just to avoid using longs, but for a hobby/learning project (or a C novice and experienced Rust dev), Rust makes more sense.
- fanf2 3y agoMy reading of the root cause is that the Arduino IDE doesn’t provide the kind of debugging facilities that C programmers expect, like decent compiler warnings and support for static analysis and runtime sanitizers (at least for off-device test builds). It also does not work well with proper development tooling, in particular git. The 16 bitness would have been OK if the dev environment had been tolerable. Tho, to be fair, although Ian is an experienced C programmer (he wrote dpkg) he has very little patience for C any more, so it would not have taken much adversity to make him switch to Rust. [I know Ian personally.]
- deleted 3y ago[deleted]
- sokoloff 3y agoThe Arduino IDE definitely sucks for experienced programmers. I feel like they did a great job making the "zero to seven-eighths" experience pretty good for non-developers, but many of those same choices mean that the tooling drives SWEs batty.
- ska 3y agoplatformio sorts most of reasonably well