4 ms·
who is still using C/C++ in 2014, and why? Systems programmers. Embedded programmers. Kernel developers. Compiler developers. Language runtime developers. Safe
by humanrebar 12y ago
who is still using C/C++ in 2014, and why?
Systems programmers. Embedded programmers. Kernel developers. Compiler developers. Language runtime developers. Safety critical software developers. I guess you can group them under "performance benefits" but it's as much about the ability to drop down, write arbitrary bits to arbitrary addresses, and (re)implement low-level constructs as it is about performance.
The most obvious example of the need for a powerful language is manual memory management. For C and C++ developers, manual memory management isn't a drawback of their language but a feature.
If you want that sort of freedom to rebuild from the ground up, the only mainstream choices are C and C++. We'll see if Rust gets it right too.
All that being said, I think there's more room in the systems programming space. Both C and C++ tend to pick fast (or reverse-compatible) over correct when deciding which way to go on a feature. There are many, many applications that could really benefit from a "safety first" attitude towards systems programming. Browsers are the driving example but encryption libraries, medical systems, safety-critical software, and many other domains would benefit from a new perspective on things.
- Cyther606 12y agoNim performance compares favorably to C++. It features a Pythonic syntax, optional soft real-time GC, optional manual memory management. Porting an elliptic curve implementation over to Nim from Python was a cinch: elliptic.nim: https://github.com/def-/bigints/blob/master/examples/elliptic.nim https://github.com/def-/bigints/blob/master/examples/ellipti... elliptic.py: https://github.com/wobine/blackboard101/blob/master/EllipticCurvesPart4-PrivateKeyToPublicKey.py https://github.com/wobine/blackboard101/blob/master/Elliptic... Others have reported success converting Python codebases directly to Nim. To put it in perspective [1]: > The problem asked students to do a hundred runs and to try sample sizes of 10 and 100. For kicks, I did 1000 runs with a sample size of 1000. This took nearly 4 minutes in Python (macbook pro retina with i7 or i5? I forget...) and under 5 secs in Nim. [1]: http://forum.nimrod-lang.org/t/589 http://forum.nimrod-lang.org/t/589 Rust and Go vs Nim: http://goran.krampe.se/2014/10/20/i-missed-nim/ http://goran.krampe.se/2014/10/20/i-missed-nim/
- dbaupp 12y agoThe Rust vs Nim comparison is tainted by very out of date documentation hosted on some MIT servers (the condition system is entirely gone). It's unfortunate and we have contacted the web master but there's not much they can do to remove or change how it appears in search engine rankings. For reference, doc.rust-lang.org is the only place to look for documentation for the standard libraries; any other hosting of those docs is likely to be out-of-date.
- bjz_ 12y agoHmm, was the parent comment edited? I can't see a reference to documentation...
- dbaupp 12y agoThe "I missed Nim" article to which it links to includes > Nim has Exceptions with tracking (!) and Rust has… something incomprehensible or perhaps its this, I am actually not sure ;). Again, for me, a clear win for Nim. where "something incomprehensible" links to very old documentation of the conditions system, which was removed quite a while ago.
- Dewie 12y agoIf we swapped the language, he might as well also have said: > The other language is named Nimrod... or perhaps it is Nim... I'm actually not sure ;).
- gokr 12y agoRegarding the parts where I link to out of date docs: 1. I will fix it later today/tomorrow, busy right now 2. I did actually search quite a bit, but that was what I as an outsider found. Consider this an "issue" to fix :) I think the issue was that the words I was searching for are not the words used to describe these mechanisms. Anyway, if you can give me a proper link to the canonical place where error/exception handling in Rust is documented - I will link it. Going to http://doc.rust-lang.org/0.12.0/reference.html http://doc.rust-lang.org/0.12.0/reference.html I still can't seem to find it.
- mattnewport 12y agoGames developers are also overwhelmingly C++ developers (at least AAA console game developers, things are a bit different in the mobile and indie space where other languages have made inroads). Performance is a major reason for us too but large legacy code bases and the platform and library ecosystems we work with are also major factors. Plus some of us actually really like C++ and/or C :)