(no title)
i-am-curious | 5 years ago
C is one of the most popular languages for high-performance code. Most famous example would be the Linux kernel but literally anything that needs the best optimizations possible eventually comes down to C.
i-am-curious | 5 years ago
C is one of the most popular languages for high-performance code. Most famous example would be the Linux kernel but literally anything that needs the best optimizations possible eventually comes down to C.
hellofunk|5 years ago
jstimpfle|5 years ago
Nginx487|5 years ago
Good tendency however, now both C and C++ developers started experimenting with Rust, probably creating unified community and platform.
harry8|5 years ago
You have to use a subset of c++. Nobody agrees what that subset is. You have to be super-vigilant in code review. Features invite their use.
It's the lack of features in c that make it attractive. No magic. You want an object or a virtual, code it up if you really mean it is not just a keyword. You take responsibility for all the code running.
Every time I've cut a tonne of latency from a trading engine it's that. People relying on library and compiler without taking responsibility for it. STL is great. Except if you're actually performance critical, when you can beat it easily by solving your problem, not someone else's solution for everyone's possible similar problem.
mehrdadn|5 years ago
That said, I tried to reproduce something similar, and it seems the issue only occurs in my example due to external linkage (adding 'static' fixes it)... but I can't claim this will always resolve the issue: https://gcc.godbolt.org/z/1vbqo3
pizza234|5 years ago
clktmr|5 years ago
> I had been harboring some suspicions that our big codebases might benefit from the application of some more of the various �modern� C++ design patterns, despite seeing other large game codebases suffer under them. I have since recanted that suspicion.
I think this shows that C++ works better in controlled (i.e. corporate environments), whereas C is often preferred in Open Source.
unknown|5 years ago
[deleted]
ricattierger|5 years ago
bregma|5 years ago
For example, GCC's C++ front end will produce a different parse tree for the same C code as the C front end, resulting in a slightly different collection of basic blocks and data flow analysis (obviously, for very trivial examples, it will be identical). The result after all the gimplification and and different middle-end passes and rtl transformations you can end up with a surprisingly different set of generated instructions for the same code fed to gcc and g++. Equivalent, but different.
hellofunk|5 years ago
That's not really true. A single compiler may support many languages but that does not mean code written in those languages ends up as the same binary.
rvz|5 years ago
I'm yet to see a 'modern web browser' that is fully written and only written in C. (C bindings don't count)
harry8|5 years ago