In this post lets
discus some of the programming fundamentals.
What is a computer?
When our instructor
asked the same question in our class there were dozens of answers
were arising.
It is a machine,
where we can save data.
It is an electronic
machine that simplify our work.
Were some of the
common answers.
But we could say
Computer is a programmable machine. This means it can execute a
programmed list of instructions and respond to new instructions that
it is given.
And the main
function that a computer does is to process a set of data and make it
to a valuable information.
Computer is a machine and it doesn’t
know any humans language. As we discussed earlier we have to give the
instructions to the computer to make the things happen.
Compilers and
Interpreters are the components that help us to fulfil the task. We
know languages, But if any time comes to speak with a person who
doesn’t know any of our language we could use a person who could
speak both of our language to translate the conversation. The same
job is done by compilers and interpreters. It stands between us and
the machine, which is a computer, and translate our commands and
instructions.
What are interpreters and compilers?
Although both are
doing the same thing there are several differences between them.
Translation
Interpreter
translates the code statement by statement. But compilers translates
the whole code at once.
Time
To analyze the code
Interpreter take a short time, While compiler take a long time. But
to execute the code compiler is faster than interpreter.
Memory
When we talk about
memory interpreters does a good job, because compilers read the whole
source code into an object code. So compilers consume memory. But
interpreters doesn’t create any object code, so interpreters are
memory efficient.
Debugging
Debugging is
correcting the errors in a code. Interpreters stop the execution when
the first error found. So it will easy to debug, But Compilers read
the whole document and states all errors so difficult to debug,
comparing to interpreters.
Languages
Python, Ruby and
some other languages use interpreters. C, C++ use compilers.
**Some languages use compilers and interpreters both.
I hope you may get
some knowledge about interpreters and compilers.
In the next post we shall discuss about programing language
This comment has been removed by a blog administrator.
ReplyDelete