FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » A Few Noob Questions
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: A Few Noob Questions [message #175170 is a reply to message #175164] Thu, 18 August 2011 17:44 Go to previous messageGo to previous message
A.Reader is currently offline  A.Reader
Messages: 15
Registered: December 2010
Karma:
Junior Member
On Fri, 19 Aug 2011 00:40:26 +0800,
Man-wai Chang <toylet(dot)toylet(at)gmail(dot)com> wrote:

>>> In the old days, "Programs" were compiled into binary codes for direct
>>> execution by the CPU. "Scripts" were not compiled, but interpreted by a
>>> program called intepreter.
>>
>> Contrary to popular belief, scripts, i. e. programs written in a scripting
>> language, are compiled, too. They are *JIT-compiled* *at runtime*.
>
> Is this real compilation? :)

How do you define "real compilation"?

The principle of compilation, as of assembly, is translate once
(because translation is slow and was costly), and ever after just
run the product of the assembly/compilation process.

So, given that definition, compiling to p(seudo)-code is just as
much compilation as compiling to machine code.

Only the execution environment is different: pcode runs on a
pmachine, a virtual chip implemented in software rather than
hardware and thus potentially able to be run on any hardware to
which that pmachine has been ported. Machine code runs directly
on the hardware -- but only the specific type of hardware for
which it was written. Machine-code programs are fast, pcode
programs are slower, source-interpreted programs are slowest.

PHP, like Java, JavaScript, and quite a few other languages,
compiles to pcode, and the programs run on a pmachine.

>
>> PHP 4+ scripts are compiled by the Zend Engine (a virtual machine, currently
>> Zend Engine II), to Zend Opcode, a platform-independent byte code (much like
>> with Java). That byte code is interpreted by that VM.
>
> So is PHP still a script?

Of course you can call a php program a "script" if you like, but
the traditional name for any coherent, task-oriented set of
computer instructions, regardless of how or whether they are
compiled, is "program".

I've never seen the point of inventing new names for existing
concepts; all it seems to do is add confusion. But some people
profit from confusion, so I'm sure that explains at least part of
it.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to integrate paypal payment Indian currency support ..?
Next Topic: Looking for good C and C++ PHP plugin examples
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Oct 21 09:22:52 GMT 2024

Total time taken to generate the page: 0.04619 seconds