LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-15-2007, 01:34 PM   #1
pr0gm3r
Member
 
Registered: Nov 2003
Location: CA
Distribution: SuSE 10.2
Posts: 35

Rep: Reputation: 15
Smile Genesis:The begining of Compiler


I do google search How did the 1st compiler was created? with different keyword, but I couldn't find the answer I'm looking for, So I bought this book Progamatic Compiler Design(I couldn't remember the exact name ofit),
the book is good describing compiler design from syntax, semantic, linking, compiling, run time
interpreter and networking programming (Socket).

but the book still doesn't answer my question...

This questions keep looping in my head...How did they design the first compiler? How to create compiler from scracth without the assigned compiler to compile the new compiler?

example: if we're creating new programming language lets call it D#.
We're designing D# compiler in D# syntax and its semantic. how do we compile this D# compiler without D# compiler?

Do we modify the GNU C compiler adding D# recompiler syntax, its semantic and all the other compier design requirement
such as linker, and run time?


Thank you,
 
Old 08-15-2007, 01:39 PM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Such a chicken (not egg) compiler would have to be written in assembler language or pure binary code.
 
Old 08-15-2007, 01:48 PM   #3
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"How did they design the first compiler?"

Computers were first programmed in binary. Then somebody wrote an assembler. Assembly language is a one for one correspondence between computer commands and binary instructions.

Then macros were added to assemblers. A macro generates several assembly instructions from one macro statement and then the assembler changes the assembly instructions into machine code.

Compilers developed from assemblers. The first compilers were essentially assemblers where you could do everything with macros without having to intersperce assembly instructions. Many early compilers worked by generating assembly code from the higher level language statements and then running the assembly code through an assembler.

Two of the earliest high level languages were Fortran and Algol. Cobol came shortly after. You can find out more information about the evolution of compilers from macro assemblers by looking up the beginnings of Fortran and Algol.

--------------------
Steve Stites
 
Old 08-15-2007, 02:10 PM   #4
pr0gm3r
Member
 
Registered: Nov 2003
Location: CA
Distribution: SuSE 10.2
Posts: 35

Original Poster
Rep: Reputation: 15
Thank you guys.. ^__^
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS the begining stu-t-ter Linux From Scratch 2 06-11-2007 01:47 AM
Sega Genesis Emulator doralsoral Linux - Games 1 06-06-2007 01:54 PM
LXer: The Genesis of the Linux Foundation LXer Syndicated Linux News 0 04-01-2007 02:16 PM
genesis- computer style titanium_geek General 3 04-28-2006 11:25 AM
Starting from the begining markstevens Linux - Security 3 06-27-2003 11:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration