On Monday 14 March 2005 15:02, Morten Gulbrandsen wrote:
You seem confused about a lot of things. Here are a few facts to consider:
'C' can indeed be interpreted. I used a 'C' interpreter once and it was a
quite horrible experience. It was marketed as an education tool, but to
totally transform the nature of a language like that made it so far from
reality it was worthless in my opinion.
Perl is actually a compiled language. Really. The Perl code gets compiled into
something a lot closer to a CPU's machine code than the Perl source really
is. When you run a Perl program the first phase is compilation. If you run a
really big Perl program you will notice a delay while this happens - with
small Perl programs it's too quick to notice.
There would be nothing to stop someone writing an alternative compiler which
takes Perl code and writes out CPU-specific machine code, much like a normal
'C' compiler does. Java compilers traditionally compile Java code to Java
Byte Code for the JVM to run, but there are compilers which compile Java to
CPU machine code. Such issues are more a matter of market requirements than
language or compiler technicalities.
Visual Studio is not a debugger, it's an integrated development environment,
which contains an editor, compiler, linker, debugger, profiler, and lots of
other tools. But yes, it's complicated. :)
A debugger is, as Jerry said, a "program/environment that allows you to
execute a program step by step, and inspect the state of the program between
each step." It doesn't simulate anything. It allows you to control the way
the program runs and the environment it runs in.
Because interpreted languages need a special environment to run in (i.e. the
interpreter) as opposed to just having their machine code instructions
dropped straight onto the CPU, there is a certain amount of control and
runtime information which that environment can give. This is often called
"introspection" - which means "looking into" something. Python in particular
is very good at this. But introspection isn't as useful as a debugger - you
can't use introspection to stop a program at a certain point, examine the
runtime data, change it, then resume the program.
So, in short, a debugger is useful in virtually all languages, regardless of
how they actually get executed. Perl has one built in. Most other languages
have one suppiled as an extra.
---
Derek Fountain, on the web here : <a href="http://www.derekfountain.org">Derek
Fountain</a>