6 ms·
The biggest advantage C has over Rust is the sheer breadth of platforms. As a developer, I would always prefer Rust over C, if possible, but sometimes C is more
by timw4mail 7y ago
The biggest advantage C has over Rust is the sheer breadth of platforms. As a developer, I would always prefer Rust over C, if possible, but sometimes C is more realistic.
In most cases, C would only be more practical on obscure or outdated hardware, though.
- jkoudys 7y agoPretty easy to integrate C libs as unsafe calls with rust's FFI. You're definitely in for an uphill battle if you have to manage a bunch of decade+ old makefiles with hundreds of special flags for each platform under the Cargo ecosystem, though.
- worldsayshi 7y agoI fear that we are slowly moving towards a situation where our underlying technology stack is written in languages that a diminishing number of people have seniority in. 96% of the Linux kernel is written in C (https://github.com/torvalds/linux https://github.com/torvalds/linux).
- mroche 7y agoThe GitHub counters are not always accurate. 97.3% (if going by C (imp+header) and Assembly) of the kernel is written in C, with the rest being written in Assembly. Everything else is config files, scripts, tests, or docs. GitHub reports C++ and Objective-C; those are just .h header files. Update: Got to my system so I could actually look at available files accurately: C Implementation (.c): 28269 C Header (.h): 20250 Asm (.S): 1323 Edits: Update section and removing "100% in C" and "5 sources files of assembly"
- clarry 7y agoEh, find -iname '*.s' in kernel source tree finds more than a thousand files and half a million lines in them.
- mroche 7y agoI wasn't at my system when I wrote that and just checked (5 is way off the mark there). Should have followed my own advice and not used GitHub's counters :P The counter reports 1.2%, but if you click on that to show Assembly files it only reported 5 code results (it's not actually showing all Assembly, so you then have to click on "Unix Assembly" on the side).
- otachack 7y agoWould be nice to get a survey of current Linux kernel maintainer demographics (age) and see where we're at. Can be good data for a call to arms and potential company backing via charitable funds.