Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Why has perl never been a compiled language...

by dchetlin (Friar)
on Dec 06, 2000 at 22:04 UTC ( #45258=note: print w/ replies, xml ) Need Help??


in reply to Why has perl never been a compiled language...

however my question is why an interpretor... Historically that is, are there strong advantages to creating an interpretted language over a compiled one. I am still not really sure I understand why a compiler for perl would be such a bad idea. What aspects of the language could not be supported by a compiler?

A compiled Perl script needs to have the whole Perl compiler/interpreter (it can be called either or both, depending on your point of view) bundled with it mostly because of `eval STRING'. For `eval STRING' to work, you have to be able to do everything you can do in the compile phase at runtime.

This topic just yesterday came up on the perl6-internals list. As it hasn't yet been captured by mail-archive, here's a message I sent:

The problem isn't the speed of `eval STRING' or the compilation system,
it's how to make it exist and work. To make `eval STRING' work, the
whole of the compiler has to be there, waiting, whenever a program is
run. That means a theoretical binary compile of `print "Hello world\n"'
has to come packaged with howevermany megs the Perl executable takes up.
And that all ports, for example JVM and Palm, have to implement the
compiler natively, rather than just having code compiled elsewhere and
sync-ed to the Palm or run from the JVM.

Simply deciding that `eval STRING' is "unimplemented" on these
theoretical ports and binary compiles is the best idea I've heard yet,
but we should remember that `require' is built on `eval STRING'.

There are a lot of issues involved here, but that's basically the executive summary of why all of Perl can't be supported by a "reasonable" compiler.

-dlc


Comment on Re: Why has perl never been a compiled language...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://45258]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-12-26 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls