News for hackers. Stuff that matters.
Re:C meeting is over. C23 added: by shakna on Saturday February 19, 2022 @04:54AM (#30395806)
How many of your preferred programming languages are written in C?

Yes, many self-host, but a considerable number of them don't want the complications that can bring.

Re:C meeting is over. C23 added: by pjmlp on Saturday February 19, 2022 @10:01AM (#30397593)
Modern C compilers are written in C++.

So much for C's simplicity in writing compilers.

Re:C meeting is over. C23 added: by shakna on Saturday February 19, 2022 @12:02PM (#30398546)
Yes, C can be simple for writing a compiler. [0][1]

No, optimisation, on the other hand, is not a simple problem.

[0] https://github.com/rui314/8cc

[1] https://github.com/rui314/chibicc

Re:C meeting is over. C23 added: by pjmlp on Saturday February 19, 2022 @12:40PM (#30398853)
Naturally it can be simple, it was already a basic language when compared with what 1960's have produced.

The evolution of Bootstrapping CPL compiler + a set of basic types.

Re:C meeting is over. C23 added: by uecker on Saturday February 19, 2022 @01:17PM (#30399173)
There are plenty of C compilers written in C. Large compiler suites for C/C++ are usually written in C++. But as a contributor to GCC, I can say that large parts of the code still look very much like C.
Re:C meeting is over. C23 added: by pjmlp on Saturday February 19, 2022 @01:36PM (#30399322)
Plenty of compilers... right.

If you cannot compile GCC with a C compiler, it isn't C.

Re:C meeting is over. C23 added: by uecker on Saturday February 19, 2022 @02:25PM (#30399726)
There a couple of open source C compilers TCC, SDCC, tendra, chibicc, ACK, LCC, PCC, etc. and also many commercial ones.

It is true that GCC is not written in C anymore, but it is easy to see that the code is still relatively close. I am also myself writing a C compiler in C at the moment and there is no problem at all.

Re:C meeting is over. C23 added: by pjmlp on Sunday February 20, 2022 @04:08AM (#30404339)
How many of those are actually shipping software into production?

Quite curious about which commercial C compilers, written in C, are being sold, keeping those companies in business.

Every year thousands of CS students write toy C compilers.

Re:C meeting is over. C23 added: by jstimpfle on Sunday February 20, 2022 @11:25AM (#30406866)
It will be hard to agree with you what "production" even means. I have written and shipped at least one compiler/interpreter (written in plain C). The language wasn't an issue at all. (This compiler doesn't have any meaningful optimizations, but I don't see why that should change the game).

GCC and Clang aren't "sold" either, nor is MSVC really.

I have never contributed to GCC, but as a fact I have visited plenty of files from its source code, and so far haven't encountered any meaningful use of C++ that couldn't easily be rewritten in plain C. The overwhelming majority of the code would probably compile as C without changes.

I'm sure that there are far more meaningful "problems" with the architecture of a compiler written in C that are not the implementation language. For example, GCC is a pain to build (IIRC when I tried many years ago, I gave up).

Re:C meeting is over. C23 added: by jstimpfle on Saturday February 19, 2022 @07:31PM (#30401961)
Trying to win a pointless argument based on pedantic logic that misses the point.
Re:C meeting is over. C23 added: by pjmlp on Sunday February 20, 2022 @04:05AM (#30404333)
Usually the typical answer when facts aren't appealing, the other way around apparently being pedantic matters.
Re:C meeting is over. C23 added: by jstimpfle on Sunday February 20, 2022 @11:11AM (#30406754)
Obviously one should always argue to the point instead of picking an interpretation that is easy to refute using "logic".