Jump to content
xisto Community
Sign in to follow this  
Hooligan

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.

Share this post


Link to post
Share on other sites

compiler software is written in the most basic programming language. All your C/C++, Visual Basic, etc. are called HIGH LEVEL programming languages. The most basic programming language is a LOW LEVEL programming language called Assembly. This language is as close to machine language as it gets. The compiler basically translates high level programming languages into machine language.I've written some programs using assembly to program a processor to perform automated and controlled tasks. It's not that difficult but you have to control every aspect of the processor.

Share this post


Link to post
Share on other sites

I doubt people still right compilers in assembler. I had a professor who wrote an asselber in Perl for a microprocessor that was unique to the engineering department. Perl was a could choice for righting a complier in because it excels at manipulating text. An assembler is nothing more then a look up table. C is such a primitive language that the mapping between c code and assembly is pretty obvious. Aside from the need to parse expressions a c compiler need not be much more then a look up table. The basic compiler is also probably pretty intuitive. The translation from some languages such as JAVA, lisp and prolog to assembly may not be so obvious. Lisp and prolog are considered AI languages and in JAVA the code is first translated into beta code which represents instructions on a virtual machine. The virtual machine does not match PC assembly but may match closely to some sun systems. I herd the spark systems assembly is based on the JAVA beta code.

Share this post


Link to post
Share on other sites

compiler software is written in the most basic programming language.  All your C/C++, Visual Basic, etc. are called HIGH LEVEL programming languages.  The most basic programming language is a LOW LEVEL programming language called Assembly.  This language is as close to machine language as it gets.  The compiler basically translates high level programming languages into machine language.

 

I've written some programs using assembly to program a processor to perform automated and controlled tasks.  It's not that difficult but you have to control every aspect of the processor.

42171[/snapback]


Right... but not really the answer...

 

Actually, today's compilers are written in high-level languages. The orginal compilers, though, that was another matter. Before our first high-level languages, and before assembly... there was machine code.

 

Machine code was used originally for programming, and it was all done via 0110101010... etc. Assembly language was then thought of, and using machine code, our first assemblers were written (an assembly translates assembly into machine code).

 

Eventually, after using assembly for some time, a work on a new language, FORTRAN, began. And a compiler for this language was written in assembly (this took an incredible amount of time... several man-years of work, if I recall correctly).

 

And as I understand, that compiler was used to write other, better compilers, and so on and so forth. So, even though this C compiler was not written in machine or assembly code, it still relies on the original compilers and assemblers for it's existance.

 

That's the basic idea behind how it all works and came about.

Share this post


Link to post
Share on other sites

I believe I answered his question the way I had interpreted it.I'm assuming the guy was talking about the "chicken and egg" phenomenon regarding compilers. Just saying that they were made in assembly. Obviously today there are many more options.

Share this post


Link to post
Share on other sites

Ah, I see what you were getting at... it was just the use of present tense in relation to writing compilers in assembly that bothered me... :P

Share this post


Link to post
Share on other sites

compiler software is written in the most basic programming language.

42171[/snapback]


That sentence throws you off.

 

as no9t9 noted, compilers can be written in any language, no assembler is required.

 

If you go to computer engineering in university, in 3rd or 4th year you take a course on how to specify software mathematically, and you can take a course on how to design and write compilers. They usually use Java or more often C for this purpose.

Share this post


Link to post
Share on other sites

nowadays compilers are also written in Java or C and compiled. But earlier the compilers were written in assembly language. i.e, critical portions of compiler relating to parsing and converting to binary code would be written in assembly language as a basic functionality and then this would be used to develop the rest. As alperuzi said, the compiler design course in computer science relates to this and is very interesting. You can find material on this course online too. Go thru it, not that u would/would not understand it at the first go... but a little effort would make it worthwhile.

Share this post


Link to post
Share on other sites

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.

42160[/snapback]


 

assembler

take a toor of google with this query and you will get the answer

Share this post


Link to post
Share on other sites

Delphi > Game Maker > Program Creator > program...So technically somone compiled a program in a program compiled in a compiler in a compiler...dude...that's just stupid

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
Sign in to follow this  

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