Is there any open source c/c++ compilers what can be debugged easily? I wanna know more info about the common knowladge about c/c++ compilers.

Recommended Answers

All 12 Replies

There are plenty of open source C/C++ compilers. They are fairly complex bits of code, so the notion of "debugged easily" depends on your notion of what is "easy". However, the information on how they work is well documented.

If you want to debug compilers, and you have skills with that, offer your services to the development team of one of the open source compilers.

The key parts of most compilers are written in C itself, or in ASM.

The open compilers are well documented, but compilers are generally very complex indeed.

The key parts of most compilers are written in C itself, or in ASM.

Bullshit.

commented: a) dont curse and b) dont speak bullshit yourself -6

Bullshit.

from my computer science book;

The first compilers were written in assembly language as building a self-hosting compiler is a bootstrapping problem

Since the 1970s it has become common practice to implement a compiler in the language it compiles and C has historically been a popular choice of implementation language.

Bullshit.

Then what are they written in ? MonkeyLanguage?

>Then what are they written in ? MonkeyLanguage?
You can write the lion's share of a compiler in any language you please. The only real restriction would be the code generator, where you need a language that can write to your target format.

i didnt say that you couldnt, i said "most compilers" which is true.

You might want to check out this.

openwatcom!

did anyone ever hear about ucc?

from my computer science book;

The first compilers were written in assembly language as building a self-hosting compiler is a bootstrapping problem

Since the 1970s it has become common practice to implement a compiler in the language it compiles and C has historically been a popular choice of implementation language.

You should try reading what you quoted: "it has become common practice to implement a compile in the language it compilers." The first compilers were written in assembly.

And when writing a compiler, there is (a) no reason to drop down in C to write some parts, and (b) absolutely no reason you'd write parts of it in assembly.

For example, the Java HotSpot JIT compiler is written in C++, LLVM is written in C++, most Scheme compilers are written in Scheme, SBCL is written in Common Lisp, GHC is written in Haskell, and Wirth's Pascal compiler was written in Pascal... need I go on? Using a low level language like C, or worse, assembly, for something like a compiler, would not make any sense.

commented: I agree; disagree that you get negative rep for bullshit. +1

Yep! It may be what you're looking for idk

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.