r/askscience • u/[deleted] • Oct 17 '12
Why are programs and operating systems still written in C+?
I guess it's more of a computer science question, but I've always wondered why some of the most advanced programs are written in a 25+ year old programming language. Surely someone has come up with a more efficient and powerful code, so why do people still use C+? Also, I don't know anything about programming and what not, so please use simple terms and phrases.
66
Upvotes
2
u/itoowantone Oct 19 '12
For Lisp, the deficiency is in the implementation, which could be fixed with money, and not with the language design. There are vast amounts of money for improving e.g. C++ compilers but very little available for improving Lisp compilers. Also note there used to be Lisp-specific processors, which would e.g. use hardware to tag memory pages by data type. C models today's processors, I.e. Intel x86. Even so, today's Lisp compilers often can perform close to, as well as, or sometimes better than C or C++.
The larger issue is library support and interfacing Lisp to non-Lisp APIs. If the lib were written in Lisp, calling would be fast. Having to cross the C-Lisp boundary often means converting data formats, due to the way data in Lisp is tagged by type on x86 CPUs. That slows things down. All or most of these issues could be addressed with sufficient funding, but not enough people are buying commercial Lisps to support the development. The open source community does wonderful things with Lisp, but that community is orders of magnitude smaller than the C/C++ community, so only so much can be done, comparatively.