4 ms·
You can write Rust code with no dependencies (not even Rust's standard library) and coders do so regularly when writing code for microcontrollers. That is one
by hollerith 2y ago
You can write Rust code with no dependencies (not even Rust's standard library) and coders do so regularly when writing code for microcontrollers.
That is one of the primary advantages that distinguishes C and Rust from most languages (which tend to depend completely on a library to do automatic memory management for example).
It is advantageous not only on constrained systems like microcontrollers, but also when interfacing with code written in one of the languages that has a hard dependency on a runtime library to manage memory.
- jvanderbot 2y agoOf course this is true with minor effort. I'm not doubting rusts benefits, I write rust full time for a reason. Just answering why sometimes C is first.
- flohofwoe 2y agoBut now you're (almost) back to basically carving out your personal language subset, which is also one of the biggest problems in the C++ ecosystem (it is possible to write 'sane C++', but everybody's sane subset looks slightly different, which massively fragments the library ecosystem and leads to endless frustrating and pointless discussions whether a library should make use of this or that language or stdlib feature).
- pjmlp 2y agoWell does one write ISO C, GCC C, clang C, AIX C, xyz C? It is the same issue as well.
- atiedebee 2y agoNot really, most C programs (especially libraries) are written in C89 or C99. GNU-C and all other dialects are generally reserved for when you write an application that won't be interfaced with through code.
- pjmlp 2y agoI guess we don't look at the same kind of examples, specially in the enterprise world.