Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: Pre-compiled Perl?

by LanX (Saint)
on Apr 05, 2017 at 23:43 UTC ( [id://1187198]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Pre-compiled Perl?
in thread Pre-compiled Perl?

> The thing about Perl is that it lets you execute Perl code during the parse.

What do you mean?

Macros are executed during the parse and LISP is one of the two oldest higher order languages and often copied.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

Replies are listed 'Best First'.
Re^6: Pre-compiled Perl?
by shmem (Chancellor) on Apr 06, 2017 at 08:10 UTC
    What do you mean?

    I guess it is the fact that files loaded via use are compiled and executed whilst parsing the loading file.

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
      Afaik does a require in Ruby also execute the code, and while not being an expert in Python it was easy to find the function __import__() which is executed at import. °

      I'd rather say execution at import is the rule and not the exception for dynamic languages.

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

      footnotes

      °) just checked it, no difference in Python, just see Why is Python running my module when I import it

Re^6: Pre-compiled Perl?
by Anonymous Monk on Apr 06, 2017 at 14:07 UTC
    Macros are executed during the parse and LISP is one of the two oldest higher order languages and often copied.
    Hm. Obviously I haven't thought my statement through all the way. LISP can be completely parsed without executing any code; Perl can't.
        Perl code is allowed to do things during the parse that change the outcome of the parse. Installing source filters, obviously. Function declarations and prototypes, less obviously. It's a big pain for syntax-highlighting editors.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-19 20:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found