3 ms·
The problem of C code migration to memory safe languages is that legacy C projects aim for extremely high performance. Garbage-collecting languages would also b
by hotjump 2y ago
The problem of C code migration to memory safe languages is that legacy C projects aim for extremely high performance. Garbage-collecting languages would also be safe in any situation, but I want to note that the recent tendency toward Rust derives from its type-system based approach that imposes very few runtimes checks such as bound checking.
I myself hope something like F* gets more attraction in the industry.
- pizlonator 2y agoI hear the perf claim a lot and yet most of the time when I write C/C++ code it's not because it's the most performant. It's either because I'm editing a codebase that's already in C/C++, or I'm using libraries whose best (or only) bindings are C/C++, or because I want to make syscalls (and safe languages don't expose those as nicely as C).
- rrrix1 2y agoFor desktop, server, web, mobile, etc. This holds true. Not so much for embedded systems, anything with unnatractive memory capacity or processor performance. Rust is starting to make it's way in, but C and even assembly is still king AFAIK.
- pizlonator 2y agoAnd yet there are embedded systems running JavaScript and Python.
- kv85s 2y agoAre there any real-world, production systems based on JavaScript and Python? Toy systems, yes. Hey, I too, think CircuitPython is really neat. But I'm skeptical someone would base a PLC (or similar) on it.
- ckcheng 2y agoAbove was talking about embedded systems, and I really don’t know if the James Webb Space Telescope counts, but… The James Webb Space Telescope runs JavaScript, apparently [1]. [1]: https://www.theverge.com/2022/8/18/23206110/james-webb-space-telescope-javascript-jwst-instrument-control https://www.theverge.com/2022/8/18/23206110/james-webb-space...
- pjmlp 2y agoThat is the usual myth, back when I initially learned C, hobby programmers in Assembly could easily outperform machine code generated by C compilers, that is why books like those from Mike Abrash exist. C got its performance fame thanks to optimizing compilers that abuse UB semantics. Microsoft team on .NET, especially the great Stephen Toub blog posts, has been showing off how much performance can be squizzed out of a managed language compiler toolchain when people actually care. Also lets not forget Apple only moved away from Object Pascal due to an internal team doing MPW initially as kind of submarine project, due to their UNIX roots, and still their focus was C++, not C.