954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

did anyone ever debug a c/c++ compiler?

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.

panpanf
Newbie Poster
18 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

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.

grumpier
Posting Whiz in Training
211 posts since Aug 2008
Reputation Points: 193
Solved Threads: 32
 

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.

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 
The key parts of most compilers are written in C itself, or in ASM.

Bullshit.

shrughes
Light Poster
48 posts since Oct 2008
Reputation Points: 29
Solved Threads: 4
 
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.

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 
Bullshit.


Then what are they written in ? MonkeyLanguage?

kux
Junior Poster
119 posts since Jan 2008
Reputation Points: 66
Solved Threads: 11
 

>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.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

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

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 

You might want to check out this .

dmanw100
Posting Whiz in Training
242 posts since Apr 2008
Reputation Points: 104
Solved Threads: 27
 

openwatcom!

panpanf
Newbie Poster
18 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 

did anyone ever hear about ucc?

panpanf
Newbie Poster
18 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
 
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." Thefirst 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.

shrughes
Light Poster
48 posts since Oct 2008
Reputation Points: 29
Solved Threads: 4
 

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

dmanw100
Posting Whiz in Training
242 posts since Apr 2008
Reputation Points: 104
Solved Threads: 27
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You