is everything written in C?

Pages: 12
hi guys,

so fun thought, is everything written in C and C++? straight away you are going to say duh.... no, many languages exist. Some for handling web development both client and server side such as PHP,JS,Python - with this you also have database management languages such as MYSQL and it's relatives.

for application development we also have such languages as Java,Pascal,Fortran,Scala,Python,Pearl,Ruby,GO,R,D,Rust, and the list goes on and on.

There also exists special languages for specific purposes like mathlab

BUT most and if not all of these languages are implemented using C and sometimes C++, or even sometimes they are written in other high level languages which in turn themselves are written in C or C++.

both Unix systems and Windows are written mainly in C and C++ and of course a lot of the OS is also written in assembly.
BUT most and if not all of these languages are implemented using C and sometimes C++, or even sometimes they are written in other high level languages which in turn themselves are written in C or C++.
Then an apt question to ask at this point would be "what does it mean for a program to be 'written' in language X?"

If it means that the developer mostly writes and reads code in X during the development process, then whether the language they're using is implemented in a different language (e.g. the JVM being written in C) is completely irrelevant.

If it means that ultimately the program reduces to that language, (e.g. a C program is really just an Assembly program, is really just a machine language program, etc.), then there are no programming languages and there are no programs. All there is is an electronic machine behaving in a certain way in response to the contents of its internal memory. A programming language is an abstraction on top of this machine that a human has come up with to make it easier to understand.
Last edited on
Pascal and Fortran are absolutely NOT written in C.
I cannot speack to all of those others, but most of them are interpreted/VM systems anyway...

Modern Object Pascal absolutely shines as a language (with a few caveats). Too bad Borland destroyed its marketability, otherwise we’d all be on an OP forum right now...

The old Mac OS was written in a Pascal variant, no C used, thank you very much.

C dominates in extant OSes these days, which tend towards Linux/POSIX compatability, so C (and C++) it is.
Pascal and Fortran are absolutely NOT written in C.


very good point I don't know how I wrote that,Fortran and Pascal are much older than C and esp C++

@helios

that's very true, at the lowest level everything really is just machine code, PHP is written in C, C is written in assembly( I've heard that parts of the C compiler are also written in C, which is strange to me but I could be wrong), assembly assemblers are written in machine code.

Last edited on
Pascal and Fortran are absolutely NOT written in C.
they are written in English, just like C itself.

As for Pascal and Fortran compilers, there are many, written in different languages.
The GNU Fortran compiler, for example, like the rest of GCC, is written in C that was ported to C++.
Last edited on
I’m not just talking about ancient P-code Pascal. Modern Object Pascal is written in... Object Pascal!

This is actually very easy to do, and is not uncommon. It even has a name: “bootstrapping”.

Of course the very first compiler you create for your new language must be written in some other form, say, Assembly, or C, or BASIC — pick something. Once you have that compiled, however, you can rewrite in your new language. After that there is no looking back. It is just a matter of adding features until you consider your language complete, using the current version of your new language.
is everything written in C?

Nah, the universe's source is written in COBOL.
Er, the universe's source is written in COBOL Perl.

https://xkcd.com/224/
You say Perl, but the webcomic says is titled "Lisp."
Last edited on
But God says “Perl”.
everything ends up in machine language.
Not everything ends up in C, but many things DO.
In terms of sheer # of programs, it is probably safe to say that MOST (say, 75% as a ballpark) end up in C. Might be higher if that is "ends up in C in part" or lower if you mean "ends up entirely in C" and whether you want to bicker about inline asm stuck into the C.
Quora had one person say
There are many languages but there are approx 256 programming languages known in the world.
Had me laughing my head off.

People love to pontificate without first consulting reality. No, <language X> is not the language running the world. The reality is that there are untold thousands of computer languages, and a good number of them are used regularly by people in a healthy mix of random.

Here is a really neat chart I found that is pretty fun to read. Hopefully it gives you (as it did me) a healthier feel for how non-monolithic things really are.
http://www.digibarn.com/collections/posters/tongues/ComputerLanguagesChart.png

So, yes, IBM and the bakery down the streat are both running Cobol, Google is using Python, your payroll processor is a Microsoft shop running VB and C# with some maverick using a little C in the background, and hobbyists around the world are trying to compile the latest C++ utility for their Android game, since the developer hates Java.

/mic drop
"Internet C++"? Did the author really believe it was going to be the next big thing in 2001?
Maybe it was in 2001, helios, but then futurists kept predicting we'd all have flying cars by the 21st Century......
We do have flying cars. You drive off the Golden Gate Bridge and you'll soar for a solid few seconds
That ain't flying, that's crashing with suicidal style.
oh the list of things that did not happen by y2k...
technology stuff.. colony on mars/moon, flying cars, replicators, you name it..
and all the gloom and doooom (how many ppl said we had X years left 10x years ago or that WWXXIV was coming, etc)
Note guys that Microsoft is pushing very hard to make people code in C# and .NET framework.
Their goal is to make net framework (their "managed" crap-bloat) the standard of the future.

You should never succumb to this hoax!

For example, one firm which is so large as MS, have enough resources to be up to date with C++ language and preprocessor standard but reality is not only that it's behind the standard for several years but also existing implementation is not really compliant.

I could give you thousands of examples for both the language and preprocessor but you know that already...

the point being that in contrast NET framework C# is actively maintained, fully supported and language syntax looks clean, making people more likely to switch.

in addition intellisense is far more better in C# than in C++, it's not that they could not invest some time into C++, it's that they don't want to for specified reasons above.

Btw, I'm not really a hater of Microsoft, I use their software and develop with Windows API's, but it would be not normal for me not say what I think of MS.

the point being that in contrast NET framework C# is actively maintained, fully supported and language syntax looks clean, making people more likely to switch.

I don't want to defend Microsoft either, but it's hardly Microsoft's fault that C++ has an uglier syntax than C#! What are they supposed to do, make their language's syntax more ugly just to be uglier?

In addition intellisense is far more better in C# than in C++,

It is incredibly hard to parse C++ for real-time intelliSense purposes. It can do the basics. There's a good video about parsing C++ here: https://www.youtube.com/watch?v=WfIr7lKT4Sk
(CppCon 2018: Timur Doumler & Dmitry Kozhevnikov “Parsing C++”)
Basically, to fully parse C++ is almost as hard as to just compile it. If you do know of an accurate, fully fledged, fast parser that I can use, let me know... I know clang devs have been working on utilities but I don't know much beyond that.

...not only that it's behind the standard for several years but also existing implementation is not really compliant.

The latest versions of VS 2017/2019 are pretty up to date with the C++17 standard (as far as I know, I normally use GCC). See: https://en.cppreference.com/w/cpp/compiler_support
And it looks like they're in progress for C++20 features. It's true that C++11 support didn't come too fast back when that was new. I expect there will still be a delay in VS compared to GCC/Clang for C++20, but not as much as C++11.
Last edited on
Unless GCC changed things recently there is at least one particular, documented area where VS is clearly out ahead.

std::random_device.

GCC returns an entropy estimate of zero, indicating they are using a pseudo-random number engine instead of having a true random number generator.

No compiler is perfect. Being cobbled together by humans, from standards ginned up by humans, makes that a given.

NET framework C# is actively maintained, fully supported and language syntax looks clean, making people more likely to switch.

The differences between a language just a few years old, and one that is decades old.

C# is pretty much maintained by a single source, MS. Unlike C++.

MS sees all the issues implementing a language smashed together by committee, hobbled by the need for backwards compatibility, and when Visual Basic never became the success they wanted they improved C++ by creating C#.

Hmmmmm, I remember someone doing much the same because of all the problems C had. Creating C++.

.NET has many of the same advantages and problems Java has. Requires a VM. Source is not compiled to native machine code so it can run on its own.

IMO (MY OPINION) the C# syntax is not all that great. Forcing a programmer to do things ONE way. The MS way.

I might decide to ADD C# to my toolbox, along with C/C++. Replace it? Nope.

If there were more 3rd party compilers for C# adopting it might be easier. VS and Mono really doesn't promote the language as being a viable replacement for systems that aren't Windows-based.

I am a hobbyist programmer, still learning (quite a lot I don't know) on my own. So clearly any opinion I have doesn't carry as much weight as a professional's.
Last edited on
Pages: 12