Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
View Poll Results: Do you find this interesting to think about?
John Backus headed the IBM team of researchers, at the Watson Scientific Laboratory, that invented Fortran. On the IBM team were the notable names of scientists like; Sheldon F. Best, Harlan Herrick (Harlan Herrick ran the first successful fortran program), Peter Sheridan, Roy Nutt, Robert Nelson, Irving Ziller, Richard Goldberg, Lois Haibt and David Sayre. The IBM team didn't invent HLL or the idea of compiling programming language into machine code, but Fortran was the first successful HLL and the Fortran I compiler holds the record for translating code for over 20 years. The first computer to run the first compiler was the IBM 704, which John Backus helped design.
It is worth summarizing compactly the roles of the direct contributors to today's C language. Ken Thompson created the B language in 1969-70; it was derived directly from Martin Richards's BCPL. Dennis Ritchie turned B into C during 1971-73, keeping most of B's syntax while adding types and many other changes, and writing the first compiler. Ritchie, Alan Snyder, Steven C. Johnson, Michael Lesk, and Thompson contributed language ideas during 1972-1977, and Johnson's portable compiler remains widely used.
Grace Brewster Murray Hopper
Born: December 9, 1906 in New York City
the creator of the first compiler, and creator of COBOL
coining the term "bug"
worked for the us navy on computers
anyway it is still possible to write machine code directly and that's how they did it.
it's not like a true chicken and egg thing. Machine code existed already before the idea of compiler.
compilers are just translators.
first compiler just interpreted numbers and translated into machine code
Using call numbers, the compiler would retrieve machine code subroutines stored on tape.
this might by todays standards be an interpreter not a true compiler ?
but anyway compilers don't create anything new they are just a convenience like a car.
even without the car we can still get places it just takes longer
Computers take instructions in the form of a string of bits. These bits are not meaningless, they do different things. For instance, let's make up an imaginarey machine, and give it 2 instructions, 0 & 1. 0 does a HALT... halts the computer, 1 does a LR, loads some register with a bit in memory. Pretend our computer has a 2 word ram, each word 1 bit. So when using LR we also provide an address (either 0 or 1 for one of our 2 words). You can write a complete program for the computer using only 0s and 1s. Each instruction is 2 bits, the first our op code (HALT or LR), and the next the memory address. For instance, 101100. (10) Loads the bit in memory at address 0, (11) then loads the bit at address 1, (00) then halts the computer. Now, obviously our computers today have a lot more instructions, Your computer probably has less than 256, but that's still alot. And it probably has tons or ram. So, you can actually start writing programs using a strings of 0s and 1s. So the first program were actually created setting sets of bits to either 0 or 1 and that would be a program. Next came assembly language. This basically just changed each instruction (0 or 1 in our case) into a word, called a mnemonic. An example of our program would be like this:
LR 0
LR 1
HALT
Which could be "assembled" into this 101100
We could then write an "assembler" using binary strings (machine code), obviously not with our imaginary computer, since it lacks the capibility to do so, but a halfway decent computer could. Once we have an assembler created, we can start writing much more complex programs (or atleast write them a lot easier). We could even start writing better assemblers with our assembler. Using an assembly language we could create compiler for even higher level languages, like FORTRAN or C. We can than use these compilers to compile even better compiler for these languages using these languages. Hope this made sense.
well,not exactly....
Writing an efficient compiler is more difficult that writing an OS Kernel.
Compilers, in contradiction to assemblers, are extremely sophisticated programs.
different compilers, output different assembly code for the same source.
Last edited by perfect_circle; 12-02-2004 at 05:30 PM.
Just a side note, but the 'compile a compiler' problem is called bootstraping. The name comes from the phrase "to pull yourself up by your bootstraps". That's also why starting a computer is called 'booting', because you need a program to load the OS, but you need an OS to run a program.
Thanks guys for your help! And for the moderator, I know it wasn't really an LFS something, but I didn't know where to put it elsewhere.
If I understand good, the first compilers didn't need to be compiled. Kinda. A compiler needs an assembler, an assembler needs a compiler... So if they are both made at the same time (or something) then it will outcome good.
assembler: A program that converts an assembly code to the corresponding machine code(really easy task).
compiler: A program that converts a programming language code to a corresponding assembly code(hard task).
Last edited by perfect_circle; 12-03-2004 at 11:16 AM.
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
machine code is directly executed by the computer. assembler is the first step up from that. the first C compiler could have been written in any language first. probably assembler, but you could write one in anything. the gcc source has code in it, script and assembler i think, that can make enough of itself to build itself if it has to. you compile gcc 2 or 3 times to get it fully done that way. best i remember anyway.
Originally posted by perfect_circle what do you mean by better?
e.x.
MOV something,something
the assembler just translates MOV to the binary opcode of the command and the something,something to the binary values of those numbers.
There are no good or bad assemblers, unless you mean having extra features
Yes, what else would I mean? I've written assembler's for a couple "toy" computers I've created at school (using design software), and there are tons of things you can add to them to make them better. There are lots of features that you probably take for granted, that you don't need in an assembler at all and that don't just "tranlate" "to the binary opcode", especially if your creating one out of machine code.
On top of that, there are improvements. You can speed up the assembler greatly as well. Would this not be better?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.