On Wed, 3 Feb 2010, Mike Connors wrote: > Date: Wed, 03 Feb 2010 01:51:16 -0800 > From: Mike Connors <[email protected]> > Reply-To: "General Linux/UNIX discussion and help; civil and on-topic" > <[email protected]> > To: "General Linux/UNIX discussion and help; civil and on-topic" > <[email protected]> > Subject: Re: [PLUG] Facebook & PHP - massive speedup > > Carlos Konstanski wrote: > > Writing a monster website with zillions of users in any interpreted > language seems silly to me. Fixing it by making PHP a compiled > language is one way to solve the problem, I guess. A simpler solution > might have been to translate the codebase to a compiled language. > > Excuse my ignorance on the matter, but what makes a > interpreted language inherently less appropriate for a web site like FB, > and > a compiled language inherently more appropriate. I'm not asking for a full > scholarly redress, but just a summary of the key points...
An interpreted language does all the work of translating the high-level, complex, abstract programming statements written in a human-readable language into machine code (the only kind of code a computer can _actually_ execute) at runtime, right when a result is needed. A compiled language translates the human-written source code into machine code beforehand, so that at runtime the computer can execute the ready-made machine code hell-bent-for-leather. There is an in-between compromise called bytecode. Languages like java and C# are not compiled into directly executable machine code. Instead, they are compiled into a form that is still interpreted at runtime, but it is highly optimized to interpret very quickly. These languages use a virtual machine, or "runtime", to "execute" the bytecode. What the runtime actually does is read segments of bytecode and compile them into real machine code on the fly, the results generally not being stored on disk. This is where we get the term "Just In Time Compilation", or JIT. An interpreted language will always run more slowly than a compiled language because of all the extra work that has to be done at runtime. There may be some oddball cases like TinyBasic, but we're talking about high-level application programming languages here. Carlos _______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
