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

Make C++ Compiler

Hi,
How can i make c++ compiler under windows or Linux.

fzafarani
Light Poster
33 posts since Aug 2007
Reputation Points: 10
Solved Threads: 1
 

What do you mean by "make C++ compiler".
I hope for your sake that you are not going to write your own C++ compiler.
So assuming that you want a C++ compiler that works under Linux and Windows,
Windows -Visual C++, DevC++ (google and you will find links to download these )
Linux - GCC ( comes with many linux distributions )

WolfPack
Postaholic
Moderator
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
 
What do you mean by "make C++ compiler". I hope for your sake that you are not going to write your own C++ compiler. So assuming that you want a C++ compiler that works under Linux and Windows, Windows -Visual C++, DevC++ (google and you will find links to download these ) Linux - GCC ( comes with many linux distributions )


Yes, I want to write my own C++ compiler, I've seen some e-books on internet but those are not free!
URL Link: http://www.bigwebmaster.com/95.html

fzafarani
Light Poster
33 posts since Aug 2007
Reputation Points: 10
Solved Threads: 1
 

Have you seen this one ?

http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf

Did you search this forum? this topic has been discussed already and there are more links to be had there:

http://www.daniweb.com/forums/thread31222.html

hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
 
Yes, I want to write my own C++ compiler


Good luck :) Unless you have a Ph.D. in computer science and mathametics plan to spend the next 20 or so years writing it.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 
Good luck Unless you have a Ph.D. in computer science and mathametics plan to spend the next 20 or so years writing it.

Writing a stable production quality compiler single handedly? yes I agree with these setiments. But, we shouldn't put the OP off too readily. Researching and creating a limited compiler that works on a subset of a chosen language is a very beneficial learning excercise for the computer engineer / software developer.

hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
 

Really, there are enough compilers out there already.... Try something else, perhaps adding to a compilers library

spankyg
Light Poster
38 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

>Researching and creating a limited compiler that works on a subset of a
>chosen language is a very beneficial learning excercise for the computer
>engineer / software developer.
Writing a compiler is a beneficial learning exercise, but not a C++ compiler. That's like saying that a hand made tool shed is a beneficial learning exercise, and then trying to build a skyscraper. There's levels of difficulty when it comes to compilers, and C++ is right at the top. Even if you restrict yourself to an extremely limited subset of the language, you still have to deal with complicated mess of the language grammar.

>How can i make c++ compiler under windows or Linux.
I'd start by looking at the code for an existing C++ compiler. GCC, for example. That should give you an idea of what's involved.

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

what are C compilers written in?

C?

Assembley?

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 
what are C compilers written in? C? Assembley?



:D
which came first: the chicken or the egg!!

Killer_Typo
Master Poster
781 posts since Apr 2004
Reputation Points: 152
Solved Threads: 39
 

>what are C compilers written in?
C compilers tend to also be C++ compilers, and they're generally written primarily in C or C++.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 
:D which came first: the chicken or the egg!!

In case of Borland's compilers, they're written mostly in Pascal.
And that includes their Pascal compilers...

They wrote a compiler stub that could compile a minimal subset of the intended language in machine code or Assembly, used that to compile a compiler that could do a bit more of the language, and so on until they had one that could compile the entire language specification.

When they had that they could use that compiler to compile compilers for other languages like C++ and C#.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

What is machine code written in logic gates?

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

Don't worry. u r not writing world's *FIRST* compiler. u can use VC++, Dev-C++, Borland, .Net, Java, or any other language that can process text and can call OS API's 2 write ur compiler.

Me_Nit
Newbie Poster
4 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 
Don't worry. u r not writing world's *FIRST* compiler. u can use VC++, Dev-C++, Borland, .Net, Java, or any other language that can process text and can call OS API's 2 write ur compiler.


Don't you think it is awkward to write reply for post over 2 years old where discussion died and problem is either solved or forgotten?

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 
Don't you think it is awkward to write reply for post over 2 years old where discussion died and problem is either solved or forgotten?


I don't find anything wrong in it. May be someone in future will b helped by it. U don't know! And what is lost in the process?

Me_Nit
Newbie Poster
4 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

Hello superiors.
Maybe, the the poster(one who started the thread) was talking about DSLs....like Groovy.

abhi_elementx
Junior Poster
119 posts since Dec 2007
Reputation Points: 11
Solved Threads: 7
 

plz tell me how to creat comipler???

sourav garg
Newbie Poster
1 post since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

didn't you bother to read the thread???

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 
what are C compilers written in? C? Assembley?

i think in c...

akabir
Newbie Poster
1 post since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You