W
W
Web Programmer Web Programmer2021-12-02 19:33:09
C++ / C#
Web Programmer Web Programmer, 2021-12-02 19:33:09

What is the C programming language written in?

What is the C programming language written in?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
W
Wataru, 2021-12-02
@Miqoooooo

Consider that a programming language is just a set of specifications and rules. It is written in English.
If you are interested in what C compilers are programmed in, then the most popular developing compilers today are written in C and C ++, respectively:
gcc: https://github.com/gcc-mirror/gcc
clang: https://github.com/llvm /llvm-project/tree/main/clang
You ask, how was the C compiler written in C itself? The answer is simple - the first compilers were written in assembler. They were very simple and stupid, perhaps they did not know how to understand all the subtleties of the language. When there was a sufficiently working compiler with a minimal set of functions, it was possible to rewrite it in C and compile it with the first compiler. After that, it became possible to compile the C compiler by yourself.
In the same way, new language features are added to compilers - they implement the code for compiling these things without using them in the source code and get a compiler that can compile them. You can then rewrite the compiler source code to use these new features, using the compiler executable you got earlier.
And so, probably, there are a bunch of unsupported legacy C compilers in all sorts of languages.

S
Sergey Karbivnichy, 2021-12-02
@hottabxp

In English. The compiler itself is in C.

G
Griboks, 2021-12-02
@Griboks

On S. This is called spin-up.

V
Vasily Demin, 2021-12-02
@includedlibrary

C compilers are written in c++ and c. In gcc, most of the code is in C, while clang is written in C ++

C
CityCat4, 2021-12-03
@CityCat4

Suddenly - in the C language. When building gcc, it builds itself three times - first the minimal compiler, then more, then even more, then the final one. It takes a decent amount of time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question