Jump to content
xisto Community
PaulAmanda

Who Compiles Software That Compiles Software!

Recommended Posts

If you need a C compiler to compile a program in C for example, who made the C compiling program, and how? Does it work from an older programming language, or is there some neat programming trick that I'm missing here? It's a bit puzzling to me.

Edited by truefusion (see edit history)

Share this post


Link to post
Share on other sites

LOL, thats a pretty weird question but I think the people who make complier software make it in a different language or they for example, code the complier software in C and then they manually convert it somehow, you know, the stuff that the complier does behind the scenes. That's the only way i can think of :/

Share this post


Link to post
Share on other sites

your question is who has made that compile program ? anyone can make one but why it is important for you ? For example GCC is a compiler i'm currently using for compiling c and c++ so it is written it self with combination of c and c++ , they are many people who are working on GCC and not a particular one has made this program, if you want to know who started writing of this program then i found the name Richard Stallman in their website which seems is the starter of this compiler.A compiler can be written in its compiling language or in another language, maybe first compiler of C is written in assembly or may be not (i don't know) but you can even compile your written compiler with your own written compiler (a bit weird :D) and this is called bootstrapping. by this way you can compile your own compiler with your own compiling procedure. maybe you can call it a programming trick but it is not actually a trick it is a way of writing a compiler without using other compilers so you can say this compiler is completely written by me. When you say C or you say C++ don't think this is a magic word, actually all languages are only like a dictionary, every word has a definition and the compiler only translate it to your target language, a language that your machine can understand.For understanding better i will give you an example, just look at a microcontroller of AVR series which are consisting of ram, rom, a 8-bit processor and flash memory. when i say a machine language for this ucontroller i mean a string of hex codes which goes into flash memory of this ucontroller. when i power up UC then it goes to the first block of its flash memory and reads it, for example it reads 4F in that block, this means it has to do something and after doing that job it goes to next block and reads its content and again does what is releated to that code, so a machine code for this UC is a hex code. this procedure is what is going on for your computer and so the target language depends on the architecture of your cpu and as your operating system works like a interface so it depends on your operating system too (mentioned UC doesn't have an OS).So if you didn't understand anything from above sentences then i will say one thing, you can write a software in any language you want then you can convert it to your machine language completely manually (it maybe take you some months :D) then you can run your code in your machine again completely manually (using some boot knowledge ) so the first thing is what you can do (writing a program in any language) the second thing is what a compiler do (translating it) and the third thing is what your OS is doing so i hope you understand it all .

Share this post


Link to post
Share on other sites

I asked this question on stackoverflow and got some answers which i can't digest, even though i have programming background. I found that there are some compilers which do the low level compilation and debugging. This is how they use C/C++ in operating system and on low level stuff. Usually what they told me is that from assmebly they built foundation to middle and high level languages so assembly is still at the bottom compiling or running things. I'm not sure if you can understand anything from what this means or the stuff related to this but this is what i have found on stackoverflow. If you want professional answer to that then ask at stackoverflow.com.

Share this post


Link to post
Share on other sites

Software compilers can be written in any language. For example a C compiler may be written in assembly language, C, or even Pascal! From a software developer's perspective, a software compiler is just another program. You can even write a software compiler for C using Visual Basic, though that's fairly uncommon.Typically, the compiler of a new language is written in its prevailing predecessor and as new compilers are developed, the compilers are developed in the language itself. What I mean to say is that the first GW-BASIC compiler would not have been written in GW-BASIC because GW-BASIC did not exist back then. However, somebody may have written a GW-BASIC compiler in GW-BASIC compiler later, perhaps as an academic project. Academic projects tend to die-out after they have been turned in for grades due to a lack of time and due to more interesting pursuits for the original developer, which is why we rarely even hear about most of them. Academic projects are, however, quite interesting and aren't always the usual business process automation applications.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.