Go Back   The UNIX and Linux Forums > Top Forums > Programming
.
google site



Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-12-2008
Registered User
 

Join Date: Oct 2008
Posts: 33
How Can a Machine Reads a Compiler Since A Compiler is Written in Text! Not Binaries?

To make a programming language you need a compiler, so what was the first programming language and how was is created if you need the compiler first?

The compiler itself is considered as a high language comparing to the machine! since the compiler is not created in 1's and 0's...

Eventhough i have programmed before, this question confuses me everytime...
Sponsored Links
  #2 (permalink)  
Old 11-12-2008
Registered User
 

Join Date: Oct 2007
Location: USA
Posts: 759
The compiler is a binary program not ASCII text...maybe you mean how do you compile a compiler.
  #3 (permalink)  
Old 11-12-2008
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 2,454
I believe B, C's precursor language, was written in raw assembly language. Then they wrote a C compiler in B.
  #4 (permalink)  
Old 11-12-2008
Registered User
 

Join Date: Oct 2008
Posts: 33
I still don't get it.....A compiler is binary, so its been executed, so what compiled the compiler! And the compiler compiler's in what language was written?

It is not a big deal, but i just find it hard to take it. Maybe its my problem :-/

Last edited by f.ben.isaac; 11-12-2008 at 07:03 PM..
  #5 (permalink)  
Old 11-13-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 6,156
You are asking the chicken & egg question - which comes first?
You can write a binary executable directly in hex, so very early assemblers (which are compilers) were written that way. There also were link editors as well. ld for example.

I like Corona's explanation. I think at one time I read that as well.

Most compilers are based on lex & yacc. Read about those.
  #6 (permalink)  
Old 11-13-2008
Registered User
 

Join Date: Oct 2007
Location: USA
Posts: 759
Quote:
Originally Posted by f.ben.isaac View Post
I still don't get it.....A compiler is binary, so its been executed, so what compiled the compiler! And the compiler compiler's in what language was written?

It is not a big deal, but i just find it hard to take it. Maybe its my problem :-/
The compiler's job is to produce assembly code given C source as input. The output of the compiler is fed to the assembler which translates all assembly code into machine code and finally the link editor sets up all the linkages to external functions.

Compiling the compiler is a process called bootstrapping similar to the way your machine boots up...more on it here.
  #7 (permalink)  
Old 11-13-2008
Registered User
 

Join Date: Oct 2008
Posts: 33
Quote:
Originally Posted by jim mcnamara View Post
You are asking the chicken & egg question - which comes first?
You can write a binary executable directly in hex, so very early assemblers (which are compilers) were written that way. There also were link editors as well. ld for example.

I like Corona's explanation. I think at one time I read that as well.

Most compilers are based on lex & yacc. Read about those.

>>You can write a binary executable directly in hex,

And HEX, so what translates these hexes to binaries for the compiler?
If a agree with you, writing in binary 1 & 0 will make machine understand what do you want to do! There has to be convertion between hexes to binaries and since hex is not binaries, what does the conversion! Machine does not giva a damn to anything else except if there is another binary written as a translator who translates hexes back to binary. Any idea?

I'm very new to this, i ask in a very dummy questions to know the basics - only overview, no technical stuff....

THANKS
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
State Machine Compiler 5_1_0 (Default branch) Linux Bot Software Releases - RSS News 0 05-20-2008 09:30 PM
Ragel State Machine Compiler 6.1 (Default branch) Linux Bot Software Releases - RSS News 0 03-27-2008 09:50 AM
State Machine Compiler 5.0.2 (Default branch) Linux Bot Software Releases - RSS News 0 01-14-2008 07:40 PM
State Machine Compiler 5.0.1 (Default branch) Linux Bot Software Releases - RSS News 0 01-05-2008 05:30 AM
C compiler to build Sparc/Solaris binaries on Linux lyonsd Programming 2 12-08-2006 04:56 PM



All times are GMT -4. The time now is 11:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0