|
Perl 6
Perl 6 Delta Tablet: Revision 33
Overview - Chapter: 0:History, 1:Design, 2:Basics, 3:Var, 4:Op, 5:IO, 6:{}, 7:Sub, 8:OOP, 9:Rx, 10:Meta TrendsUbiquityAs always, Perl is optimized for freedom and richness of expression. General PurposePerl 5 still has a lot of builtins, showing for which task the language was created. But to become more general purpose, the core was enhanced and some other parts got removed. File IO, Network and IPC, Formats, and finally that long deprecated pre P5 DB-binding (dbmopen) went out of the core or at least into sensible module namespace. The optional type system enables compiler optimisations to make Perl even usable in cases where you had to switch to C before. Less Unix CentricPerl 1 was a child of the Unix world, borrowing a lot of folklore and words. As Perl 6 had to regularize the Regex and reform some other parts, this heritage has become less visible. UnicodePer default all Perl 6 code is Unicode and you can use any weird character for any part of the syntax. Simple EnglishIn Perl 5 we had my, our, use, require, bless, can, ISA (is a), chop and also of course if, else, goto and all the loops. Perl 6 adds given, when, gather, take, loop, WHERE, HOW, WHO and lot more everyday English, which should make it easy to read and understand. Hidden ComplexityEven simple Perl 6 looks pretty much like older Perl, it has a tremendous complexity inside, which only have to show up if you really need it. Functional ProgrammingHigh order functions, currying, you name it. All that goodies are there, as Perl 6 aims to a full support of functional programming. Object OrientedOOP syntax is now more simplified, compact, knows about encapsulation and has many new features, including dynamic class composition. Like in Smalltalk or Ruby every "thing" (values, vars, blocks, routines) is an object and ops are "just" methods. It helps to have internally everything in its place. But programmer still can pretend it's not the case. Full IntrospectionBecause every object knows his attributes and methods, you can ask the compiler nearly anything about the state of your program. MetalanguageAnd because classes are made to get extended or changed, Perl 6 has not only full metaprogramming capabilities, beyond your wildest dreams. It is a metalanguage with a beginner friendly default that aims to become a family of languages. Rule of thumb: everything is allowed, as long as you declare it. One Spec - Many ImplementationsUnlike every other Perl so far, Perl 6 has a precise specification, written in Perl 6. This allows to have several implementations, even syntactical compatible ones. Syntactical Changes
Operator
Variable
Flow Control
Traps
News
Native Perl 6 (new idioms)
For more native Perl 6, read the cookbook.
Overview - Chapter: 0:History, 1:Design, 2:Basics, 3:Var, 4:Op, 5:IO, 6:{}, 7:Sub, 8:OOP, 9:Rx, 10:Meta |