Perl6-Pugs
view release on metacpan or search on metacpan
* New infix non-short-circuiting boolean AND operator: `?&`
* Nullary reduction of builtin operators gives identity values: `[*]() === 1`
* Postfix operators can be called with a dot: `.++`, `$x.++`, `$x.\ ++`
* Prefix `=` now iterates on arrays as well: `=@array`
* Short-circuiting chained comparison: `1 > 2 > die('foo')` no longer fails
* Smart matching against code objects: `$obj ~~ { 1 > $_ > 5 }`
* Smart matching against implicit invocation: `$obj ~~ .meth`, `$obj ~~ .[0]`
* Typed constraints on autovivification: `my Hash $x; $x[0] = 1` now fails
* Typed declarations: `my Dog $fido`, `my T ($x, $y)`
* `*` is now always a term, never a prefix operator
=== Blocks and Statements
* Implicit invocation in `when`: `when .true {...}`, `when .<key> {...}`
* Listops in conditions no longer consume the block: `for say {...}`
* Loop topics are not forced into rw: `for 1..3 { $_++ }` now fails correctly
* New `&break` and `&continue` primitives for use within `when` blocks
* New `&leave` primitive for exiting from the innermost block
* New postfix `given` statement modifier: `.say given foo()`
* Support for `FIRST`, `NEXT`, `LAST` loop control blocks
* Support for `START`, `PRE`, `POST`, `KEEP`, `UNDO`, `ENTER`, `LEAVE` blocks
* Support for repeat blocks: `repeat {...} while 1`, `repeat while 1 {...}`
* Support for the `&each` list interleaver: `for each(@a; @b) -> $x, $y {...}`
* The `for` loop no longer double-flattens lists: `for %h.pairs -> $p {...}`
* Topicalisers for `if`, `else`, `while`, `given` blocks: `if EXPR -> $x {...}`
* Topicalisers for postfix `for` loop: `-> $x {...} for 1,2,3`
* `&last` and `&redo` now work in `repeat {...}` and `loop {...}` blocks
* `&take` no longer flattens array literals: `take [1,2,3];`
* `&take` now works in functions called from within a `gather {...}` block
* `BEGIN(...)`, `END(...)`, etc., are now parsed as calls, not syntax errors
* `END {...}` in `.pm` files are no longer ignored when executed directly
* `INIT {...}` now works correctly inside `eval "..."`
* `do {...}` is now a loop block that takes standard loop controls
* `do {...}` with statement modifiers is explicitly disallowed
=== Regexes and Grammars
* Anonymous tokens and rules anchor on both ends: `123 ~~ token{2}` is false
* New `s[...] = EXPR` and `s[...] = .meth` syntax; `s[...][...]` is deprecated
* New `tr///` syntax for transliteration; `y///` will not be supported
* Pugs::Compiler::Rule (PCR) replaces Parrot/PGE as the default engine
* Support for `:c/:continue`, `<prior>`, and much more: see PCR's ChangeLog
* `$()`, `@()` and `%()` parse correctly as `$$/`, `@$/` and `%$/`
* `/.../` matches `$_` under Int, Num and void context in addition to Bool
* `m:g/(1)|(2)/` now returns only successfully matched subcaptures
=== Modules and Routines
* Allow space-separated adverbial named arguments: `f( :x<foo> :$y :!z )`
* Multi-dispatching now handles named, slurpy and optional arguments
* Multi-dispatching now handles parenthesized expressions as arguments
* Named arguments with no matching parameters is now an error
* New `&c.call($capture)` method to call without a caller frame
(similar to Perl 5's `goto &sub`, but it returns)
* New `&c.signature` method to get a Signature object from a Code object
* Parse for the `proto` routine modifier: `proto method foo ($x) {...}`
* Precompiled `.pm.yml` files with mismatching AST version will no longer load
* Support for user-defined unary and optional-unary prefix macros
* The main package is now ::Main, not ::main
* `&?CALLER_CONTINUATION` is now fully reentrant
* `&yield` in coroutines works correctly within loop blocks
* `sub ($x = 0 is copy)` no longer allowed; say `sub ($x is copy = 0)` instead
* `sub f ($x is lazy) {...}` no longer evaluates $x more than once
* `sub f (@x?) {...}; f()` now sets `@x` to `[]`, not `[undef]`
=== Classes and Objects
* Attribute-like method call syntax: `@.method(1)`, `$.method: 2, 3, 4`
* Class attributes: `class C { my $.x is rw }`
* Class name literals are now term macros, not prefix functions
* Compile-time self-mixin no longer allowed: `role A does A`
* Default initialiser expression for attributes: `class C { has $.x = 123 }`
* Dot attributes are now method calls: `@.x` is the same as `@(self.x)`
* Dynamic method calls: `$obj.$meth`
* Hyperised method calls: `$obj.>>meth`
* Quantified method calls: `$obj.*meth`, `$obj.+meth` and `$obj.?meth`
* Reopening classes: `class C is also {...}`
* Role mixins: `role R {...} class C does R {...}`
* `$?SELF` is gone; write `self` instead
* `BUILDALL`/`DESTROYALL` trigger once per class even with diamond inheritance
* `does R` and `is C` statements in class body now evaluate in compile time
=== Built-in Primitives
* New `&HOW`, `&WHAT` and `&WHICH` functions replace `&meta`, `&ref` and `&id`
* New `&VAR` macro to force lvalue evaluation of an expression
* New `&comb` function, a dual to `&split` but matches the wanted parts
* New `&crypt` function to create one-way digest strings
* New `&fork` function to create a new process
* New `&printf` function for formatted printing
* New `"emeta` function for escaping strings
* Support for `%b` in formatted printing
* The `&system` function no longer dies when the command does not exist
* The `.as` method is renamed to `.fmt` for formatted printing
* The `.perl` method now returns Unicode strings
== Bundled Modules
=== New modules
* [ext/Automata-Cellular/] - Build and render cellular automata in a terminal
* [ext/Math-Basic/] - Basic mathematical functions and constants
* [ext/Math-Random-Kiss/] - Pseudo-random number generator
* [ext/re/] - Pragma to choose among grammar engine backends
=== [ext/CGI/]
* A new `as_yaml` method to dump CGI parameters as YAML
* Allow initializing the CGI object with a hash of parameters
* New `Dump` function adapted from Perl 5's CGI.pm
* New basic tests for `escapeHTML` and `unescapeHTML`, which were broken
* New tests for `PATH_INFO`
* Only send the Content-Type: header if we actually have a content-type
* Only send the Status: header if it's a redirect, or if it's explicitly added
* Refactored into an OO-only module. N.B.: this breaks backwards compatibility!
* Some work on charset handling, though a `charset` method is still missing
* The `content_type` method is renamed to `type` for compatibility
* The `cookies` attribute is renamed to `cookie` for compatibility
=== [ext/HTTP-Server-Simple/]
* `state $variable`
* `unlink()`
=== Parrot backend
* Parrot 0.4.1+ is now required for Parrot targeting and embedding
* Closure creation no longer triggers segfaults
* Lexical variables are now truly lexical instead of emulated by temps
* Upon program exit, embedded Parrot/Perl5 objects are finalized correctly
* Support for modules with lexical imports
* When looking for an external parrot, look in `%ENV<PARROT_PATH>` first
=== PIL^N backend
* New VM written in Haskell which uses the domain specific language PIL^N
** Based on the Perl6-ObjectSpace prototype
** Optionally built with `make pil` (and interactively as `make pili`)
** See [src/PIL/Native/] for the source code
* Class Meta-Model written and bootstrapped in PIL^N
** Basic tests for Meta-Model in [t/pil/]
* Role Meta-Model partially complete in PIL^N
* Some basic Container types written in PIL^N
** See [docs/notes/piln_object_repr_types.pod] for implementation notes
* Haskell implementation of Perl 6 Rules and precedence parser
** See [src/Text/Parser/] for the source code
=== Perl6-ObjectSpace
* Prototype Perl 5 backend, served as the inspiration for the PIL^N backend
** Currently somewhat out of sync with PIL^N
** See [perl5/Perl6-ObjectSpace/] for the source code
* Core set of /native types/ written in Perl 5
** Class Meta-Model bootstrapped using only the native types
** Role Meta-Model and Container types not yet supported
* Based on work from the [perl5/Perl6-MetaModel/]
= Changes for 6.2.10 (r7520) - Oct 10, 2005
== Feature Changes
=== Shared components
* Support for the Haskell Cabal framework, exposing Pugs as a library to other
Haskell users, paving the way for use in IDEs, as well as future Inline::Pugs
and Inline::GHC modules
* Adopted the code convention of expanding literal tab chars to spaces
* JavaScript backend can be invoked with `pugs -B JS`
* Perl 5 backend can be invoked with `pugs -B Perl5`
* Pugs will now compile version ranges in 'use/require' statements
* Significant backend enhancements; see below
* `$?PUGS_BACKEND` can be used to tell which runtime is in use
* `exec` emulated (partially) on Win32
=== JavaScript backend
* Passes 91% of the main test suite (including TODO failures)
* Integrated with MetaModel 1.0
* Faster code generation, taking advantage of `-CPerl5` output
* Switched to continuation passing style (CPS) to properly support
`return()`, `&?CALLER_CONTINUATION`, coroutines, and `sleep()`
* Improved support for binding and autodereferentiation
* Initial support for multi subs
* Initial support for symbolic dereferentiation
* List construction no longer creates new containers
* Miscellaneous performance improvements
* Named-only arguments (`+$x` and `++$x`) can't be passed positionally anymore
* Parts of the Prelude can be written in Perl 5 now to improve performance
* Perl 5-like regular expressions mostly working
* Proper UTF-8 handling
* Support for "monkey-but" (`$foo but {...}`)
* Support for `$CALLER::` and `$OUTER::`
* Support for `lazy {...}` blocks for delayed evaluation
* Support for `temp` and `let` declarations
* Support for array and hash autovivification
* Support for array and hash slices
* Support for evaluating expressions in the PIL2JS shell (`:e <exp>`)
* Support for junctions
* Support for loading JSAN modules by using `use jsan:Module.Name`
* Support for lvalue subroutines (`foo() = ...`)
* Support for slurpy hashes in subroutine signatures
* Support for the `Proxy` class (not yet user-visible)
* Support for the `eqv` operator
* Using `for` with only one element to loop over works now
* `int()` works correctly on special values like `Inf` or `NaN` now
* `substr()` returns a r/w proxy: `substr($str, $pos, $len) = $replacement`
=== Perl 5 backend
* Passes 33% of the main test suite (including TODO failures)
* Integrated with the Perl 5 edition of MetaModel 2.0
* Compiles and runs Perl 6 version of `Test.pm`
* Infinite lazy lists, Pairs, References, and intrinsic classes
* Multi Sub, Class, Match, exceptions, types and subtypes
* Scalar, Hash and Array containers, with tieing, binding and read-onlyness
* Support for an extensive list of operators
* Supports eval() with Perl 5 and Perl 6 code
* `%ENV` is shared with Perl 5; `@INC` is separate from `@Perl5::INC`
== Bug Fixes
=== Shared components
* Fixed `foo {1}.blah` being misparsed as `foo({1}).blah`
* Fixed a hashref infinite loop
* Fixed infinite loop on sub { 1 }.pairs
* Multiple `sub foo` no longer silently means `multi foo`
=== JavaScript backend
* Fixed evaluation order of assignments and bindings
* Fixed `.values` and `.kv` to return aliases
== Bundled Modules
=== New Perl 6 modules
* Perl6-Container-Array, Perl6-Value-List
** Prototype modules for implementing Lazy lists in Perl 6
* Log-Selective
* Cipher - Cipher API suite for cryptographic ciphers
* `when .does(Foo)`, `when $_.does(Foo)` and `when Foo`
== Bundled Modules
* Many more code sketches and documentation added to `Perl-MetaModel`
* New `Benchmark` module added
* `CGI` has been improved:
** Now has: `escapeHTML`, `unescapeHTML`, `redirect`
** Supports more HTTP headers in `header`
** New module `CGI::Util` added
* New `Date` module added
* New `Text::Glob` module added
* New `libwww-perl` distribution added
** `LWP-Simple` now moved here
** `HTTP::Headers`, `HTTP::Message` modules added
* `Test::Builder` is now dangerously close to completely working
* `fp` now exports `&identity` instead of `&id` to avoid clash with `$obj.id`
* `use lib 'path';` now works
== Tests, Examples and Documentations
* Some new test and several tests refactored, we now have 7200+ tests
* Pugs Apocryphon 2 improved and edited in `docs/02Internals.pod`
* Many improvements to `util/perl6.vim` to handle new features
* More Haddock documentation added to the Haskell source
* New IRC bot `evalbot` added to `examples/network`
* New JAPH for Italian Perl Workshop added in `examples/japh`
* Perl 6 port of Perl Power Tools begun in `examples/ppt`
* Some new additions and cleanup of the cookbook
* `examples/network/screen-nodestatus.p6` added to monitor hosts in GNU screen
== Bug Fixes
* Hyper-reduction prefix operators such as `[+]«` are now parsed
* Single-character class names were not parsed correctly
* Stringifying a Rule no longer throws an uncatchable exception
* Use of undeclared types in signatures no longer breaks MMD
* `(1 => 2 ?? 3 :: 4)` now always constructs a pair
* `Foo.bar()` now dispatches to `&Foo::bar` instead of to `&Class::bar`
* `Foo.isa(Foo)` no longer means `Class.isa(foo)`
* `pugs -MFoo` now means `use Foo`, not `require Foo`
* `readline()` now reads utf-8
* `times` now really works on Win32
* `when .isa(Foo)` is no longer parsed as `when $_ ~~ .isa(Foo)` now
= Changes for 6.2.5 (r3794) - May 24, 2005
== Bundled Modules
* Fix one broken test from the `Set` module
= Changes for 6.2.4 (r3790) - May 24, 2005
== Pugs Internals
* All infix operators now receive reduction forms, such as `[+]`
* All operators now receive hyperised forms, such as `>>+<<` and `~<<`
* Dereferencers: `@{...}` and `@$var`
* Experimental support for `coro { ... }`, `coro name { ... }` and `yield()`
* Experimental support for `lazy {...}`
* External Parrot for Rules is now kept in a single process
* Inheritance: `class Foo is Bar` and `class Foo does Bar`
* Interactive shell commands normalised to always begin with `:`
* MMD handling is now more sophisticated, and `$.chained.attr.methods` works
* Much better error messages, with cascading stack trace
* New `./method` syntax implemented
* Objects numify to a unique value accessible with `$obj.id()`
* Parrot compiler backend now handles namespaces and method calls
* Parsing of hierarchical return types: `sub foo returns Hash of Str`
* Private attributes: `has $:foo` now generates private accessors
* Private methods: `method :foo ()` and `$obj.:foo`
* Switch to sum-of-inheritance-level distance for MMD dispatch on invocants
* Symbolic references: `$::(...)` and `$::some::("var")::($bar)`
* User-defined symbolic infix, postfix and prefix unary functions
* `$?CLASS` and `$?PACKAGE` works; `$?ROLE` currently works as `$?CLASS`
* `&code.name` and `&code.arity` added
* `FIRST {...}` and `my $x = FIRST {...}` support
* `INIT {...}` and `CHECK {...}` blocks in void context and as rvalues
* `OUTER::` scope implemented
* `do {...}` literal added
* `gather {...}` and `take()` implemented
* `submethod BUILD` is called for each parent class as well as the class itself
* `time()` now returns a fractional number
* `try {...}` literal allowed at expression level
* `warn()`, `uniq()`, `fail()`, `times()` implemented
== Bundled Modules
* `Inline::Pugs` and `pugs` module to allow Perl 6 in Perl 5 programs
* `Locale::KeyedText` re-added (this was our first contributed module)
* `Net::IRC`, OO version added
* `Perl::MetaModel`, prototype of Perl 6 OO meta-model in Perl 6 OO
* `Set::Junction` and `Set::Hash` added as implementation backends to `Set`
* `Set` now has many overloaded operators
* `Test::Builder`, with Perl 6 objects (parses, and mostly works -- see tests)
* `Tree::Simple`, renamed to `Tree` and converted to OO
* `Test::cmp_ok` now gives better diagnostic messages
* `fp` module added for functional programming
== Tests, Examples and Documentations
* Many new tests; several tests refactored; we now have 5600+ tests
* Hangman IRC bot created from `hangman.p6`
* IRC logfile to HTML converter added
* Initial sketch of Pugs Apocryphon 2 in `docs/02Internals.pod`
* Much work on internal Haddock Haskell documentation
* OO Wizard RPG game added in `examples/games/`
* Parrot is now included in the Pugs Live CD
* Perl 6 quick reference documents added to `docs/quickref`
* Perl6::Rules test suite incorporated under `t/rules/`
* Replaced `force_todo()` with `:todo`
== Bug Fixes
* Bare blocks containing `$_` are now executed correctly
* Correct parsing for user-defined nullary functions
* Hash and array sub parameters are now read-only by default, same as scalars
* Post-term invocation in interpolation no longer eats trailing whitespace
* Slurpy hash parameters no longer count as nonslurpy during arity matching
( run in 0.559 second using v1.01-cache-2.11-cpan-e93a5daba3e )