Deprecation in Parrot
This is a list of currently deprecated features of Parrot. Every deprecation should have an associated RT ticket, but this is not the case yet [RT#41226].
new object system
The object system of Parrot is being overhauled. This touches some opcode and PIR syntax. So some deprecation can be found in pdd17_pmc.pod.
nonexisting array elements
As of the 0.5.0 release, fetching an element that doesn't exist from an array will return a null PMC, instead of Undef. (Returning a null PMC can be considered the standard behavior for Parrot aggregates when accessing an element that doesn't exist. HLL aggregates define their own behavior.)
PGE::P6Regex and pgc.pir
In early 2007 there were a number of changes made to the Perl 6 regular expression syntax (as given by Synopsis 5). The new syntax is implemented via the PGE::Perl6Regex compiler, and the PGE::P6Regex compiler is now deprecated in favor of the new syntax.
Similarly, the pgc.pir compiler (for grammars) is deprecated in favor of runtime/parrot/library/PGE/Perl6Grammar.{pir|pbc} .
.imc file extension
http://xrl.us/jc4u
IMC vs. PIR
Two names enter
One name leaves
/me giggles
-- Chip Salzenberg
Deprecated C APIs
Currently no C APIs are deprecated.
Deprecated methods
newfromsub/method in PGE-
The
newfrommethod in PGE is now deprecated. Usenewinstead. To get access to thenewmethod when a Match object isn't available, use the PGE::Match protoobject (available in thePGEnamespace):$P0 = get_hll_global ['PGE'], 'Match' object = $P0.'new'(...)
Deprecated ops
From http://www.parrotcode.org/docs/ops/var.html, the following ops are deprecated:
- store_global
- find_global
- find_name
-
There are several variants of some of the above ops; all are deprecated, and are replaced by the ops {set,get}_[hll,root]_global. See also http://www.parrotcode.org/docs/ops/var.html.
- substr_r
-
For now this op will stay available as an experimental op [RT#41749].
From http://www.parrotcode.org/docs/ops/experimental.html, the following ops are deprecated:
They will be removed in the 0.5.0 release.
Deprecated Class Features
Type IDs will go away in 0.5.0.
The
classnameop is deprecated and will be removed in the 0.5.0 release. It's an exact duplicate of the string return variant of thetypeofop.The experimental
instantiateopcode is deprecated and will be removed in the 0.5.0 release.(The
instantiatevtable function becomes core in 0.5.0, but is accessed via the "new" opcode for the PMCs that use it.)-
PMC* subclass(PMC *name)The subclass vtable method is deprecated and will be removed in the 0.5.0 release. The subclass opcode stays.
The
getclassopcode is deprecated (replaced by theget_classopcode) and will be removed in the 0.5.0 release.The
get_mroopcode is deprecated (replaced byinspect) and will be removed in the 0.5.0 release.The PMC union struct is deprecated and will be removed once all core PMCs have been updated.
deprecated PIR syntax
- type names
-
As of Parrot 0.4.16 all type names for .local other than string, num, int, and pmc are deprecated. Using
floatfornumor a basic PMC name likeArrayforpmcwill no longer be possible in Parrot 0.4.17. [RT#42769]. - optional comma in sub flags
-
The optional comma to separate subroutine flags will be removed in Parrot 0.4.17. [RT#45679]. This will no longer be valid PIR code:
.sub main :main, :load, :init # .endInstead, you should write:
.sub main :main :load :init # .end .HLL_map INTC, INTCwill become.HLL_map STRINGC, STRINGC-
As the dot-prefix type notation (for instance, '.Integer') is disappearing, the
.HLL_mapsyntax will also be updated to take strings to indicate the types. [RT#45453]. - .sym directive
-
The
.symdirective will be removed, as there is already the.localdirective to declare a variable.See [RT#45405]
- .local macro labels will become
.label -
In macros you can declare a unique label by writing:
.local $myLabel:This will be automagically translated into some magic that generates a unique label. The
.localdirective will be changed into.label.See [RT#45405]
Deprecated compiler tools
Currently no compiler tools are deprecated.
FUTURE changes
Not yet deprecated, but it's recommended to use the new syntax and gradually change the old.
- PMC Class name IDs
-
Instead of:
$P0 = new Integeror
$P0 = new .Integer # better, but ...we are moving to use:
$P0 = new 'Integer' - Assignment syntax with opcodes [RT#36283]
-
When the first argument of an opcode is
OUT, then the assignment syntax will be allowed, as it is today.In any other case (i.e.
INOUT,IN), this will become a syntax error. For example:$S0 = print $P0 = substr 1, 2, "x"Will have to be:
print $S0 substr $P0, 1, 2, "x"