Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: (A6) Perl 6, a general-purpose language?

by pdcawley (Hermit)
on Mar 11, 2003 at 10:34 UTC ( #241989=note: print w/replies, xml ) Need Help??


in reply to (A6) Perl 6, a general-purpose language?

I have the feeling that I'm going to be repeating this for some time to come...

There is a very important distinction to be drawn between typed values and typed variables. C only has typed variables; you can't look at an arbitrary C value and know its type. You can do this in Perl, that's what bless and friends are for. In Perl 6 we'll be getting a richer set of value types out of the box and I applaud that. We're also getting typed variables in Perl 6, and that's good too, for several different reasons:

  • You will be able to define 'struct' in Perl that matches an equivalent C struct, which makes life so much easier for 'Glue' writers.
  • If you want it (and I can't imagine why you would) you can go the whole bondage and discipline route and adopt strict typing throughout your code.
  • Optimizers can make use of type declarations to improve performance, so you can opt to take B&D flexibility hit only in your inner loops (or at other points where a profiler shows you have speed issues)
Perl 6 also introduces a concept that I'll call, for the nonce, 'storage typing', which allows you to specify that a particular variable that looks like, say, a Scalar, is actually implemented by some arbitrary type that responds to the same interface as a Perl Scalar. This looks like being Perl 6's replacement for tying, and very nice it looks too.
  • Comment on Re: (A6) Perl 6, a general-purpose language?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://241989]
help
Chatterbox?
[shmem]: Discipulus: the <<>> operator is quite new, it is in perl5.24 for instance
[Discipulus]: ah! thanks shmem it works in strawberry 5.24
[shmem]: ah. Introduced in 5.22.0, see perl5220delta
[Discipulus]: if so the previous error is a bit misleading, anyway
[shmem]: well, previous to that << was always treated as the left-shift operator
[Eily]: or the here-doc operator
[Eily]: which is actually how it is parsed in this case
[shmem]: older versions of perl can't guess that "use of <<>> may be implemented someday" :D
Discipulus how much wise my brothers are? ;=)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2017-07-21 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (320 votes). Check out past polls.