Hacker News new | ask | show | jobs
by tannhaeuser 1163 days ago
That's a point I was trying to make multiple times - that C (apart from O/S code and drivers) is used for small command line utilities and language runtimes of higher-level languages. Nobody (except maybe game devs) wants to develop fat application server binaries or other long running server apps in C++ or other non-GC'd environments (due to memory fragmentation issues alone if not other things). And for a language runtime, you can't use Rust's memory safety guarantees either. This leaves Rust for what it was originally invented - browser engines and fat desktop apps.
4 comments

Lots of people write complex, latency dependent code.

Previously they would write in something like C/C++ or use the JVM but try to avoid all garbage collection events though very carefully avoiding allocations, etc.

For them, Rust is a gift!

https://blog.scottlogic.com/2021/12/01/disruptor.html

There's a ton of big productivity desktop applications written in C++ (which almost always also includes a significant amount of C code in 3rd-party libraries), pretty much all 3D modelling/animation tools, Photoshop, browsers...

Also: memory fragmentation is only an issue if you don't have a proper memory management strategy (which you absolute need in any non-trivial code base, even in GC'ed languages).

It’s pretty reasonable to argue that were these things written again, less than 100% of it would be in C[++]. It’d also pretty reasonable to argue that that percentage will be even smaller 5 years from now.
Sure, but that's a theoretical scenario, because this type of applications won't be written anymore. Anything that's relevant in those areas had been started in the early to mid 90's (even the 'newcomer' Blender had been released first in 1995).
You accuse "theoretical scenario" and then make the most ridiculous unfounded assertion yourself.
> unfounded assertion

...which unfounded assertion would that be? As far as I'm aware there are no contenders which would even attempt to throw tools like Maya, 3DSMax, Blender, ... from their throne. And all those tools hail from the 90's.

The only exception in recent time which gained some traction might be Figma for 2D design, but even though it runs in browsers the important parts are also written in C++.

C is used for the whole Linux kernel and not just "utilities".
Once the Asahi drivers get up streamed it won’t be the whole kernel anymore.
There are tons of CLI utilities developed in Rust that are faster and safer than their C/C++ equivalents. See for examples ripgrep.