Re: p-code compilers

"Derek Ross" <derekross@fisheracre.freeserve.co.uk>
23 Jan 1999 17:32:29 -0500

          From comp.compilers

Related articles
p-code compilers ec98bna@brunel.ac.uk (Bogomil Alexondrov) (1999-01-22)
Re: p-code compilers dwight@pentasoft.com (1999-01-23)
Re: p-code compilers genew@vip.net (1999-01-23)
Re: p-code compilers derekross@fisheracre.freeserve.co.uk (Derek Ross) (1999-01-23)
Re: p-code compilers eodell@pobox.com (1999-01-25)
Re: p-code compilers toon@moene.indiv.nluug.nl (Toon Moene) (1999-01-25)
Re: p-code compilers aaron@farol.chem.purdue.edu (Aaron F. Stanton) (1999-01-27)
Re: p-code compilers wlohmann@informatik.uni-rostock.de (1999-01-27)
Re: p-code compilers rock@twr.com (Robert Howard) (1999-01-31)
Re: p-code compilers sda@rt66.com (1999-01-31)
| List of all articles for this month |

From: "Derek Ross" <derekross@fisheracre.freeserve.co.uk>
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.


Cheers


Derek


Post a followup to this message

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