Commit ac3aea9f authored by Dominique Dumont's avatar Dominique Dumont

Imported Upstream version 2015.12

parent 3f036b57
This diff is collapsed.
#! perl
# Copyright (C) 2009 The Perl Foundation
use 5.008;
use 5.010;
use strict;
use warnings;
use Text::ParseWords;
......@@ -336,6 +336,7 @@ General Options:
Download and build a copy of NQP
--gen-moar[=branch]
Download and build a copy of MoarVM to use
--make-install Install Rakudo after configuration is done
--moar-option='--option=value'
Options to pass to MoarVM's Configure.pl
--git-protocol={ssh,https,git}
......@@ -347,6 +348,7 @@ General Options:
For example: --git-reference=/home/user/repo/for_perl6
Folders 'nqp' and 'MoarVM' with corresponding git repos should be in for_perl6 folder
--makefile-timing Enable timing of individual makefile commands
--no-clean Skip cleanup before installation
Configure.pl also reads options from 'config.default' in the current directory.
END
......
This diff is collapsed.
......@@ -136,6 +136,8 @@ Linenoise is via [panda](https://github.com/tadzik/panda):
panda install Linenoise
An alternative is to use a third-party program such as [rlwrap](http://utopia.knoware.nl/~hlub/uck/rlwrap/#rlwrap).
## How the compiler works
See `docs/compiler_overview.pod`.
......
New in 2015.12:
+ Features
+ Fixed size and multi-dimensional typed and native arrays
+ Greatly overhauled module loading and installation, including handling
precompilation at module installation time in Rakudo
+ Automatic precompilation of modules
+ 'no precompilation' pragma to opt out of precompilation
+ Can now specify the backlog for listening sockets
+ NativeCall now knows the size_t and bool types
+ Give IO::Socket::INET connect/listen methods
+ while/until loops can now return lists of values
+ We now catch many more kinds of "Useless use of X in sink context"
+ On the flip side, the optimizer now has a much better idea of what is sunk
+ A number of convenient Unicode equivalents were introduced
+ Superscripts can now be used for integer powers
+ Non-digit unicode characters with a numeric value (½ and such) can now be
used for that numeric value
+ There is a new "approximately equal" operator
+ The .narrow method can narrow things that are approximate integer
+ Allow quoted words as input for Buf.unpack
+ Can now mix in to enums
+ Implement List.first()
+ Added Supply.head and Supply.share
+ Implement Range.rand
+ Add support for USAGE argument help
+ Provide tau constant (also: τ)
+ Can now use channels with supply/react/whenever
+ Implement %?RESOURCES
+ Allow for :every *and* :times in SCHEDULER.cue
+ Implement Promise.at
+ Add .Date/.DateTime coercers to Instant
+ Implement native-descriptor on handles/sockets
+ Add UDP support to IO::Socket::Async
+ Switch to doing newline translation at I/O boundaries
+ Add support for specifing the api/abi version to native (NC) routine
+ Greatly improved support for sized and unsigned native lexicals
+ Implement CLOSE phaser for supply blocks
+ Respect multi's sigs in role composition
+ Treat multis with equivalent sigs as collisions
+ New method $*VM.platform-library-name
+ Incompatible changes
+ Bool is now a proper enum
+ Supply.new replaced by Supplier.new
+ An exact arity match in multiple dispatch beats slurpy/optional
+ Supplies consistently treat list values as single arguments
+ Remove grep-index/first-index/last-index for attributes in grep/first
+ Remove support for Str.split(:all) (use :v instead)
+ Changed IO::Socket::Async reading API to .Supply method
+ Order Complex first on .re, then .im
+ Order ranges first on min, then on max
+ Use of EVAL now requires a declaration of 'use MONKEY-SEE-NO-EVAL'
+ Likewise regex interpolation is limited in the absence of the declaration
+ Empty loop modifiers must now use Nil to avoid "useless use" warning
+ Thunky operators now thunkify arguments even when used in metaoperators
+ SEQ() is renamed to STATEMENT_LIST() to avoid extra overloading of 'sequence'
+ Tweak attribute initializer semantics match assignment semantics
+ Make @a[^2] consistent with @a[0,1]
+ Make ::= a NYI, in light of 6.c
+ Promise.Supply is an on-demand Supply
+ Remove earliest syntax
+ Forbid argument-less Date.new
+ Forbid Instant.new
+ Remove IO::ArgFiles.nl
+ Move sub-byte native int types to experimental
+ Enforce return types in pointy block sigs
+ Kill off has-accessor; use has_accessor instead, consistent with MOP
+ Make X, Z, and roundrobin respect items
+ Fix loss of structure in xx
+ Enforce SSA on sigilless in `my (\x, \y) = 1, 2;`
+ Remove IO::Socket::Inet.input-line-separator
+ Remove IO::Socket::Async.(bytes|chars)-supply
+ Remove IO::Handle.(ins|nl)
+ Remove IO::Handle.seek(pos,Int:D whence)
+ Promise.[anyof|allof] no longer break
+ Make pack and unpack experimental
+ Fixes
+ Dynamic variables are now visible inside start { ... } blocks
+ Sparse array no longer acts empty on shift
+ Disallow positions < 0 on index/rindex
+ Make "require PACKAGE/STRING" return said PACKAGE/STRING
+ Fix BEGIN/CHECK block scoping precompilation bug
+ Fix bug in the scheduler that could swallow exceptions
+ Supply.from-list should follow 1-arg rule
+ Prevent data loss in various cases with async sockets and processes
+ Autoincrements on native ints are now faster than on Int
+ The ~~ operator can now chain with other comparisons in many circumstances
+ Imported operators no longer lose their precedence info
+ Various numeric operations now return overflow/underflow failures instead
of wrong value
+ The :ss, :ii, and :mm options to s/// now all work together
+ Ranges and complex are now ordered more consistently
+ Mixin Callable[$type] for all ways of declaring return type
+ Don't ignore return types when calling ACCEPTS with Signatures
+ Make MMD setup of sub print same as say/note/put
+ Fixed circular module loading detection
+ Cool.substr-eq should return a Bool
+ Fix some failures to catch return outside routine
+ Stop phaser loop swallowing loop exceptions
+ Fix FIRST in loop/while/until
+ Consistently return Nil for no value, not a typeobject
+ Import should reuse precedence of exported ops
+ Fix slurpy hashes in Signature ACCEPTS
+ Fix SomeRole.^roles
+ Make :transitive the default for .^roles.
+ fail should reliably die if outside of a routine
+ Make slicing with adverbs respect itemization
+ Fix return type of qqw{...}
+ Make (1,2,3)[2] = 4 and (1,2,3)[3] give same error
+ Show non-printables in IO::Path.perl
New in 2015.11:
+ Features
+ Initial shaped array support
......
......@@ -59,12 +59,10 @@ If you would like to contribute or find out more information, visit
The next release of Rakudo (#94), is tentatively scheduled for 17 December 2015.
Because that release will correspond with the Perl 6 Christmas version of
the specification, we may end up delaying the release to insure the
best possible release.
best possible release, but we will release by the 25th at the latest.
A list of the other planned release dates and code names for future
releases is available in the “docs/release_guide.pod” file. A Rakudo
development release typically occurs a few days (often two) after the
third Tuesday of each month.
releases is available in the “docs/release_guide.pod” file.
The development team appreciates feedback! If you’re using Rakudo, do
get back to us. Questions, comments, suggestions for improvements, cool
......
This diff is collapsed.
......@@ -2,9 +2,8 @@
=head1 release_guide.pod - guide to Rakudo releases
Rakudo’s development release cycle is the Thursday following the
third Tuesday of each month (This historically allowed Rakudo to
follow Parrot’s release cycle).
Rakudo’s development release cycle is the third Saturday of
each month.
Each development release is given a sequential number and a code name
based on an active Perl Mongers group.
......@@ -14,20 +13,21 @@ end of this document.
=head2 Planned future releases
2015-12-17 Rakudo #94 (Coke) # v6.c
2016-01-16 Rakudo #95
2016-02-20 Rakudo #96
2016-03-19 Rakudo #97
2016-04-16 Rakudo #98
2016-05-21 Rakudo #99
2016-06-18 Rakudo #100
2016-07-16 Rakudo #101
2016-08-20 Rakudo #102
2016-09-17 Rakudo #103
2016-10-15 Rakudo #104
2016-11-19 Rakudo #105
2016-12-17 Rakudo #106
(More planned dates can be generated with F<tools/release-dates.pl>).
=head2 Suggested .pm group names for future releases
Names can be gotten from L<http://www.pm.org> if you
can’t think of one with any particular significance to Perl
6 or Rakudo.
There is a rudimentary tool for discerning available Perl Monger group
names that have not already been used for a release in
F<tools/available-pm-names.pl6>
=head2 Steps to create a release (for release managers)
=over 4
......@@ -169,6 +169,7 @@ Make sure everything compiles and runs from a known clean state:
$ perl Configure.pl --gen-moar --backends=ALL
$ make
$ make test
$ make install
$ make stresstest
There are many tests to run for the stresstest target. If
......@@ -350,6 +351,7 @@ Previous releases were bundled as part of monthly Parrot releases.
2015-09-17 Rakudo #91 "Zürich" (Coke)
2015-10-22 Rakudo #92 "Niceville" (Coke) # v6.b
2015-11-19 Rakudo #93 "Bend" (Coke)
2015-12-25 Rakudo #94 "коледа" (Coke) # v6.c
=head1 COPYRIGHT
......
......@@ -10,6 +10,8 @@ my constant long is export(:types, :DEFAULT) = NativeCall::Types::long;
my constant longlong is export(:types, :DEFAULT) = NativeCall::Types::longlong;
my constant ulong is export(:types, :DEFAULT) = NativeCall::Types::ulong;
my constant ulonglong is export(:types, :DEFAULT) = NativeCall::Types::ulonglong;
my constant bool is export(:types, :DEFAULT) = NativeCall::Types::bool;
my constant size_t is export(:types, :DEFAULT) = NativeCall::Types::size_t;
my constant void is export(:types, :DEFAULT) = NativeCall::Types::void;
my constant CArray is export(:types, :DEFAULT) = NativeCall::Types::CArray;
my constant Pointer is export(:types, :DEFAULT) = NativeCall::Types::Pointer;
......@@ -83,10 +85,18 @@ sub return_hash_for(Signature $s, &r?, :$with-typeobj) {
$result
}
my %signed_ints_by_size =
1 => 'int',
2 => 'short',
4 => 'int',
8 => 'longlong',
;
# Gets the NCI type code to use based on a given Perl 6 type.
my %type_map =
'int8' => 'char',
'Bool' => 'char',
'bool' => %signed_ints_by_size{nativesizeof(bool)},
'Bool' => %signed_ints_by_size{nativesizeof(bool)},
'int16' => 'short',
'int32' => 'int',
'int64' => 'longlong',
......@@ -101,6 +111,7 @@ my %type_map =
'ulonglong' => 'ulonglong',
'ulong' => 'ulong',
'uint' => 'ulong',
'size_t' => %signed_ints_by_size{nativesizeof(size_t)},
'num32' => 'float',
'num64' => 'double',
'longdouble' => 'longdouble',
......@@ -155,35 +166,28 @@ my role NativeCallSymbol[Str $name] {
method native_symbol() { $name }
}
sub guess_library_name($lib) {
sub guess_library_name($lib) is export(:TEST) {
my $libname;
if ($lib ~~ Callable) {
$libname = $lib();
}
else {
$libname = $lib;
}
if !$libname.DEFINITE { '' }
elsif $libname ~~ /\.<.alpha>+$/ { $libname }
elsif $libname ~~ /\.so(\.<.digit>+)+$/ { $libname }
elsif $*VM.config<load_ext> :exists { $libname ~ $*VM.config<load_ext> }
elsif $*VM.config<nativecall.so> :exists {
if $*KERNEL.name eq 'darwin' {
($libname ~ '.' ~ $*VM.config<nativecall.so>).IO.absolute
my $apiversion = '';
my Str $ext = '';
given $lib {
when Callable {
return $lib();
}
else {
$libname ~ '.' ~ $*VM.config<nativecall.so>
when List {
$libname = $lib[0];
$apiversion = $lib[1];
}
when Str {
$libname = $lib;
}
}
elsif $*VM.config<dll> :exists {
my $ext = $*VM.config<dll>;
$ext ~~ s/^.*\%s//;
"$libname$ext";
}
elsif $*DISTRO.is-win { "{$libname}.dll"; }
# TODO: more extension guessing
else { "{$libname}.so"; }
return '' unless $libname.DEFINITE;
#Already a full name?
return $libname if ($libname ~~ /\.<.alpha>+$/ or $libname ~~ /\.so(\.<.digit>+)+$/);
note "NativeCall: Consider adding the api version of the library you want to use, sub foo is native($libname, v1)" if $libname ~~ /^<-[\.\/\\]>+$/ and $apiversion eq '';
return $*VM.platform-library-name($libname.IO, :version($apiversion || Version)).Str;
}
my %lib;
......@@ -211,7 +215,7 @@ sub guess-name-mangler(Routine $r, Str $libname) {
# This role is mixed in to any routine that is marked as being a
# native call.
my role Native[Routine $r, $libname where Str|Callable] {
my role Native[Routine $r, $libname where Str|Callable|List] {
has int $!setup;
has native_callsite $!call is box_target;
has Mu $!rettype;
......
use nqp;
unit module NativeCall::Types;
sub nativecast($target-type, $source) {
nqp::nativecallcast(nqp::decont($target-type),
nqp::decont(map_return_type($target-type)), nqp::decont($source));
}
our native long is Int is ctype("long") is repr("P6int") { };
our native longlong is Int is ctype("longlong") is repr("P6int") { };
our native ulong is Int is ctype("long") is unsigned is repr("P6int") { };
our native ulonglong is Int is ctype("longlong") is unsigned is repr("P6int") { };
our native size_t is Int is ctype("size_t") is repr("P6int") { };
our native bool is Int is ctype("bool") is repr("P6int") { };
our class void is repr('Uninstantiable') { };
# Expose a Pointer class for working with raw pointers.
our class Pointer is repr('CPointer') { };
# need to introduce the roles in there in an augment, because you can't
# inherit from types that haven't been properly composed.
use MONKEY-TYPING;
augment class Pointer {
our class Pointer is repr('CPointer') {
method of() { void }
method ^name($) { 'Pointer' }
multi method new() {
self.CREATE()
}
......@@ -47,29 +47,24 @@ augment class Pointer {
multi method perl(::?CLASS:U:) { self.^name }
multi method perl(::?CLASS:D:) { self.^name ~ '.new(' ~ self.Int ~ ')' }
my role TypedPointer[::TValue = void] is Pointer is repr('CPointer') {
my role TypedPointer[::TValue] {
method of() { TValue }
# method ^name($obj) { 'Pointer[' ~ TValue.^name ~ ']' }
method deref(::?CLASS:D \ptr:) { nativecast(TValue, ptr) }
}
method ^parameterize($, Mu:U \t) {
method ^parameterize(Mu:U \p, Mu:U \t) {
die "A typed pointer can only hold integers, numbers, strings, CStructs, CPointers or CArrays (not {t.^name})"
unless t ~~ Int|Num|Bool || t === Str|void || t.REPR eq any <CStruct CUnion CPPStruct CPointer CArray>;
my \typed := TypedPointer[t];
typed.^inheritalize;
my $w := p.^mixin: TypedPointer[t.WHAT];
$w.^set_name: "{p.^name}[{t.^name}]";
$w;
}
}
# CArray class, used to represent C arrays.
our class CArray is repr('CArray') is array_type(Pointer) { };
# need to introduce the roles in there in an augment, because you can't
# inherit from types that haven't been properly composed.
use MONKEY-TYPING;
augment class CArray {
our class CArray is repr('CArray') is array_type(Pointer) {
method AT-POS(CArray:D: $pos) { die "CArray cannot be used without a type" }
my role IntTypedCArray[::TValue] does Positional[TValue] is CArray is repr('CArray') is array_type(TValue) {
my role IntTypedCArray[::TValue] does Positional[TValue] is array_type(TValue) {
multi method AT-POS(::?CLASS:D \arr: $pos) is rw {
Proxy.new:
FETCH => method () {
......@@ -104,7 +99,7 @@ augment class CArray {
}
}
my role NumTypedCArray[::TValue] does Positional[TValue] is CArray is repr('CArray') is array_type(TValue) {
my role NumTypedCArray[::TValue] does Positional[TValue] is array_type(TValue) {
multi method AT-POS(::?CLASS:D \arr: $pos) is rw {
Proxy.new:
FETCH => method () {
......@@ -139,7 +134,7 @@ augment class CArray {
}
}
my role TypedCArray[::TValue] does Positional[TValue] is CArray is repr('CArray') is array_type(TValue) {
my role TypedCArray[::TValue] does Positional[TValue] is array_type(TValue) {
multi method AT-POS(::?CLASS:D \arr: $pos) is rw {
Proxy.new:
FETCH => method () {
......@@ -167,20 +162,22 @@ augment class CArray {
nqp::bindpos(nqp::decont(arr), nqp::unbox_i($pos), nqp::decont(assignee));
}
}
method ^parameterize($, Mu:U \t) {
my $typed;
method ^parameterize(Mu:U \arr, Mu:U \t) {
my $mixin;
if t ~~ Int {
$typed := IntTypedCArray[t.WHAT];
$mixin := IntTypedCArray[t.WHAT];
}
elsif t ~~ Num {
$typed := NumTypedCArray[t.WHAT];
$mixin := NumTypedCArray[t.WHAT];
}
else {
die "A C array can only hold integers, numbers, strings, CStructs, CPointers or CArrays (not {t.^name})"
unless t === Str || t.REPR eq 'CStruct' | 'CPPStruct' | 'CUnion' | 'CPointer' | 'CArray';
$typed := TypedCArray[t];
$mixin := TypedCArray[t];
}
$typed.^inheritalize();
my $what := arr.^mixin: $mixin;
$what.^set_name("{arr.^name}[{t.^name}]");
$what;
}
method elems { nqp::elems(self) }
......@@ -209,8 +206,3 @@ multi sub map_return_type($type) {
nqp::istype($type, Int) ?? Int
!! nqp::istype($type, Num) ?? Num !! $type;
}
sub nativecast($target-type, $source) {
nqp::nativecallcast(nqp::decont($target-type),
nqp::decont(map_return_type($target-type)), nqp::decont($source));
}
......@@ -6,7 +6,10 @@ method render($pod) {
my &colored;
if %*ENV<POD_TO_TEXT_ANSI> {
&colored = try { EVAL q{ use Terminal::ANSIColor; &colored } } // sub ($text, $color) { $text }
&colored = try {
use MONKEY-SEE-NO-EVAL; # safe, not using EVAL for interpolation
EVAL q{ use Terminal::ANSIColor; &colored }
} // sub ($text, $color) { $text }
} else {
&colored = sub ($text, $color) { $text }
}
......
use nqp;
use MONKEY-GUTS; # Allow NQP ops.
unit module Test;
# Copyright (C) 2007 - 2014 The Perl Foundation.
# Copyright (C) 2007 - 2015 The Perl Foundation.
# settable from outside
my $perl6_test_times = ? %*ENV<PERL6_TEST_TIMES>;
......@@ -40,6 +40,8 @@ sub _init_io {
$todo_output = $PROCESS::OUT;
}
sub MONKEY-SEE-NO-EVAL() is export { 1 }
## test functions
our sub output is rw {
......@@ -462,8 +464,8 @@ sub throws-like($code, $ex_type, $reason?, *%matcher) is export {
}
}
} else {
diag "Expected: {$ex_type.gist}";
diag "Got: {$_.WHAT.gist}";
diag "Expected: {$ex_type.^name}";
diag "Got: {$_.^name}";
diag "Exception message: $_.message()";
skip 'wrong exception type', %matcher.elems;
}
......
use nqp;
package EXPORT::cached {
multi sub trait_mod:<is>(Routine $r, :$cached!) {
my %cache;
nqp::bindattr_i($r, Routine, '$!onlystar', 0 )
if $r.onlystar; # disable optimization
$r.wrap(-> |c {
my $key := c.gist;
%cache.EXISTS-KEY($key)
?? %cache{$key}
!! (%cache{$key} := callsame);
});
}
multi sub trait_mod:<is>(Method $m, :$cached!) {
X::NYI.new(:feature("'is cached' on methods")).throw;
}
OUR::{'&trait_mod:<is>'} := &trait_mod:<is>;
}
package EXPORT::macros {
OUR::<EXPERIMENTAL-MACROS> := True;
}
package EXPORT::smallnatives {