[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: COBOL compiler



Дана сре, 27-08-2003 у 06:41, Pigeon је написао:
--snip--
> Is there any reason why any of these complex scripting languages have
> to be interpreted, as opposed to compiled?
> 
> Some quite complex packages are around which have been written in
> such languages; Perl seems to be both common and expensive. It would
> appear that the inefficiency of Perl is the reason why my print server
> (a 600MHz box) takes forever to render pages for my Canon LBP-4, which
> uses a foomatic driver, compared to the time it takes for a printer
> that speaks straight HewlettPackardish and can use one of cups's
> built-in drivers. Similarly, spamassassin seems to be notorious for
> chewing up lots of resources.
> 
> To me, it seems that the obvious solution is to run the script through
> a Perl compiler, and produce a binary executable that should execute
> at the same order of speed as any other compiled HLL code. Why is this
> not done? Is it simply that nobody's bothered to write a Perl
> compiler, or is there some infelicity in the design of Perl that makes
> it impractical?

You should keep in mind that a lot of the overhead involved with Perl
comes from having to load the interpreter. In the case of webservers,
you can get tremendous results by constantly keeping the interpreter
loaded and just forking off processes.

The plain-text nature of Perl is also one of the things that makes it so
portable. There are of course other solutions. Java, for example, uses
compiled bytecode. But the speed gains here are negligible. The primary
reason for it is so people can hide their source from the rest of the
world.

There are Perl compilers out there, but they're not widely used. Any
potential speed increase is on par with just keeping the interpreter
loaded. And it's also important to remember what Perl is intended for.
Remember the "extraction and report" part. Perl isn't designed for you
to run 3d rendering (though it probably could :). It's designed to
create reports. A task where it can be argued that the speed at which a
program can be written is more important than the speed at which it
executes.

-- 
Alex Malinovich
Support Free Software, delete your Windows partition TODAY!
Encrypted mail preferred. You can get my public key from any of the
pgp.net keyservers. Key ID: A6D24837

Attachment: signature.asc
Description: =?koi8-r?Q?=EF=D7=CF?= =?iso-8859-5?Q?_=F8=D5?= =?koi8-r?Q?_=C4=C5=CF?= =?koi8-r?Q?_=D0=CF=D2=D5=CB=C5?= =?koi8-r?Q?_=D3=C1?= =?koi8-r?Q?_=C4=C9=C7=C9=D4=C1=CC=CE=C9=CD?= =?koi8-r?Q?_=D0=CF=D4=D0=C9=D3=CF=CD?=


Reply to: