Re:Driving with D
by mhh__ on Tuesday June 01, 2021 @11:22AM
(#27355820)
The idea that Rust is suitable to replace C and D isn't is odd to me. It's really not hard to do + we (unlike some languages, not sure about rust) actually test on embedded targets via GCC.
[ Parent
| on HN ]
What I meant by this is: if you are starting a project today, and have to choose between C and C++, there are certain reasons why you might choose C over C++.
Those same reasons would apply for choosing C over D. They might not apply for choosing C over Rust.
I can't think of a reason that would apply here. For me at least if I were on a toolchain so crap I had to use C you'd have to pay me a lot of money not to work on something else.
All my embedded design work has been in C as i don't need all the extra cruft.
Also anything i want to be very fast on limited hardware i also use C and C only.
As for any hobby programming i do on the side, C is usually my goto choice, unless i want to be very esoteric.. following along the lines of: "The enemy of art is the absence of limitations."
I find that C actually gets in my way compared to D when I am writing code with limited resources. The end result is semantically the same but with D I can avoid macros, inline asm is easier etc.
while this makes all the sense in the world to even a seasoned C programmer...
I've been doing it so long I could write macros in my sleep, and inline asm is a fun little exercise.
Though i absolutely agree, especially with someone newer, that could be a major road block. Might want to learn D just to be more efficient (even though I will never abandon my first love completely)
Re:Driving with D
by stjohnswarts on Wednesday June 02, 2021 @12:44AM
(#27364930)
Almost the only reason I would choose c over c++ for embedded would be if the c++ compiler was garbage for the platform or the team wouldn't allow it.