Re: p-code compilers

"Derek Ross" <>
23 Jan 1999 17:32:29 -0500

          From comp.compilers

Related articles
p-code compilers (Bogomil Alexondrov) (1999-01-22)
Re: p-code compilers (1999-01-23)
Re: p-code compilers (1999-01-23)
Re: p-code compilers (Derek Ross) (1999-01-23)
Re: p-code compilers (1999-01-25)
Re: p-code compilers (Toon Moene) (1999-01-25)
Re: p-code compilers (Aaron F. Stanton) (1999-01-27)
Re: p-code compilers (1999-01-27)
Re: p-code compilers (Robert Howard) (1999-01-31)
Re: p-code compilers (1999-01-31)
| List of all articles for this month |

From: "Derek Ross" <>
Newsgroups: comp.compilers
Date: 23 Jan 1999 17:32:29 -0500
Organization: Customer of Planet Online
References: 99-01-078
Keywords: interpreter

Bogomil Alexondrov wrote in message 99-01-078...

> can a program not generating machine code but pseudo code be called
> compiler or is it a translator? what is the exact definition for
> compiler? Java is generating pseudo code so it must be a translator
> rather than compiler?

Java generates p-code, using its compiler. The p-code is then
interpreted by the Java Virtual Machine. Both Java and the JVM are
translators of different types.

Translator is a more general term than compiler. A translator is not
necessarily a compiler; it may be an interpreter. So what's the
difference between these two types of translator ? Well...

A compiler translates each line in a program just once whereas an
interpreter may translate a line several times if the line is involved
in a loop. Compilers come in various sub types but one major split is
between the traditional compiler which translates the whole program
for execution later, and the JIT (Just In Time) compiler which
translates the program line by line (or module by module) just before
each line is executed. This is similar to an interpreter except that
the JIT compiler keeps the translated code for later in case the line
is executed again, whereas the interpreter translates the line again
the next time it has to execute it.

By the way, p-code is different from pseudocode. Pseudocode is a
natural language based method of describing an algorithmn. P-code is
virtual machine code. The original p-code was developed for Pascal.
I suppose that's why it's called p-code.



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.