All of MSOffice, Outlook, etc. are written in C.
MSOffice (and large chunks of Windows itself) was originally written in
Pascal, as was quite a bit of Mac software of the same era. No doubt
some or all of it has been re-written in C or C++ in the mean-time, but
it's not necessarily the case.
All those SQL servers
are written in C.
Yeah, probably, but while they're used by lots of people, I doubt that
you could say that a very large fraction of the programming community are
actively involved in their production or maintenance.
All of those web servers and web browsers are written
in C
There are some fairly widely-deployed web servers in Java (Tomcat,
Glassfish). If anyone was starting to write a new SQL server today
(rather than tweak one of the existing ones), I'd be very surprised if
they chose to write it in C.
Firefox is to Javascript a bit like emacs is to emacs-lisp: most of the
user-facing code, and all of the GUI is written in the "scripting"
language, which is rendered by the underlying rendering engine, which is,
indeed, in C. Similarly for Adobe lightroom vs Lua, I believe.
, and the Perl/PHP/Python/ASP/etc. scripts that the servers are
running are being interpreted by a program written in C.
Sure, but there's only one Larry Wall and one Guido van Rossum (and they
each have teams of maintenance helpers, of course). Most of the code
that is written *in* those languages doesn't care what the language
implementation is written in, and indeed there are versions of Perl and
Python that run on top of Java and .NET: no C involved (apart from some
system-interface shim libraries, probably.) There's a Python compiler
written in Python.
The OSes that
they're running on are written in C.
Of course. As I said, that's what it's for. Maybe that will always be
the case, but maybe not. In any case, if someone were to give you a new
Linux distribution that had been re-written in Java or something else,
why would you care, if it offered the same system call API?
Most people's computers spend the vast majority of their time running
code that was, at one time or another, output by a C compiler -- to the
point that virtually nothing else matters except in very specialized
applications.
Yes, but quite a lot of that C has now been generated by a compiler for a
different language, and so does not necessarily have the same code
profile or idiom (or, in particular, propensity for buffer overflow bugs)
as hand-written C.
HPCC is almost all Fortran or C, in my experience, because the libraries
for the clustering code are only available in Fortran and C. Matlab is
fine for small-scale stuff, but I bet that was written in C itself.
Matlab was originally an interpretive wrapper around Fortran BLAS and
LAPAC. I suspect that it is a very complicated beast underneath, these
days. Much of it seems to have been re-written in Java (you can load and
run java objects almost transparently), and it claims to have FFTW3 in
it, and that's C code that was written by an Ocaml program.
The most popular ones are still in C or C++; only the newest stuff is
being written in C# and the like, and that's still running in a VM
that's written in C calling libraries written in C on top of an OS
written in C.
Sun's JVM and libraries seem to be Java almost all the way down. MS's VM
might be based on C, or it might not. I don't know. In any case, both
VMs translate straight from byte-codes to machine language: there's no C
idiom involved in most of that code execution. Same with the new
javascript JIT compilers, and many (most) of the LISP compilers.
If the VM itself is written in C/C++, then I am assuming that the
language that the VM is interpreting is subject to the same limitations
as C/C++.
No, not at all. If a language has strong typing and checked array
accesses, for example, then the generated C code will have those features
too, even though C as a language doesn't. The checks are just more code
that humans typically don't bother to write for themselves.
Same goes for parallel processing/threading/sharing models: if a language
has a useful definition of those, then it can emit whatever is necessary
in C or whatever to get the job done. Might not be as fast as a hand-
tuned C or C++ thread application, where the programmer can make implicit
a lot of the sharing assumptions, but it won't break because of threading
model mistakes, either. Well, that depends on the model of course: it's
pretty easy to break a multi-threaded application written in a wide
variety of languages.
And, of course, that VM is calling libraries written in C and
running on top of an OS that's written in C.
Sure, some of them.
Haskell was mentioned; I don't know the language, but if it's truly
revolutionary to the point it enables new chip designs that can provide
ten times the performance at a quarter the power consumption, I doubt
that it's "incrementally different" from the C/C++/C#/Java/etc.
Sure. Same goes for scheme+termite (or other actor-model
implementations), or Clojure, or erlang. That's why I said that there's
a lot more to be gained by those who *are* prepared to reexamine their
programming preconceptions and fundamentals.
that
we're using today. If it were, by now (a) everyone would have switched,
or (b) whatever it is that makes Haskell special would have been added
to the more common languages.
Indeed, that's what's happening. For example, clojure is more-or-less a
LISP, but it comes with a bunch of pure-functional (immutable) data
structure libraries and other features that are there to make large-scale
parallelism more reliable and easier to program. I don't imagine that
there will ever be a visible "switch-over", but there may well eventually
be a "tipping point" where people start to wonder whether they need to
dare go with "C", or stick with the safer, more parallel language that
they're familiar with...
I've not seen much progress in that direction; most libraries are still
implemented in C/C++, though they may have bindings for "cooler"
languages.
Well, certainly many libraries are like that, but I've started to notice
that large chunks of the libraries in the Perl and Python distributions,
and certainly all of those in the Java collections are no longer wrappers
around the equivalent C library, but are new or re-writes in the native
language. Mostly that's because they can be easier to use when they use
the native language's object model and idioms. Probably simplifies the
library portability and build requirements significantly, too.
That's because they're written for the largest possible
audience, and virtually every language has _some_ way to call C
functions, while the reverse is rarely true. Good luck getting your
Java program to use a library written in Perl or vice versa -- but they
can both use a library written in C.
Sure, but you'll find that most of the useful libraries are already
native in Java, Perl, whatever. Indeed, there's a whole pile of web-
development stuff that more-or-less *only* exists in Perl, Python and
Ruby, and the only way to use that stuff from C, should you want to, is
to import the relative language subsystem as a library.
Cheers,