Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Rex2: Interactive Perl vs. Shell Script

by stefp (Vicar)
on Jul 02, 2002 at 18:27 UTC ( [id://178946]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl vs. Shell Script
in thread Perl vs. Shell Script

There are currently two problems that preclude perl to take off as an interactive shell. The grammar and the scoped eval.

The current grammar of Perl5 makes perl as interactive shell irrealistic. An interactive shell uses a lot of string literals that must be quoted in Perl which is very impractical. That problem will be solved by the ability to dynamically tailor the perl6 syntax. There is no doubt that a syntax for interactive use will emerge: redirection and pipe will be expressed more shortly than comparaison and bitwise or. We call that "Huffman coding". Currently attempts (filter, preprocessor...) to build an interactive shell from perl can only be hacks.

The second problem is the current behavior is the amnesic eval which against granular interaction that is the basis of interactivity. Indeed each line must be evaluated but the amnesic eval force the user to type unacceptable long lines. I explained te problem in RFC 351: Beyond the amnesic eval but the grammatical hack I proposed does not fit in Perl6 syntax.

Anyway, if I read correctly the apocalypse and exegesis. try { } will be the Perl6 equivalent of the Perl5  eval {  }. I hope that the string eval eval "" which is not braced will be unscoped in Perl6. This seems consistent with the general principles stated for Perl6 syntax

These 2 problems solved, I see no raison that Perl6 won't eventually become the prevalent interactive shell.

-- stefp -- check out TeXmacs wiki

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-19 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found