Compiler, Object, Source Code

Compiler, Object, Source Code

Articles , , , , , , , , , , , , , , , , , , , , , , 0 Comments



when you land in the world of computers with their strange convoluted machine language it's a bit like landing on another planet whose inhabitants speak an equally strange convoluted alien language getting a mechanic on Planet gobbledygook to repair your spaceship would present the same sort of problem that you have when you want to get a computer to do something everything you say has to be translated and you have a choice between two different sorts of translator one of them is called an interpreter and the other is called a compiler let's suppose that you've previously written out your list of instructions for the repair of your spaceship and suppose that you choose the interpreter to do the translating he reads your first instruction open lid of rocket engine translates this into gobbledygook and immediately passes it on to the mechanic who executes the instruction then the interpreter reads your second instruction remove spark plug translates this in the gobbledygook and passes it on to the mechanic who executes it and so on and so forth now notice how the interpreter works he stays with you all the time and he translates each of your instructions immediately one by one this is a rather slow process because the mechanic has to wait while each instruction is being translated but on the other hand it does give you a chance to correct your mistakes as you go along if the mechanic removes the wrong sparkplug for instance you'll see this happen right away and you'll be able to change your instruction accordingly compare this with the way the second sort of translator the compiler goes about his work he takes your complete list of instructions and without further ado translates the whole lot straight into gobbledygook he then hands them back to you and goes away leaving you all on your own all this has taken some time but from now on things will go very fast you hand the complete list of gobbledygook to the mechanic and he executes them all in one go bang bang bang there's no waiting about this time but there's one disadvantage to this of course if there was a mistake in your instructions it's too late now this analogy comes very close to the way the interpreter and compiler translator programs actually work with computers an interpreter runs slowly starts right away and lets you see how things are going whereas a compiler takes extra preparation time before your program can run but then lets it run very quickly as efficiently to help you remember the difference between an interpreter and a compiler look at the words themselves inter means between the interpreter is always between your program and the computer and it translates line by line to compile on the other hand means to pile together a compiler piles together your entire program and translates the whole thing all at once which one you use on planet gobbledygook is entirely up to you

Leave a Reply

Your email address will not be published. Required fields are marked *