rakudo-2018.03/appveyor.yml0000644000175000017500000000301513253717231014213 0ustar alexalex# Builds and tests rakudo for different configurations # For appveyor.yml syntax reference, please see # https://www.appveyor.com/docs/appveyor-yml # # JVM is already preinstalled in build worker. Please see # https://www.appveyor.com/docs/installed-software#java # # Platforms (e.g. x64, x86) platform: - x64 # Operating system (build VM template) os: Visual Studio 2015 configuration: - Release # Monitored branches branches: only: - master - /smoke-me/ # To stop automatic build of VS solution files build: off # Build configurations environment: matrix: - RAKUDO_OPTIONS: --backends=moar --gen-nqp --gen-moar - RAKUDO_OPTIONS: --backends=moar --gen-nqp=master --gen-moar - RAKUDO_OPTIONS: --backends=moar --gen-nqp=master --gen-moar=master # - RAKUDO_OPTIONS: --backends=jvm --gen-nqp # - RAKUDO_OPTIONS: --backends=jvm --gen-nqp=master # Allow failures from certain build configuration #matrix: # allow_failures: # - platform: x64 # RAKUDO_OPTIONS: --backends=jvm --gen-nqp # - platform: x64 # RAKUDO_OPTIONS: --backends=jvm --gen-nqp=master # Installation install: - '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64' - appveyor-retry choco install strawberryperl --version 5.20.1.1 --allow-empty-checksums - SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH% - ECHO %RAKUDO_OPTIONS% - CD %APPVEYOR_BUILD_FOLDER% # Testing test_script: - perl Configure.pl %RAKUDO_OPTIONS% - nmake test - nmake install rakudo-2018.03/blib/Perl6/.gitignore0000644000175000017500000000002613253717231015512 0ustar alexalex*.pbc *.class *.moarvmrakudo-2018.03/Configure.pl0000755000175000017500000004260013253717231014107 0ustar alexalex#!/usr/bin/env perl # Copyright (C) 2009 The Perl Foundation use 5.10.1; use strict; use warnings; use Text::ParseWords; use Getopt::Long; use File::Spec; use Cwd; use lib 'tools/lib'; use NQP::Configure qw(sorry slurp cmp_rev gen_nqp read_config fill_template_text fill_template_file system_or_die verify_install); my $lang = 'Rakudo'; my $lclang = lc $lang; my $uclang = uc $lang; my $win = $^O eq 'MSWin32'; my $slash = $win ? '\\' : '/'; # We don't use ExtUtils::Command in Configure.pl, but it is used in the Makefile # Try `use`ing it here so users know if they need to install this module # (not included with *every* Perl installation) use ExtUtils::Command; MAIN: { if (-r 'config.default') { unshift @ARGV, shellwords(slurp('config.default')); } my %config = (perl => $^X); my $config_status = "${lclang}_config_status"; $config{$config_status} = join ' ', map { qq("$_") } @ARGV; my $exe = $NQP::Configure::exe; my %options; GetOptions(\%options, 'help!', 'prefix=s', 'libdir=s', 'sysroot=s', 'sdkroot=s', 'backends=s', 'no-clean!', 'with-nqp=s', 'gen-nqp:s', 'gen-moar:s', 'moar-option=s@', 'git-protocol=s', 'ignore-errors', 'make-install!', 'makefile-timing!', 'git-depth=s', 'git-reference=s', ) or do { print_help(); exit(1); }; # Print help if it's requested if ($options{'help'}) { print_help(); exit(0); } if ($options{'ignore-errors'}) { print "===WARNING!===\nErrors are being ignored.\nIn the case of any errors the script may behave unexpectedly.\n"; } unless (defined $options{prefix}) { my $default = defined($options{sysroot}) ? '/usr' : File::Spec->catdir(getcwd, 'install'); print "ATTENTION: no --prefix supplied, building and installing to $default\n"; $options{prefix} = $default; } $options{prefix} = File::Spec->rel2abs($options{prefix}); unless (defined $options{libdir}) { my $default = File::Spec->catdir($options{prefix}, 'share'); $options{libdir} = $default; } my $prefix = $options{'prefix'}; my @known_backends = qw/moar jvm/; my %known_backends = map { $_, 1; } @known_backends; my %letter_to_backend; my $default_backend; for (keys %known_backends) { $letter_to_backend{ substr($_, 0, 1) } = $_; } my @backends; my %backends; if (my $nqp_bin = $options{'with-nqp'}) { die "Could not find $nqp_bin" unless -e $nqp_bin; $options{backends} = qx{$nqp_bin -e 'print(nqp::getcomp("nqp").backend.name)'} or die "Could not get backend information from $nqp_bin"; } if (defined $options{backends}) { $options{backends} = join ",", @known_backends if uc($options{backends}) eq 'ALL'; for my $b (split /,\s*/, $options{backends}) { $b = lc $b; if ($b eq 'parrot') { die "The Parrot backend has been suspended.\n" . "Please use Rakudo 2015.02 (which still supports parrot), or the MoarVM backend instead\n"; } unless ($known_backends{$b}) { die "Unknown backend '$b'; Supported backends are: " . join(", ", sort keys %known_backends) . "\n"; } $backends{$b} = 1; push @backends, $b; $default_backend ||= $b; } unless (%backends) { die "--prefix given, but no valid backend?!\n"; } } else { for my $l (sort keys %letter_to_backend) { if (-x "$prefix/bin/nqp-$l" || -x "$prefix/bin/nqp-$l.exe" || -x "$prefix/bin/nqp-$l.bat") { my $b = $letter_to_backend{$l}; print "Found $prefix/bin/nqp-$l (backend $b)\n"; $backends{$b} = 1; push @backends, $b; $default_backend ||= $b; } } if (exists $options{'gen-moar'}) { push @backends, 'moar' unless $backends{moar}; $backends{moar} = 1; $default_backend ||= 'moar'; } unless (%backends or exists $options{'with-nqp'}) { die "No suitable nqp executables found! Please specify some --backends, or a --prefix that contains nqp-{p,j,m} executables\n\n" . "Example to build for all backends (which will take a while):\n" . "\tperl Configure.pl --backends=moar,jvm --gen-moar\n\n" . "Example to build for MoarVM only:\n" . "\tperl Configure.pl --gen-moar\n\n" . "Example to build for JVM only:\n" . "\tperl Configure.pl --backends=jvm --gen-nqp\n\n"; } } # Save options in config.status unlink('config.status'); if (open(my $CONFIG_STATUS, '>', 'config.status')) { print $CONFIG_STATUS "$^X Configure.pl $config{$config_status} \$*\n"; close($CONFIG_STATUS); } $config{prefix} = $prefix; $config{libdir} = $options{libdir}; $config{sdkroot} = $options{sdkroot} || ''; $config{sysroot} = $options{sysroot} || ''; $config{slash} = $slash; $config{'makefile-timing'} = $options{'makefile-timing'}; $config{'stagestats'} = '--stagestats' if $options{'makefile-timing'}; $config{'cpsep'} = $win ? ';' : ':'; $config{'shell'} = $win ? 'cmd' : 'sh'; $config{'runner_suffix'} = $win ? '.bat' : ''; my $make = 'make'; if ($^O eq 'solaris') { if (not -X '/usr/bin/gmake') { die "gmake is required to compile rakudo. Please install by 'pkg install gnu-make'"; } $make = 'gmake'; } if ($win) { my $has_nmake = 0 == system('nmake /? >NUL 2>&1'); my $has_cl = `cl 2>&1` =~ /Microsoft Corporation/; my $has_gmake = 0 == system('gmake --version >NUL 2>&1'); my $has_gcc = 0 == system('gcc --version >NUL 2>&1'); if (-x "$prefix/bin/nqp-m.bat" && ($_ = `$prefix/bin/nqp-m.bat -e "print(nqp::backendconfig())"`)) { $make = $_; } elsif ($has_nmake && $has_cl) { $make = 'nmake'; } elsif ($has_gmake && $has_gcc) { $make = 'gmake'; } } for my $target (qw/common_bootstrap_sources moar_core_sources moar_core_d_sources jvm_core_sources jvm_core_d_sources/) { open my $FILELIST, '<', "tools/build/$target" or die "Cannot read 'tools/build/$target': $!"; my @lines; while (<$FILELIST>) { chomp; push @lines, " $_\\\n"; } close $FILELIST; $config{$target} = join '', @lines; } open my $MAKEFILE, '>', 'Makefile' or die "Cannot open 'Makefile' for writing: $!"; print $MAKEFILE "\n# Makefile code generated by Configure.pl:\n"; if ( is_OS_type_Unix() ) { $config{mkpath} = 'mkdir -p --'; $config{chmod} = 'chmod --'; $config{cp} = 'cp --'; $config{rm_f} = 'rm -f --'; $config{rm_rf} = 'rm -rf --'; $config{test_f} = 'test -f --'; } else { $config{mkpath} = '$(PERL5) -MExtUtils::Command -e mkpath'; $config{chmod} = '$(PERL5) -MExtUtils::Command -e chmod'; $config{cp} = '$(PERL5) -MExtUtils::Command -e cp'; $config{rm_f} = '$(PERL5) -MExtUtils::Command -e rm_f'; $config{rm_rf} = '$(PERL5) -MExtUtils::Command -e rm_rf'; $config{test_f} = '$(PERL5) -MExtUtils::Command -e test_f'; } fill_template_file('tools/build/Makefile-common-macros.in', $MAKEFILE, %config); my @prefixes = map substr($_, 0, 1), @backends; my $launcher = substr($default_backend, 0, 1) . '-runner-default'; print $MAKEFILE "all: ", join(' ', map("$_-all", @prefixes), $launcher), "\n"; print $MAKEFILE "install: ", join(' ', map("$_-install", @prefixes), $launcher . '-install'), "\n"; print $MAKEFILE "clean: ", join(' ', map "$_-clean", @prefixes), "\n"; print $MAKEFILE "\t\$(RM_F) perl6", $config{'runner_suffix'},"\n\n"; for my $t (qw/test spectest coretest localtest stresstest/) { print $MAKEFILE "$t: ", join(' ', map "$_-$t\$(HARNESS_TYPE)", @prefixes), "\n"; } fill_template_file('tools/build/Makefile-common-rules.in', $MAKEFILE, %config); # determine the version of NQP we want my ($nqp_want) = split(' ', slurp('tools/build/NQP_REVISION')); $options{'gen-nqp'} ||= '' if exists $options{'gen-moar'}; my %binaries; my %impls = gen_nqp($nqp_want, prefix => $prefix, backends => join(',', sort keys %backends), %options); my @errors; my %errors; if ($backends{jvm}) { $config{j_nqp} = $impls{jvm}{bin}; $config{j_nqp} =~ s{/}{\\}g if $win; my %nqp_config; if ( $impls{jvm}{ok} ) { %nqp_config = %{ $impls{jvm}{config} }; } elsif ( $impls{jvm}{config} ) { push @errors, "nqp-j is too old"; } else { push @errors, "Unable to read configuration from NQP on the JVM"; } my $bin = $impls{jvm}{bin}; if (!@errors && !defined $nqp_config{'jvm::runtime.jars'}) { push @errors, "jvm::runtime.jars value not available from $bin --show-config."; } $errors{jvm}{'no gen-nqp'} = @errors && !defined $options{'gen-nqp'}; unless (@errors) { my $java_version = `java -version 2>&1`; $java_version = $java_version =~ /(?[\d\._]+).+\n(?\S+)/ ? "$+{'n'} $+{'v'}" : 'no java version info available'; print "Using $bin (version $nqp_config{'nqp::version'} / $java_version).\n"; $config{'nqp_prefix'} = $nqp_config{'jvm::prefix'}; $config{'nqp_jars'} = $nqp_config{'jvm::runtime.jars'}; $config{'bld_nqp_jars'} = join( $config{'cpsep'}, map { $config{'sysroot'} . $_ } split( $config{'cpsep'}, $nqp_config{'jvm::runtime.jars'} ) ); $config{'nqp_classpath'} = $nqp_config{'jvm::runtime.classpath'}; $config{'nqp_libdir'} = $nqp_config{'nqp::libdir'}; $config{'j_runner'} = $win ? 'perl6-j.bat' : 'perl6-j'; fill_template_file('tools/build/Makefile-JVM.in', $MAKEFILE, %config); } } if ($backends{moar}) { $config{m_nqp} = $impls{moar}{bin}; $config{m_nqp} =~ s{/}{\\}g if $win; my %nqp_config; if ( $impls{moar}{ok} ) { %nqp_config = %{ $impls{moar}{config} }; } elsif ( $impls{moar}{config} ) { push @errors, "The nqp-m binary is too old"; } else { push @errors, "Unable to read configuration from NQP on MoarVM"; } $errors{moar}{'no gen-nqp'} = @errors && !defined $options{'gen-nqp'}; unless ($win) { $config{'m_cleanups'} = " \$(M_GDB_RUNNER) \\\n \$(M_LLDB_RUNNER) \\\n \$(M_VALGRIND_RUNNER)"; $config{'m_all'} = '$(M_GDB_RUNNER) $(M_LLDB_RUNNER) $(M_VALGRIND_RUNNER)'; $config{'m_install'} = "\t" . '$(M_RUN_PERL6) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm $(DESTDIR)$(PREFIX)/bin/perl6-gdb-m "$(PERL6_LANG_DIR)/runtime" "gdb" "" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"' . "\n" . "\t" . '$(M_RUN_PERL6) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm $(DESTDIR)$(PREFIX)/bin/perl6-lldb-m "$(PERL6_LANG_DIR)/runtime" "lldb" "" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"' . "\n" . "\t" . '$(M_RUN_PERL6) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm $(DESTDIR)$(PREFIX)/bin/perl6-valgrind-m "$(PERL6_LANG_DIR)/runtime" "valgrind" "" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"'; } unless (@errors) { print "Using $config{m_nqp} (version $nqp_config{'nqp::version'} / MoarVM $nqp_config{'moar::version'}).\n"; $config{'perl6_ops_dll'} = sprintf($nqp_config{'moar::dll'}, 'perl6_ops_moar'); # Add moar library to link command # TODO: Get this from Moar somehow $config{'moarimplib'} = $win || $^O eq 'darwin' ? $nqp_config{'moar::libdir'} . '/' . $nqp_config{'moar::sharedlib'} : ''; fill_template_file('tools/build/Makefile-Moar.in', $MAKEFILE, %config, %nqp_config); } } if ($errors{jvm}{'no gen-nqp'} || $errors{moar}{'no gen-nqp'}) { my @options_to_pass; push @options_to_pass, "--gen-moar" if $backends{moar}; push @options_to_pass, "--gen-nqp" unless @options_to_pass; my $options_to_pass = join ' ', @options_to_pass; my $want_executables =$backends{moar} ? ' and MoarVM' : ''; my $s1 = @options_to_pass > 1 ? 's' : ''; my $s2 = $want_executables ? 's' : ''; push @errors, "\nTo automatically clone (git) and build a copy of NQP $nqp_want,", "try re-running Configure.pl with the '$options_to_pass' option$s1.", "Or, use '--prefix=' to explicitly specify the path where the NQP$want_executables", "executable$s2 can be found that are use to build $lang."; } sorry($options{'ignore-errors'}, @errors) if @errors; my $l = uc substr($default_backend, 0, 1); print $MAKEFILE qq[\nt/*/*.t t/*.t t/*/*/*.t: all\n\t\$(${l}_HARNESS5_WITH_FUDGE) --verbosity=1 \$\@\n]; close $MAKEFILE or die "Cannot write 'Makefile': $!"; unless ($options{'no-clean'}) { no warnings; print "Cleaning up ...\n"; if (open my $CLEAN, '-|', "$make clean") { my @slurp = <$CLEAN>; close($CLEAN); } } if ($options{'make-install'}) { system_or_die($make); system_or_die($make, 'install'); print "\n$lang has been built and installed.\n"; } else { print "\nYou can now use '$make' to build $lang.\n"; print "After that, '$make test' will run some tests and\n"; print "'$make install' will install $lang.\n"; } exit 0; } sub is_OS_type_Unix { # The following is a partial OS list taken from Perl::OSType module, # copyright by David Golden. The up-to-date version of that module can # be found at https://metacpan.org/pod/Perl::OSType return 1 if grep $^O eq $_, qw/ aix bsdos beos bitrig dgux dragonfly dynixptx freebsd linux haiku hpux iphoneos irix darwin machten midnightbsd minix mirbsd next openbsd netbsd dec_osf nto svr4 svr5 sco sco_sv unicos unicosmk solaris sunos cygwin msys os2 interix gnu gnukfreebsd nto qnx android /; return 0; } # Print some help text. sub print_help { print <<"END"; Configure.pl - $lang Configure General Options: --help Show this text --prefix=dir Install files in dir; also look for executables there --libdir=dir Install architecture-specific files in dir; Perl6 modules included --sdkroot=dir When given, use for searching build tools here, e.g. nqp, java etc. --sysroot=dir When given, use for searching runtime components here --backends=jvm,moar Which backend(s) to use (or ALL for all of them) --gen-nqp[=branch] Download, build, and install a copy of NQP before writing the Makefile --gen-moar[=branch] Download, build, and install a copy of MoarVM to use before writing the Makefile --with-nqp='/path/to/nqp' Provide path to already installed nqp --make-install Install Rakudo after configuration is done --moar-option='--option=value' Options to pass to MoarVM's Configure.pl For example: --moar-option='--compiler=clang' --git-protocol={ssh,https,git} Protocol used for cloning git repos --git-depth= Use the --git-depth option for git clone with parameter number --git-reference= Use --git-reference option to identify local path where git repositories are stored 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 --ignore-errors Ignore errors (such as the version of NQP) Please note that the --gen-moar and --gen-nqp options are there for convenience only and will actually immediately - at Configure time - compile and install moar and nqp respectively. They will live under the path given to --prefix, unless other targeting options are used. To configure how MoarVM should be compiled, use the --moar-option flag and view MoarVM's Configure.pl for more information on its configuration options. Configure.pl also reads options from 'config.default' in the current directory. END return; } # Local Variables: # mode: cperl # cperl-indent-level: 4 # fill-column: 100 # End: # vim: expandtab shiftwidth=4: rakudo-2018.03/CONTRIBUTING.md0000644000175000017500000001371613253717231014065 0ustar alexalex# Filing Issues ## Potential bugs Please include a way for developers to reproduce the problem. A small program that demonstrates a problem is best. Describe the behaviour you're observing and how it differs from expectations. Include the version of the compiler you're using (run `perl6 -v`) as well as the type and version of the operating system (e.g. `Windows 10`) -------------------------------- # How to Contribute to Rakudo Perl 6 Contributions to Rakudo are very welcome. To make the process smoother for you and the contributors, please read the note below. ## The Contribution Process For small changes, please submit a pull request on GitHub. This includes * bug fixes * improvements to the build process * implementation of features that are already specified If you want to implement a new language feature or built-in of your own design, please discuss it first in the `#perl6-dev` IRC channel on irc.freenode.org. If you get no feedback on your pull request, feel free to nudge us in the IRC channel mentioned above. If you want to contribute large amounts of code, please follow the [Contributor License Agreement process](http://www.perlfoundation.org/contributor_license_agreement) from the Perl Foundation. For small contributions, you agree to place your code under the terms of the license of the code that Rakudo is under. Please separate your commits for different issues into different branches, and please squash out any intermediate commits, like adding/removing debug output. ## Test Coverage New features should be accompanied by test cases in the [roast repository](https://github.com/perl6/roast/). Please ask for direct push access in the `#perl6-dev` or `#perl6` IRC channels on freenode, or submit a pull request. Bug fixes should also come with test cases (if practical), though we prefer bug fixes without test cases to no contribution at all. In this case, the corresponding bug ticket will stay open, and gets the `testsneeded` tag. If you add the tests to a new test file, please include that filename in the `t/spectest.data` file in the Rakudo repository. ## Coding Style Please match your coding style to that of the code around it. We aren't terribly strict when it comes to coding style, but here are some very basic guidelines: * Indentation happens with four spaces * Use uncuddled `else`, so use a newline between a closing curly brace and the `else` keyword * Perl 5 code (part of the build system) should `use strict; use warnings;` and loosely follow [perlstyle](http://perldoc.perl.org/perlstyle.html). ## Commit messages How to write [a good **and** useful commit message](https://chris.beams.io/posts/git-commit/). Commit messages are where you tell the what, why and how of your commit to others. The subject/title of a commit should 50 or less characters ideally. The absolute maximum is 72. Title's usually will tell what you did. You should almost always have a body except in the case of the most trivial changes. These style guidelines are best practices, but use your judgment. You may want to fit 100 characters into the commit title to get in all the details, but `git` will cut it off if the window is not wide enough, and github.com will truncate it at the end if it is too long. The commit body is where you can go into detail about these things, the subject should be easy to read at a glance what you did. A good commit is one where months from now you be able to read this commit and understand what you did and why you did it. Don't make a commit that only says `Fix RT #130979` because when the time to do the monthly changelog comes, someone will need to look up the ticket. And then usually wade through several replies on that ticket to figure out what the problem was and at the end I'm often unsure what the ACTUAL problem was that got fixed in the commit, not just the RT number. If somebody is trying to find a recent commit that affected, say, `infix:`, would they be able to find it by searching through the subject and body for `xx`? The body should tell the reader: * **What** you did/changed * **Why** you did it * Background info Don't end commit subjects with periods for ease of viewing a commit log by title. If there are multiple sentences in the subject, you can have a period, but do not have one at the end of the commit. Example: `Fix foo and bar. This is good because reasons` This makes them look better and easier to read in shortlog/oneline form. If you fixed a ticket, or the commit relates to a specific ticket, please mention the ticket in the title or the body as `RT #12345`. If there was an IRC conversation that can give some background or useful information, you can link to it by visiting [irclog.perlgeek.de](https://irclog.perlgeek.de/perl6/) and linking the link provided by the timestamps on the left side of the page. Put links on their own line if they are going to go over the 76 character maximum for the body text. #### Sample/Tutorial Commit ```git Capitalized, short (50 chars or less) summary More detailed explanatory text. The commit relates to a ticket, please write it as RT #12345. Wrap at about 72 characters, but never above 76, unless it is a URL or code that cannot be separated. The blank line separating the summary from the body is critical; tools like rebase can get confused if you run the two together. Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug." This convention matches up with commit messages generated by commands like git merge and git revert. Further paragraphs come after blank lines. - Bullet points are okay, too - Typically a hyphen or asterisk is used for the bullet, followed by a single space. - Indent the lines following the bullet the same as the line above. NOT like this. ``` Above faux commit adapted from [here](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) , which also has some more information on how to make a good commit. ## Have Fun! Enjoy the ride, and please join our IRC channels to meet the great community. rakudo-2018.03/CREDITS0000644000175000017500000003150013253717231012643 0ustar alexalex=pod Following in the steps of other open source projects that eventually take over the world, here is the partial list of people who have contributed to Rakudo and its supporting works. It is sorted by name and formatted to allow easy grepping and beautification by scripts. The fields are: name (N), email (E), web-address (W), description (D), Subversion or GitHub username (U) and snail-mail address (S). Thanks, The Rakudo Team PS: Yes, this looks remarkably like the Linux CREDITS format PPS: This file is encoded in UTF-8 ---------- N: ab5tract E: john.haltiwanger@gmail.com N: Adrian White U: snarkyboojum E: snarkyboojum@gmail.com N: Ahmad M. Zawawi U: azawawi E: ahmad.zawawi@gmail.com D: Rakudo builtins, win32 patches N: Alberto Manuel Brandao Simoes U: ambs E: ambs@cpan.org S: Braga, Portugal W: http://alfarrabio.di.uminho.pt/~albie/ N: Aleks-Daniel Jakimenko-Aleksejev U: AlexDaniel E: alex.jakimenko@gmail.com N: Alex Elsayed U: eternaleye E: eternaleye@gmail.com N: Alexander Moquin U: Mouq N: Allison Randal D: Parrot Architect (0.4.6...) E: allison@parrot.org U: allison N: Amir E. Aharoni E: amir.aharoni@mail.huji.ac.il N: amire80 E: amir.aharoni@mail.huji.ac.il N: Andrew Egeler U: retupmoca N: Andrew Whitworth E: wknight8111@gmail.com U: Whiteknight N: Andy Lester E: andy@petdance.com W: http://perlbuzz.com/ S: McHenry, IL, USA U: petdance N: Arne Skjærholt U: arnsholt E: arnsholt@gmail.com U: ask N: Ask Bjørn Hansen D: Keeps us running E: ask@develooper.com N: Audrey Tang U: au E: audreyt@audreyt.org D: Pugs, a Perl6->Parrot implementation. N: bacek E: bacek@illusion.dev.optusnet.com.au N: Bahtiar `kalkin-` Gadimov U: kalkin E: bahtiar@gadimov.de W: https://bahtiar.gadimov.de/ N: Bart Wiegmans U: bdw U: brrt E: bartwiegmans@gmail.com D: Hack MoarVM JIT stuff N: Bernhard Schmalhofer U: bernhard E: Bernhard.Schmalhofer@gmx.de N: Bob Kuo E: bob@celect.org N: Bob Rogers D: Random small bug fixes E: rogers-perl6@rgrjr.dyndns.org U: rgrjr N: Brad Gilbert E: b2gills@gmail.com N: Brent Laabs U: labster E: bslaabs@gmail.com N: Brian Gernhardt E: benji@silverinsanity.com N: Brian S. Julin U: skids N: Bruce Gray U: util E: bruce.gray@acm.org N: Bruce Keeler U: bkeeler D: variable interpolation into regexes N: Bryan C. Warnock D: The First Perl 6 Summarizer D: Little things here and there in pre-Parrot days. D: And, yes, {sigh}, *that* Warnock. E: bwarnock@raba.com N: Carl Mäsak E: cmasak@gmail.com U: masak N: Carlin E: glassflag@users.noreply.github.com N: Carlin Bingham E: cb@viennan.net U: carbin N: Chip Salzenberg D: Release manager emeritus D: Architect emeritus (0.1.2-0.4.5) U: chip E: chip@pobox.com N: Chris Davaz D: Rakudo builtins E: cdavaz@gmail.com N: Chris Dolan U: cdolan D: Rakudo patches E: cdolan@cpan.org N: Chris Fields U: cjfields D: Rakudo patches N: Chris Jepeway E: jepeway@blasted-heath.com N: Christian Bartolomäus U: usev6 U: bartolin E: bartolin@gmx.de N: Christoph Otto E: christoph_git@mksig.org N: Christoph Otto a.k.a. cotto U: cotto E: christoph@mksig.org N: Christopher J. Madsen E: perl@cjmweb.net N: Claudio Ramirez U: nxadm U: El_Che E: pub.claudio@gmail.com N: Clifton Wood U: Xliff E: clifton.wood@gmail.com N: Colin Kuskie U: colink E: ckuskie@sterling.net N: Cory Spencer U: cspencer D: Rakudo builtins E: cspencer@sprocket.org N: Cosimo Streppone E: cosimo@opera.com N: cosmicnet E: webmaster@cosmicperl.com N: Curtis 'Ovid' Poe U: Ovid D: docs/test cleanups/Makefile fixes D: Rename 'pbc_to_c' to 'pbc_to_exe' E: ovid@cpan.org N: cygx E: cygx@cpan.org N: Daenyth E: Daenyth+git@gmail.com N: Dagfinn Ilmari Mannsåker E: ilmari@ilmari.org N: Dagur Valberg Johannsson E: dagurval@pvv.ntnu.no N: dagurval E: dagurval@pvv.ntnu.no N: Dan Miller E: danielcliffordmiller@gmail.com U: danielcliffordmiller N: Dan Sugalski U: dan D: Architect emeritus (0.0.1-0.1.1) E: dan@sidhe.org W: http://www.sidhe.org/~dan/blog/ N: Daniel Green U: MasterDuke17 E: ddgreen@gmail.com N: Dave Rolsky U: autarch E: autarch@urth.org W: http://blog.urth.org/ N: Dave Whipp E: dwhipp@google.com N: David Romano D: PGE tests and fixes E: david.romano+p6i@gmail.com N: David Warring E: david.warring@gmail.com N: Dino Morelli D: PGE tests E: dmorelli@reactorweb.net N: Donald Hunter U: donaldh E: donald@sealgair.com N: Edwin Steiner E: edwin.steiner@gmx.net N: Elise U: rightfold U: eli-se E: rightfold@gmail.com N: Elizabeth Mattijsen U: lizmat E: liz@wenzperl.nl N: Erik Johansen E: perl6-git@uniejo.dk N: Faye Niemeyer U: ShimmerFairy N: Felix Herrmann E: felix@herrmann-koenigsberg.de N: Fernando Brito E: email@fernandobrito.com N: Fernando Corrêa de Oliveira U: FCO E: fco@cpan.org S: Rio de Janeiro, RJ, Brazil N: Filip Sergot E: filip@sergot.pl N: Fitz Elliott E: felliott@virginia.edu N: Florian Ragwitz U: rafl U: flora E: rafl@debianforum.de W: http://www.tu-chemnitz.de/~rafl/ S: Chemnitz, Germany N: flussence E: flussence@gmail.com N: François Perrad E: francois.perrad@gadz.org W: http://fperrad.googlepages.com/home U: fperrad N: M. Faiz Zakwan Zamzuri E: skelic3@gmail.com U: faraco W: https://faracosite.wordpress.com N: Gabor Szabo E: szabgab@gmail.com N: Geir Amdal E: gam@grok.no N: Geoff Broadwell U: japhb E: geoff@broadwell.org N: Gerd Pokorra E: pokorra@uni-siegen.de N: Gerhard R E: gerd.r.devel@googlemail.com N: Gerhard R. E: gerd.r.devel@googlemail.com N: Gianni Ceccarelli E: dakkar@thenautilus.net N: GlitchMr E: glitchmr@myopera.com N: Gregor N. Purdy U: gregor E: gregor@focusresearch.com S: Sunnyvale, CA N: Hongwen Qiu E: qiuhongwen@gmail.com N: Ingy döt Net U: ingy E: ingy@ingy.net W: http://ingy.net/ S: Seattle, WA, USA D: Make is() work like Perl 5; add .pm6 to extensions searched. N: Itsuki Toyota U: titsuki E: titsuki@cpan.org N: James E Keenan (Jim) E: jkeenan@cpan.org U: jkeenan W: http://thenceforward.net/parrot/ S: Brooklyn, NY, USA N: Jan Ingvoldstad E: jani+perl6-2010@ifi.uio.no N: Jan-Olof Hendig U: dogbert17 E: jan-olof.hendig@bredband.net N: japhb E: gjb@sonic.net N: Jarkko Hietaniemi U: jhi E: jhi@iki.fi N: Jarrod E: gigantic.midget@gmail.com N: Jason Gloudon N: Jaume Martí E: jaume.martif@gmail.com N: JD Horelick U: jdhore E: jdhore1@gmail.com N: Jeff Goff D: Parrot Release Manager Emeritus (0.2..0.4) E: drforr@pobox.com U: drforr N: Jeff Horwitz E: jeff@smashing.org U: jhorwitz N: Jens Rehsack E: sno@netbsd.org N: Jerry Gay U: particle E: Jerry.Gay@gmail.com S: Seattle, WA, USA N: Jesse Vincent U: jesse E: jesse@fsck.com N: Jimmy Zhuo E: zhuomingliang01@qq.com N: John Harrison U: __ash__ E: ash@greaterthaninfinity.com N: Jonathan "Duke" Leto U: leto U: dukeleto E: jonathan@leto.net W: http://leto.net S: Portland, OR N: Jonathan Scott Duff U: perlpilot U: PerlJam E: duff@pobox.com N: Jonathan Stowe U: RabidGravy N: Jonathan Worthington U: jnthn E: jnthn@jnthn.net D: Perl 6 (Rakudo Perl) lead developer, current pumpking W: http://www.jnthn.net/ N: Joshua Gatcomb N: Julian Albo U: julianalbo E: julian.notfound@gmail.com N: Justin DeVuyst U: jdv79 N: Kamil Kułaga E: teodozjan@users.noreply.github.com N: kboga E: kristofbogaerts@gmail.com N: Kevan Benson E: kbenson@brinstar.netcrucial.com N: Kevin Tew U: tewk E: tewk@tewk.com N: Klaas-Jan Stol U: kjs E: parrotcode@gmail.com N: Kodi Arfer U: Kodi W: http://arfer.net N: Kris Shannon E: kris@shannon.id.au N: Kyle Hasselbacher E: kyleha@gmail.com U: KyleHa U: kyle D: Test.pm improvements, ticket testing N: L. Grondin E: grondilu@yahoo.fr N: laben E: labensigma@gmail.com N: Lanny Ripple E: Lanny.Ripple@gmail.com N: Larry Wall E: larry@wall.org U: TimToady N: Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 E: daxim@cpan.org N: last.of.the.careless.men@gmail.com E: last.of.the.careless.men@gmail.com N: Leon Timmermans U: leont E: fawaka@gmail.com N: Leopold Toetsch U: leo D: Patchmonster & release manager emeritus (0.0.13 - 0.4.5) E: lt@toetsch.at S: Herrnbaumgarten, Austria N: Lloyd Fournier E: LLFourn@users.noreply.github.com N: Lucas Buchala E: lucasbuchala@gmail.com N: Luke Palmer E: luke@luqui.org U: luqui N: Marcus Ramberg E: marcus@nordaaker.com N: Mark Glines U: infinoid E: mark@glines.org S: South Lake Tahoe, CA, USA N: Mark Grimes E: mgrimes@cpan.org N: Mark Rushing E: seatek@gmail.com U: adaptiveoptics N: Mark Shoulson E: mark@kli.org N: markmont E: markmont@markmont-dev.web.itd.umich.edu N: Martin Berends E: mberends@autoexec.demon.nl D: Rakudo patch(es) N: Martin Kjeldsen E: martin@martinkjeldsen.dk N: Marton Papp E: anteusz@freemail.hu N: Matt Diephouse U: mdiep E: matt@diephouse.com N: Matt Kraai E: kraai@ftbfs.org N: Matthew (lue) E: rnddim@gmail.com N: Matthew Walton E: matthew@matthew-walton.co.uk N: Matthew Wilson E: diakopter@gmail.com N: mberends E: github@autoexec.demon.nl N: Michael Schroeder U: mls D: Exception handling E: mls@suse.de N: Michael Stapelberg E: michael@stapelberg.de N: Mike Francis E: ungrim97@gmail.com N: Mikhail Khorkov E: m.s.khorkov@gmail.com N: Moritz Lenz E: moritz.lenz@gmail.com U: moritz D: Test infrastructure, tests, general Rakudo hacking N: Mouq E: alexmoquin@gmail.com N: Nicholas Clark U: nicholas E: nick@ccl4.org N: Nick Glencross E: nick.glencross@gmail.com N: Nick Logan U: ugexe E: nlogan@gmail.com N: Nick Wellnhofer E: wellnhofer@aevum.de N: Notfound E: julian.notfound@gmail.com N: Nuno 'smash' Carvalho U: smash E: mestre.smash@gmail.com N: particle E: jerry.gay@gmail.com N: Patrick Abi Salloum U: patrickas E: patrick.abisalloum@gmail.com N: Patrick R. Michaud U: pmichaud D: Perl 6 (Rakudo Perl) lead developer, initial pumpking E: pmichaud@pobox.com N: Paul Cochrane U: paultcochrane E: paul@liekut.de N: Pawel Murias U: pmurias E: pawelmurias@gmail.com N: Pepe Schwarz U: psch U: peschwa E: peschwa@gmail.com N: Peter Gibbs U: petergibbs E: peter@emkel.co.za N: Peter Lobsinger E: plobsing@gmail.com N: Piers Cawley U: pdcawley D: The Second Perl 6 Summarizer after Bryan C. Warnock E: pdcawley@bofh.org.uk W: http://www.bofh.org.uk:8080/ N: quester E: quester.pm@gmail.com N: Radu Stoica E: radu_cs85@yahoo.com N: raydiak E: raydiak@cyberuniverses.com N: Reini Urban U: rurban E: rurban@cpan.org D: cygwin fixes N: Ricardo Signes E: rjbs@cpan.org N: Rob Hoelz U: hoelzro E: rob@hoelz.ro N: Robert Spier D: Keeps us running U: robert E: robert@perl.org N: Ronald Schmidt E: ronaldxs@software-path.com U: ronaldxs N: root E: root@atlas.clarku.edu N: Ruslan Zakirov E: ruz@bestpractical.com N: Salve J. Nilsen E: sjn+gnurf@kaizendo.org N: Samantha McVey E: samantham@posteo.net W: cry.nu U: samcv N: sergot E: filip@sergot.pl N: ShimmerFairy E: rnddim@gmail.com N: Shlomi Fish E: shlomif@iglu.org.il N: Shoichi Kaji E: skaji@cpan.org N: Shrivatsan Sampathkumar U: isBEKaml E: nastavs@gmail.com N: Siddhant Saraf E: siddhantsaraf@gmail.com N: Simon Cozens U: simon E: simon@simon-cozens.org N: skids E: bri@abrij.org N: smashz E: smash@cpan.org N: smls E: smls75@gmail.com N: Solomon Foster U: colomon E: colomon@gmail.com N: Stefan O'Rear U: sorear E: stefanor@cox.net N: Stefan Seifert U: niner E: nine@detonation.org N: Stephane cognominal Payrard E: cognominal@gmail.com N: Stephen Weeks U: tene D: Minor Rakudo patches E: tene@allalone.org N: Sterling Hanenkamp E: sterling@hanenkamp.com N: Steve Mynott E: steve.mynott@gmail.com N: Stéphane Payrard D: Various code fixes and improvements N: sue spence E: virtuallysue@gmail.com N: Tadeusz Sośnierz U: tadzik E: tadzikes@gmail.com N: thundergnat E: thundergnat@comcast.net N: Tim Smith E: tim.dolores@gmail.com N: Timo Paulssen U: timo U: timotimo E: timonator@perpetuum-immobile.de N: Timothy Totten U: novus D: Temporal (DateTime/Date) modifications E: supernovus@gmail.com W: http://huri.net/ N: Tobias Leich U: FROGGS E: email@froggs.de N: Tokuhiro Matsuno E: tokuhirom@gmail.com N: Tom Browder E: tom.browder@gmail.com U: tbrowder S: Niceville, Florida, USA N: Tomasz Konojacki E: me@xenu.tk N: Tomoki Aonuma E: uasi@99cm.org N: tony-o E: tony.odell@xpertminds.net N: Tyler Curtis U: tcurtis D: $*ARGFILES E: tyler.l.curtis@gmail.com N: Ujwal Reddy Malipeddi E: ujwalic@gmail.com D: Rakudo patch N: usev6 E: use_v6@aglaz.de N: Vasily Chekalkin E: bacek@bacek.com D: Core and Rakudo patches N: vendethiel E: vendethiel@hotmail.fr N: Vladimir Lettiev E: thecrux@gmail.com N: Vyacheslav Matjukhin E: mmcleric@yandex-team.ru N: Wenzel P. P. Peppmeyer E: wenzel.peppmeyer@gmx.de U: gfldex N: Will "Coke" Coleda U: coke E: will@coleda.com N: William Orr E: will@worrbase.com N: Yun SangHo E: foollbar@gmail.com N: Zach Morgan E: zpmorgan@gmail.com D: Rakudo patch N: Zoffix Znet E: cpan@zoffix.com W: perl6.party N: Zohar Kelrich E: lumimies@gmail.com N: Ævar Arnfjörð Bjarmason E: avarab@gmail.com N: Вячеслав Матюхин U: mmcleric E: me@berekuk.ru D: Whatever-currying, colonpair fixes N: eater U: the-eater E: perl6@eaterofco.de N: Oleksii Varianyk U: cono E: q@cono.org.ua =cut rakudo-2018.03/docs/announce/2009-020000644000175000017500000000607113253717231015122 0ustar alexalexAnnounce: Rakudo Perl development release #14 ("Vienna") On behalf of the Rakudo development team, I'm pleased to announce the February 2009 development release of Rakudo Perl #14 "Vienna". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the February 2009 release is available from http://www.pmichaud.com/perl6/rakudo-2009-02.tar.gz However, because of the rapid pace of Rakudo development and addition of new features, we still recommend that people wanting to use or work with Rakudo obtain the latest version directly from the main repository at github -- more on this in a bit. This is the fourteenth development release of Rakudo Perl, but it's the first release independent from Parrot releases. We will continue to follow a monthly release cycle, with each release to be code named after a Perl Mongers group. This release is named for Vienna.pm (http://vienna.pm.org), who have been sponsoring Jonathan Worthington's work on Rakudo since April 2008. A list of the other planned release dates and codenames for 2009 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Rakudo Perl now uses git [2] for its version control system, hosted at http://github.com/rakudo/rakudo . The README file there is kept up-to-date with the latest instructions for obtaining and building Rakudo Perl. In this release of Rakudo Perl, we've made the following major changes and improvements: * Rakudo is now passing 7076 spectests. This is an increase of 796 passing tests since the January 2009 release. * The Configure.pl script supports a "--gen-parrot" option to automatically fetch and build the appropriate version of Parrot. * The default make target now builds a binary executable directly, either perl6 or perl6.exe. It's still a Parrot "fakecutable", but we think we've made it more reliable so that it doesn't generate segmentation faults on exits. (If you don't know what a "fakecutable" is you can safely ignore this.) * Many builtins are beginning to be written in pure Perl 6, or Perl 6 functions with inline PIR. These builtins are part of the core "setting" for Perl 6, and appear in the src/setting/ directory. Previously this was known as the "prelude". * Improved Test.pm diagnostic output. Also, Rakudo now implements the following Perl 6 features: * Anonymous classes may be specified using :: * Existing parameterized roles are now reused instead of creating new ones. * Roles pun a class when .new is invoked on them. * "proto" now marks all same-named routines as "multi". * "XopX" is now "Xop". * <-> (rw) pointy blocks. * min= and max= metaoperators. * Many many bugfixes and documentation improvements. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. The next release of Rakudo (#15) is scheduled for March 19, 2009. References: [1] Parrot, http://parrot.org/ [2] Git version control system, http://git-scm.org/ rakudo-2018.03/docs/announce/2009-030000644000175000017500000000501113253717231015114 0ustar alexalexAnnounce: Rakudo Perl development release #15 ("Oslo") On behalf of the Rakudo development team, I'm pleased to announce the March 2009 development release of Rakudo Perl #15 "Oslo". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the March 2009 release is available from http://www.pmichaud.com/perl6/rakudo-2009-03.tar.gz However, because of the rapid pace of Rakudo development and addition of new features, we still recommend that people wanting to use or work with Rakudo obtain the latest version directly from the main repository at github -- more on this in a bit. Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. This release is named "Oslo" in honor of the organizers of the 2009 Nordic Perl Workshop [2], April 16-17, 2009. The 2009 Nordic Perl Workshop will have a special focus on Perl 6, Rakudo Perl, and Parrot, including Perl 6 tutorials and hackathons after the conference itself. A list of the other planned release dates and codenames for 2009 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Rakudo Perl now uses git [3] for its version control system, hosted at http://github.com/rakudo/rakudo . The README file there is kept up-to-date with the latest instructions for obtaining and building Rakudo Perl. In this release of Rakudo Perl, we've made the following major changes and improvements: * Rakudo is now passing 7273 spectests. This is an increase of 197 passing tests since the February 2009 release. * The eval() construct now understands lexical variables from an outer scope. * More of the builtin functions ("settings") are being written in Perl 6. * Rakudo supports the "R" (reverse) metaoperator. * Parsing of if, unless, while, until, etc. statements after blocks now works correctly. * The Q quote operator is now implemented, along with several adverbial forms. In particular, the Q:PIR form allows inline PIR to be included in Perl 6 code. * Multi-method dispatch now works with inheritance also. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. The next release of Rakudo (#16) is scheduled for April 23, 2009. References: [1] Parrot, http://parrot.org/ [2] Nordic Perl Workshop 2009, http://www.perlworkshop.no/npw2009/ [3] Git version control system, http://git-scm.org/ rakudo-2018.03/docs/announce/2009-040000644000175000017500000000634313253717231015126 0ustar alexalexAnnounce: Rakudo Perl 6 development release #16 ("Bratislava") On behalf of the Rakudo development team, I'm pleased to announce the April 2009 development release of Rakudo Perl #16 "Bratislava". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the April 2009 release is available from http://github.com/rakudo/rakudo/downloads . Due to the continued rapid pace of Rakudo development and the frequent addition of new Perl 6 features and bugfixes, we continue to recommend that people wanting to use or work with Rakudo obtain the latest source directly from the main repository at github. More details are available at http://rakudo.org/how-to-get-rakudo . Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. This release is named "Bratislava", home to Jonathan Worthington and reportedly an excellent place to obtain beer (a key component of Jonathan's contributions to Perl). The Bratislava.pm group is quite active [2], with regular technical presentations and social gatherings. In this release of Rakudo Perl, we've made the following major changes and improvements: * Rakudo is now passing 10,467 spectests, an increase of 3,194 passing tests since the March 2009 release. With this release Rakudo is now passing approximately 65% of the available spectest suite. * About 2/3 of the increase in passing tests is due to improved Unicode support in Rakudo; constructs such as "\c[LATIN CAPITAL LETTER A]" and Unicode character properties in regexes are now supported. * The prefix:<=> operator is now gone from the Perl 6 specification (and thus from Rakudo). Use .get for reading individual items from iterators. * Rakudo now supports typed arrays and hashes (my Int @array), as well as parametric versions of the Associative, Positional, and Callable roles, and parametric role subtyping. * Rakudo now has sockets support (IO::Socket). * Subroutine return types are now enforced in some cases. * Rakudo now supports lexical sub declarations. * Rakudo now supports some P5-style regexes. * The "quantify-by-separator" feature has been added, so that one can write / [\w+] ** ',' / to get a comma-separated list of words. * More builtin functions and methods have been rewritten in Perl 6 and placed as part of the setting. * Release tar files now contain local copies of the appropriate spectests, instead of obtaining checkout copies via Subversion. * There are additional improvements and features in this release, see docs/ChangeLog for a more complete list. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#17) is scheduled for May 21, 2009. A list of the other planned release dates and codenames for 2009 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! References: [1] Parrot, http://parrot.org/ [2] Bratislava.pm, http://bratislava.pm.org/ rakudo-2018.03/docs/announce/2009-050000644000175000017500000000564713253717231015135 0ustar alexalexAnnounce: Rakudo Perl 6 development release #17 ("Stockholm") On behalf of the Rakudo development team, I'm pleased to announce the May 2009 development release of Rakudo Perl #17 "Stockholm". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the May 2009 release is available from http://github.com/rakudo/rakudo/downloads . Due to the continued rapid pace of Rakudo development and the frequent addition of new Perl 6 features and bugfixes, we continue to recommend that people wanting to use or work with Rakudo obtain the latest source directly from the main repository at github. More details are available at http://rakudo.org/how-to-get-rakudo . Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. This release is named "Stockholm"; Stockholm Perl Mongers will be holding a Perl 6 hackathon on May 29 [3]. Perl 6 developer Carl Mäsak is a member of Stockholm Perl Mongers and a main author of November [4], Druid [5], proto [6], and other Perl 6-based packages. Carl also contributes patches to Rakudo, and has been stress-testing Rakudo over the past year, submitting nearly 400 bug reports. In this release of Rakudo Perl, we've made the following major changes and improvements: * Rakudo is now passing 11,342 spectests, an increase of 875 passing tests since the April 2009 release. With this release Rakudo is now passing 68% of the available spectest suite. * We now have an updated docs/ROADMAP . * Errors and stack traces now report the file name and line number in the original source code. * Some custom operators can be defined, and it's possible to refer to operators using &infix: syntax. * We can start to load libraries written in other Parrot languages. * Regexes now produce a Regex sub. * More builtin functions and methods have been rewritten in Perl 6 and placed as part of the setting. * There are many additional improvements and features in this release, see docs/ChangeLog for a more complete list. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#18) is scheduled for June 18, 2009. A list of the other planned release dates and codenames for 2009 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! References: [1] Parrot, http://parrot.org/ [2] Stockholm.pm, http://sthlm.pm.org/ [3] Stockholm Perl 6 hackathon, http://vic20.blipp.com/pipermail/kameler/2009-May/000318.html [4] November wiki engine, http://github.com/viklund/november/ [5] Druid, http://github.com/masak/druid/ [6] Proto, http://github.com/masak/proto/ rakudo-2018.03/docs/announce/2009-060000644000175000017500000000651113253717231015125 0ustar alexalexAnnounce: Rakudo Perl 6 development release #18 ("Pittsburgh") On behalf of the Rakudo development team, I'm pleased to announce the June 2009 development release of Rakudo Perl #18 "Pittsburgh". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the June 2009 release is available from http://github.com/rakudo/rakudo/downloads . Due to the continued rapid pace of Rakudo development and the frequent addition of new Perl 6 features and bugfixes, we continue to recommend that people wanting to use or work with Rakudo obtain the latest source directly from the main repository at github. More details are available at http://rakudo.org/how-to-get-rakudo . Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. This release is named "Pittsburgh", which is the host for YAPC|10 (YAPC::NA 2009) [2] and the Parrot Virtual Machine Workshop [3]. Pittsburgh.pm has also sponsored hackathons for Rakudo Perl as part of the 2008 Pittsburgh Perl Workshop [4]. In this release of Rakudo Perl, we've focused our efforts on refactoring many of Rakudo's internals; these refactors improve performance, bring us closer to the Perl 6 specification, operate more cleanly with Parrot, and provide a stronger foundation for features to be implemented in the near future. Some of the specific major changes and improvements in this release include: * Rakudo is now passing 11,536 spectests, an increase of 194 passing tests since the May 2009 release. With this release Rakudo is now passing 68% of the available spectest suite. * Method dispatch has been substantially refactored; the new dispatcher is significantly faster and follows the Perl 6 specification more closely. * Object initialization via the BUILD and CREATE (sub)methods is substantially improved. * All return values are now type checked (previously only explicit 'return' statements would perform type checking). * String handling is significantly improved: fewer Unicode-related bugs exist, and parsing speed is greatly improved for some programs containing characters in the Latin-1 set. * The IO .lines and .get methods now follow the specification more closely. * User-defined operators now also receive some of their associated meta variants. * The 'is export' trait has been improved; more builtin functions and methods can be written in Perl 6 instead of PIR. * Many Parrot changes have improved performance and reduced overall memory leaks (although there's still much more improvement needed). The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#19) is scheduled for July 23, 2009. A list of the other planned release dates and codenames for 2009 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! References: [1] Parrot, http://parrot.org/ [2] YAPC|10 http://yapc10.org/yn2009/ [3] Parrot Virtual Machine Workshop, http://yapc10.org/yn2009/talk/2045 [4] Pittsburgh Perl Workshop, http://pghpw.org/ppw2008/ rakudo-2018.03/docs/announce/2009-070000644000175000017500000000612413253717231015126 0ustar alexalexAnnounce: Rakudo Perl 6 development release #19 ("Chicago") On behalf of the Rakudo development team, I'm pleased to announce the June 2009 development release of Rakudo Perl #19 "Chicago". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the July 2009 release is available from http://github.com/rakudo/rakudo/downloads . Due to the continued rapid pace of Rakudo development and the frequent addition of new Perl 6 features and bugfixes, we continue to recommend that people wanting to use or work with Rakudo obtain the latest source directly from the main repository at github. More details are available at http://rakudo.org/how-to-get-rakudo . Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. The July 2009 release is named "Chicago", as chosen by Perl 6 contributor Kyle Hasselbacher. Kyle has been doing a truly outstanding job of turning open tickets in the RT queues into tests for the spectest suite. Chicago.pm has been the host for the 2006 and 2008 YAPC::NA conferences and sponsored Perl 6 hackathons at each conference. In this release of Rakudo Perl, we've focused our efforts on quality improvements and bootstrapping. We now have operators and additional builtin functions written in Perl 6. Some of the specific major changes and improvements in this release include: * Rakudo is now passing 11,876 spectests, an increase of 340 passing tests since the June 2009 release. With this release Rakudo is now passing 68% of the available spectest suite. * Operators can now be written in Perl 6, and this has been done for the series operator '...', 'eqv' and the 'leg' operator. * The multi dispatcher has been refactored extensively, and now handles many more edge cases correctly. * User defined traits now follow the specification much more closely; some built-in traits are written in Perl 6. * Improved testing: Null PMC Access exceptions are never considered "successful" by the test suite, even if the test was expecting a (different) exception to be thrown. * Improved introspection: you can now get a list of roles composed into a class, and a list of attributes. Since the Perl 6 specification is still in flux, some deprecated features will be removed from Rakudo. Prominently among those are: * '=$handle' is deprecated in favor of '$handle.get' (one line) and '$handle.lines' (all lines). * 'int $obj' is deprecated in favor of '$obj.Int'. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#20) is scheduled for August 20, 2009. A list of the other planned release dates and codenames for 2009 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! References: [1] Parrot, http://parrot.org/ rakudo-2018.03/docs/announce/2009-080000644000175000017500000000716113253717231015131 0ustar alexalexAnnounce: Rakudo Perl 6 development release #20 ("PDX") On behalf of the Rakudo development team, I'm pleased to announce the August 2009 development release of Rakudo Perl #20 "PDX". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the August 2009 release is available from http://github.com/rakudo/rakudo/downloads . Due to the continued rapid pace of Rakudo development and the frequent addition of new Perl 6 features and bugfixes, we continue to recommend that people wanting to use or work with Rakudo obtain the latest source directly from the main repository at github. More details are available at http://rakudo.org/how-to-get-rakudo . Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. August 2009 is code named "PDX" for the Portland Perl Mongers. PDX.pm has been home to several Rakudo contributors (chromatic, Allison Randal, and more) and PDX.pm has held meetings that have produced feature and bugfix patches for Rakudo. Beginning with this release, Rakudo Perl builds from an "installed Parrot" instead of using Parrot's build tree. This release of Rakudo requires Parrot 1.5.0. For the latest information on building and using Rakudo Perl, see the README file section titled "Building and invoking Rakudo". (Quick note: the "--gen-parrot" option still automatically downloads and builds Parrot as before, if you prefer that approach.) Also, unlike previous versions of Rakudo Perl, the "perl6" (or "perl6.exe") executables only work when invoked from the Rakudo root directory until a "make install" is performed. Running "make install" will install Rakudo and its libraries into the Parrot installation that was used to build it, and then the executables will work when invoked from any directory. Some of the specific major changes and improvements occuring with this release include: * Rakudo is now passing 12,369 spectests, an increase of 493 passing tests since the July 2009 release. With this release Rakudo is now passing 69.98% of the available spectest suite. * We now have a much cleaner traits implementation. Many of the Perl 6 built-in traits are now implemented in Perl 6, and user-defined traits can now be defined and applied to classes and roles. * The 'hides' trait on classes can make one class hide another. * Many not-yet-implemented operators and features now provide more helpful error messages instead of simply producing parse errors. * The ROADMAP has been substantially updated and includes some details regarding the "Rakudo Star" release [2]. * Embedded comments now require backticks (Perl 6 specification change). Since the Perl 6 specification is still in flux, some deprecated features will be removed from Rakudo. Prominently among those are: * '=$handle' is deprecated in favor of '$handle.get' (one line) and '$handle.lines' (all lines). * 'int $obj' is deprecated in favor of '$obj.Int'. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#21) is scheduled for September 17, 2009. A list of the other planned release dates and codenames for 2009 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! References: [1] Parrot, http://parrot.org/ [2] Rakudo Star, http://use.perl.org/~pmichaud/journal/39411 rakudo-2018.03/docs/announce/2009-090000644000175000017500000000665113253717231015135 0ustar alexalexAnnounce: Rakudo Perl 6 development release #21 ("Seattle") On behalf of the Rakudo development team, I'm pleased to announce the September 2009 development release of Rakudo Perl #21 "Seattle". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine [1]. The tarball for the September 2009 release is available from http://github.com/rakudo/rakudo/downloads . Due to the continued rapid pace of Rakudo development and the frequent addition of new Perl 6 features and bugfixes, we recommend building Rakudo from the latest source, available from the main repository at github. More details are available at http://rakudo.org/how-to-get-rakudo. Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. September 2009 is code named "Seattle" for the enthusiasm they have shown for Perl 6 during monthly meetings, and the feedback, encouragement and support given me for the past several years. Since the 2009-08 release, Rakudo Perl builds from an "installed Parrot" instead of using Parrot's build tree. This release of Rakudo requires Parrot 1.6.0. For the latest information on building and using Rakudo Perl, see the README file section titled "Building and invoking Rakudo". (Quick note: the "--gen-parrot" option still automatically downloads and builds Parrot as before, if you prefer that approach.) Also, unlike previous versions of Rakudo Perl, the "perl6" (or "perl6.exe") executables only work when invoked from the Rakudo root directory until a "make install" is performed. Running "make install" will install Rakudo and its libraries into the Parrot installation that was used to build it, and then the executables will work when invoked from any directory. Some of the specific major changes and improvements occuring with this release include: * Rakudo is now passing 15,497 spectests, an increase of 3,128 passing tests since the August 2009 release. With this release Rakudo is now passing 71.5% of the available spectest suite. * Rakudo now supports contextual variables. * Rakudo now supports the rational (Rat) data type. * Rakudo now supports overloading of many of the builtin operators, many of which are now defined in the core setting. Many have also been improved to be more faithful to the specification with respect to types and coercions. * Substantially improved support for trait handling. Most of the "built-in" traits are now defined in the core setting. * The %*ENV variable now works properly for modifying the process environment. Since the Perl 6 specification is still in flux, some deprecated features have been removed from Rakudo. Prominently among those are: * '=$handle' is deprecated in favor of '$handle.get' (one line) and '$handle.lines' (all lines). * 'int $obj' is deprecated in favor of '$obj.Int'. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#22) is scheduled for October 22, 2009. A list of the other planned release dates and codenames for 2009 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! References: [1] Parrot, http://parrot.org/ rakudo-2018.03/docs/announce/2009-100000644000175000017500000000656013253717231015124 0ustar alexalexAnnounce: Rakudo Perl 6 development release #22 ("Thousand Oaks") On behalf of the Rakudo development team, I'm pleased to announce the October 2009 development release of Rakudo Perl #22 "Thousand Oaks". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org). The tarball for the October 2009 release is available from http://github.com/rakudo/rakudo/downloads Due to the continued rapid pace of Rakudo development and the frequent addition of new Perl 6 features and bugfixes, we recommend building Rakudo from the latest source, available from the main repository at github. More details are available at http://rakudo.org/how-to-get-rakudo. Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. The October 2009 is code named "Thousand Oaks" for their amazing Perl 6 hackathon, their report at http://www.lowlevelmanager.com/2009/09/perl-6-hackathon.html, and just because I like the name :-) Since the 2009-08 release, Rakudo Perl builds from an installed Parrot instead of using Parrot's build tree. This means that, unlike previous versions of Rakudo Perl, the "perl6" (or "perl6.exe") executables only work when invoked from the Rakudo root directory until a "make install" is performed. Running "make install" will install Rakudo and its libraries into the Parrot installation that was used to build it, and then the executables will work when invoked from any directory. This release of Rakudo requires Parrot 1.7.0. For the latest information on building and using Rakudo Perl, see the readme file section titled "Building and invoking Rakudo". (Quick note: the "--gen-parrot" option still automatically downloads and builds Parrot as before, if you prefer that approach.) Some of the specific changes and improvements occuring with this release include: * Rakudo is now passing 32,582 spectests, an increase of 17,085 passing tests since the September 2009 release. With this release Rakudo is now passing 85.0% of the available spectest suite. * We have a huge increase in the number of spectests relating to the Complex and Rat numeric types. * Complex numbers are now implemented as a Perl 6 class, and supports all trigonometric functions from the specification. * Rakudo has a new signature binder which makes calling routines and operators much faster, and allows binding of positional arguments by name. * Rakudo has improved signature introspection, better errors relating to signatures and signature literals are now supported. * Rakudo now supports accessing outer lexical variables from classes and packages. * Some new variants of the series operator are now implemented. * When configuring Rakudo with --gen-parrot, the --optimize flag is now passed to Parrot's Configure.pl The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#23) is scheduled for November 19, 2009. A list of the other planned release dates and codenames for 2009 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2009-110000644000175000017500000000603413253717231015121 0ustar alexalexAnnounce: Rakudo Perl 6 development release #23 ("Lisbon") On behalf of the Rakudo development team, I'm pleased to announce the November 2009 development release of Rakudo Perl #23 "Lisbon". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org). The tarball for the November 2009 release is available from http://github.com/rakudo/rakudo/downloads Due to the continued rapid pace of Rakudo development and the frequent addition of new Perl 6 features and bugfixes, we recommend building Rakudo from the latest source, available from the main repository at github. More details are available at http://rakudo.org/how-to-get-rakudo. Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. The November 2009 release is code named "Lisbon" for Lisbon.pm, who did a marvellous job arranging this year's YAPC::EU. Shortly after the October 2009 (#22) release, the Rakudo team began a new branch of Rakudo development ("ng") that refactors the grammar to much more closely align with STD.pm as well as update some core features that have been difficult to achieve in the master branch [1, 2]. Most of our effort for the past month has been in this new branch, but as of the release date the new version had not sufficiently progressed to be the release copy. We expect to have the new version in place in the December 2009 release. This release of Rakudo requires Parrot 1.8.0. One must still perform "make install" in the Rakudo directory before the "perl6" executable will run anywhere other than the Rakudo build directory. For the latest information on building and using Rakudo Perl, see the readme file section titled "Building and invoking Rakudo". Some of the specific changes and improvements occuring with this release include: * Rakudo is now passing 32,753 spectests, an increase of 171 passing tests since the October 2009 release. With this release Rakudo is now passing 85.5% of the available spectest suite. * As mentioned above, most development effort for Rakudo in November has taken place in the "ng" branch, and will likely be reflected in the December 2009 release. * Rakudo now supports unpacking of arrays, hashes and objects in signatures * Rakudo has been updated to use Parrot's new internal calling conventions, resulting in a slight performance increase. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#24) is scheduled for December 17, 2009. A list of the other planned release dates and codenames for 2009 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! [1] http://use.perl.org/~pmichaud/journal/39779 [2] http://use.perl.org/~pmichaud/journal/39874 rakudo-2018.03/docs/announce/2009-120000644000175000017500000000730613253717231015125 0ustar alexalexAnnounce: Rakudo Perl 6 development release #24 ("Seoul") On behalf of the Rakudo development team, I'm pleased to announce the December 2009 development release of Rakudo Perl #24 "Seoul". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org). The tarball for the December 2009 release is available from http://github.com/rakudo/rakudo/downloads Due to the continued rapid pace of Rakudo development and the frequent addition of new Perl 6 features and bugfixes, we recommend building Rakudo from the latest source, available from the main repository at github. More details are available at http://rakudo.org/how-to-get-rakudo. Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. The December 2009 release is code named "Seoul" for Seoul.pm, who hosted Jonathan so well recently, and because they have a cake duck. Shortly after the October 2009 (#22) release, the Rakudo team began a new branch of Rakudo development ("ng") that refactors the grammar to much more closely align with STD.pm as well as update some core features that have been difficult to achieve in the master branch [1, 2]. Most of our effort for the past month has been in this new branch, but as of the release date the new version had not sufficiently progressed to be the release copy. We expect to have the new version in place in the January 2010 release, but may elect to have an interim release from the new branch before then. This release of Rakudo requires Parrot 1.9.0. One must still perform "make install" in the Rakudo directory before the "perl6" executable will run anywhere other than the Rakudo build directory. For the latest information on building and using Rakudo Perl, see the readme file section titled "Building and invoking Rakudo". Some of the specific changes and improvements occuring with this release include: * Rakudo is now passing 32,192 spectests, a "decrease" of 561 passing tests since the November 2009 release. We pass fewer tests now because specification changes caused many obsolete (but passing) tests to be removed from the suite -- from 38,318 in November to 37,376 now. The percentage of passing tests has increased, from 85.5% in November to 86.1% today. * More improvements to the Rat type and related math functions to remain aligned with the specification. The Perl 6 language specification is still in flux. Please take note of the following changes, which might affect your existing programs. In the next release of Rakudo, the deprecated features will likely be gone. * The root of the object hierarchy has been changed from 'Object' to 'Mu'. The type 'Object' goes away. * The term 'undef' is gone. You can replace it with other constructs, depending on context: - 'Nil' is undefined in item context, and the empty list in list context - 'Mu' is the most general undefined value which does not flatten in list context - as a smart matching target, you can replace '$obj ~~ undef' by '$obj ~~ *.notdef' The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#25) is scheduled for January 21, 2010. A list of the other planned release dates and codenames for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! [1] http://use.perl.org/~pmichaud/journal/39779 [2] http://use.perl.org/~pmichaud/journal/39874 rakudo-2018.03/docs/announce/2010-010000644000175000017500000001000713253717231015103 0ustar alexalexAnnounce: Rakudo Perl 6 development release #25 ("Minneapolis") On behalf of the Rakudo development team, I'm pleased to announce the January 2010 development release of Rakudo Perl #25 "Minneapolis". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org). The tarball for the January 2010 release is available from http://github.com/rakudo/rakudo/downloads . Rakudo Perl follows a monthly release cycle, with each release code named after a Perl Mongers group. The January 2010 release is code named "Minneapolis" for Minneapolis.pm, hosts of the annual Frozen Perl Workshop [1]. In 2009 the Frozen Perl Workshop featured a one-day hackathon for Perl 6 and Rakudo development, which ultimately informed the design and implementation of the current build system. (The 2010 Frozen Perl Workshop will be on February 6, 2010, for those interested in attending.) Shortly after the October 2009 (#22) release, the Rakudo team began a new branch of Rakudo development ("ng") that refactors the grammar to much more closely align with STD.pm as well as update some core features that have been difficult to achieve in the master branch [2, 3]. We had planned for this release to be created from the new branch, but holiday vacations and other factors conspired against us. This is absolutely the final release from the old development branch; we expect to make the new branch the official "master" branch shortly after this release. This release of Rakudo requires Parrot 2.0.0. One must still perform "make install" in the Rakudo directory before the "perl6" executable will run anywhere other than the Rakudo build directory. For the latest information on building and using Rakudo Perl, see the README file section titled "Building and invoking Rakudo". Some of the specific changes and improvements occuring with this release include: * Rakudo is now passing 31,957 spectests, or 85.7% of the available test suite. This is roughly the same level as the December 2009 release (because most effort has taken place in the "ng" branch as described above). * Rakudo's calling conventions have been updated to match changes in Parrot 2.0.0's calling and context structures. The Perl 6 language specification is still in flux. Please take note of the following changes, which might affect your existing programs. In the next release of Rakudo, the deprecated features will likely be gone. * The root of the object hierarchy has been changed from 'Object' to 'Mu'. The type 'Object' goes away. * The term 'undef' is gone. You can replace it with other constructs, depending on context: - 'Nil' is undefined in item context, and the empty list in list context - 'Mu' is the most general undefined value which does not flatten in list context - as a smart matching target, you can replace '$obj ~~ undef' by '$obj ~~ *.notdef' * Builtin classes will derive from 'Cool' (which itself derives from 'Any'). Most of the builtin methods on these classes will be defined in the 'Cool' class instead of 'Any'. See Synopsis 2 for more details. * Starting with the next release, we will likely switch to using "YYYY.MM" instead of "YYYY-MM" (dot instead of hyphen) as release identifiers. This is intended to simplify building and packaging for other distribution systems. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#26) is scheduled for February 18, 2010. A list of the other planned release dates and codenames for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! [1] http://www.frozen-perl.org/ [2] http://use.perl.org/~pmichaud/journal/39779 [3] http://use.perl.org/~pmichaud/journal/39874 rakudo-2018.03/docs/announce/2010.020000644000175000017500000001016013253717231015105 0ustar alexalexAnnounce: Rakudo Perl 6 development release #26 ("Amsterdam") On behalf of the Rakudo development team, I'm pleased to announce the February 2010 development release of Rakudo Perl #26 "Amsterdam". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org). The tarball for the February 2010 release is available from http://github.com/rakudo/rakudo/downloads . Rakudo Perl follows a monthly release cycle, with each release named after a Perl Mongers group. The February 2010 release is code named "Amsterdam" for the largest chapter of the Dutch Perl Mongers. Perl development enjoys considerable support from the Netherlands, with donations from NLNet, and hosting of the feather machines and several important Perl 6 web domains and sites. This release is the first release based on the new branch of Rakudo development begun in October 2009. The branch refactors the grammar, object metamodel, and a number of other key features to improve compatibility with the Perl 6 specification and give us a more solid foundation to build on. Indeed, in many ways the development of this new branch has driven important changes to the specification in the areas of lists, iterators, slices, and much more. However, this release contains a number of significant regressions from previous compiler releases. We expect to have full functionality restored in this branch in the next couple of weeks. For those looking to explore a wide variety of Perl 6 features or who have applications developed using previous releases of Rakudo, you may wish to continue to use the January 2010 (#25, "Minneapolis") release. This release of Rakudo requires Parrot 2.1.0. One must still perform "make install" in the Rakudo directory before the "perl6" executable will run anywhere other than the Rakudo build directory. For the latest information on building and using Rakudo Perl, see the README file section titled "Building and invoking Rakudo". Some of the specific changes and improvements occuring with this release include: * Now using nqp-rx for parsing and actions * Grammar is much closer to STD in many aspects, and makes use of protoregexes * Closures and lexical/contextual variable declarations in regexes work * Laziness is implemented * All class and role construction is handled through the meta-model The Perl 6 language specification is still in flux. Please take note of the following changes, which might affect your existing programs. In the next release of Rakudo, the deprecated features will likely be gone. * The root of the object hierarchy has been changed from 'Object' to 'Mu'. The type 'Object' goes away. * The term 'undef' is gone. You can replace it with other constructs, depending on context: - 'Nil' is undefined in item context, and the empty list in list context - 'Mu' is the most general undefined value which does not flatten in list context - as a smart matching target, you can replace '$obj ~~ undef' by '$obj ~~ *.notdef' * Builtin classes will derive from 'Cool' (which itself derives from 'Any'). Most of the builtin methods on these classes will be defined in the 'Cool' class instead of 'Any'. See Synopsis 2 for more details. * Starting with the this release, release identifiers are given as "YYYY.MM" instead of "YYYY-MM" (dot instead of hyphen). This is intended to simplify building and packaging for other distribution systems. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#27) is scheduled for March 18, 2010. A list of the other planned release dates and codenames for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! [1] http://www.frozen-perl.org/ [2] http://use.perl.org/~pmichaud/journal/39779 [3] http://use.perl.org/~pmichaud/journal/39874 rakudo-2018.03/docs/announce/2010.030000644000175000017500000000536213253717231015116 0ustar alexalexAnnounce: Rakudo Perl 6 development release #27 ("Copenhagen") On behalf of the Rakudo development team, I'm pleased to announce the March 2010 development release of Rakudo Perl #27 "Copenhagen". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org). The tarball for the March 2010 release is available from http://github.com/rakudo/rakudo/downloads . Rakudo Perl follows a monthly release cycle, with each release named after a Perl Mongers group. The March 2010 release is code named "Copenhagen" for Copenhagen.pm, hosts of the Perl 6 Copenhagen Hackathon [1], which took place in connection with the Open Source Days Conference. The main goal of the hackathon was to raise some awareness around Perl 6, and to give everyone a chance to get their hands-on with Perl 6. The Copenhagen hackathon helped nail down a number of issues regarding module loading. During these days we also saw a heightened activity on the channel, in the Perl 6 and Rakudo repositories, and in the number of passing tests. All this was contributed by people both on location and elsewhere. The RT queue peaked at 725 new/open tickets, and then started on a downward trend. Apart from the great steps forward in productivity, it was the first time some of the core Perl 6 contributors had a chance to meet. Some of the specific changes and improvements occuring with this release include: * Numerous updates to trigonometric functions and the Rat class * Basic s/// and s[...] = '...' implemented * use improved and need/import implemented, with some basic support for versioned modules and lexical importation * Grammars work again and now include support for regexes taking parameters and proto-regexes * Series operator now has basic support for the current Spec. * User defined operators working again * Support, though with caveats, for !, R, X and Z meta-operators * Performance improvements for invocation and hash creation * Various parsing bugs fixed * Variables initialized to Any by default now, not Mu * ROADMAP updates For a more detailed list of changes see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#28) is scheduled for April 22, 2010. A list of the other planned release dates and codenames for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! [1] http://conferences.yapceurope.org/hack2010dk/ rakudo-2018.03/docs/announce/2010.040000644000175000017500000000435713253717231015122 0ustar alexalex Announce: Rakudo Perl 6 development release #28 ("Moscow") On behalf of the Rakudo development team, I'm pleased to announce the March 2010 development release of Rakudo Perl #28 "Moscow". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org). The tarball for the April 2010 release is available from http://github.com/rakudo/rakudo/downloads . Rakudo Perl follows a monthly release cycle, with each release named after a Perl Mongers group. The April 2010 release is code named "Moscow" in recognition of Москва.пм and their invitation of Jonathan Worthington, one of our core develepors, to speak at the Russian Internet Technologies 2010 [1] conference. Some of the specific changes and improvements occuring with this release include: * Expressions that begin with a variable and end with a circumfix now properly interpolate into double-quoted strings, like "@array.sort()" or "%hash". * Item assignment now has tighter precdence than list assignment, so both 'my @a = 1, 2, 3' and '$a = 1, $b = 2' magically work. * Most of the DateTime built-in type has been backported from the "alpha" branch, and is now accompanied by a Date type for date-only calculations. * Many obsolete uses of Perl 5 constructs are now caught and give helpful error messages. * As always, many additional small features and bug fixes make working with Rakudo more pleasant. * Rakudo now passes 30,931 spectests. We estimate that there are about 39,000 tests in the test suite, so Rakudo passes about 79% of all tests. For a more detailed list of changes see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible. If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#29) is scheduled for May 20, 2010. A list of the other planned release dates and code names for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! [1]: http://ritconf.ru/ rakudo-2018.03/docs/announce/2010.050000644000175000017500000000500513253717231015112 0ustar alexalex Announce: Rakudo Perl 6 development release #29 ("Erlangen") On behalf of the Rakudo development team, I'm pleased to announce the May 2010 development release of Rakudo Perl #29 "Erlangen". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see http://www.parrot.org). The tarball for the May 2010 release is available from http://github.com/rakudo/rakudo/downloads . Rakudo Perl follows a monthly release cycle, with each release named after a Perl Mongers group. The May 2010 release is code named "Erlangen" in recognition of Erlangen.pm and the Perl 6 talk that Moritz Lenz, one of our core developers, gave this month. Some of the specific changes and improvements occurring with this release include: * Lexical classes and roles were implemented. Additionally, anonymous classes -- which were never quite right in alpha -- are now implemented more correctly, and anonymous roles are also supported. * Basic support for named enumerations of the form 'enum Weekday ' has been restored. * First cut of use Foo:from and eval('foo', :lang); needs Blizkost[1] to be installed to work. * Numeric / Real roles much closer to the spec now. * As always, many additional small features and bug fixes make working with Rakudo more pleasant. * Rakudo now passes 32,347 spectests. We estimate that there are about 39,500 tests in the test suite, so Rakudo passes about 82% of all tests. For a more detailed list of changes see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Solomon Foster, Moritz Lenz, Jonathan Worthington, Martin Berends, chromatic, Carl Masak, snarkyboojum, Stefan O'Rear, Reini Urban, Jonathan Scott Duff, takadonet, Christoph Otto, isBEKaml, ash_, bubaflub, Jimmy Zhuo, Peter Lobsinger and Patrick Abi Salloum If you would like to contribute, see http://rakudo.org/how-to-help , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#30) is scheduled for June 17, 2010. A list of the other planned release dates and code names for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! [1] http://github.com/jnthn/blizkostrakudo-2018.03/docs/announce/2010.060000644000175000017500000000567413253717231015127 0ustar alexalex Announce: Rakudo Perl 6 development release #30 ("Kiev") On behalf of the Rakudo development team, I'm pleased to announce the June 2010 development release of Rakudo Perl #30 "Kiev". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the June 2010 release is available from . Rakudo Perl follows a monthly release cycle, with each release named after a Perl Mongers group. This release is named after the Perl Mongers from the beautiful Ukrainian capital, Kiev. They recently helped organize and participated in the Perl Mova + YAPC::Russia conference, the хакмит (hackathon) of which was a particular success for Rakudo. All those who joined the Rakudo hacking - from Kiev and further afield - contributed spec tests as well as patches to Rakudo, allowing various RT tickets to be closed, and making this month's release better. Дякую! Some of the specific changes and improvements occurring with this release include: * Rakudo now uses immutable iterators internally, and generally hides their existence from programmers. Many more things are now evaluated lazily. * Backtraces no longer report routines from Parrot internals. This used to be the case in the Rakudo alpha branch as well, but this time they are also very pleasant to look at. * Match objects now act like real hashes and arrays. * Regexes can now interpolate variables. * Hash and array slicing has been improved. * The REPL shell now prints results, even when not explicitly asked to print them, thus respecting the "P" part of "REPL". * Rakudo now passes 33,378 spectests. We estimate that there are about 39,900 tests in the test suite, so Rakudo passes about 83% of all tests. For a more detailed list of changes see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Patrick R. Michaud, Moritz Lenz, Jonathan Worthington, Solomon Foster, Patrick Abi Salloum, Carl Mäsak, Martin Berends, Will "Coke" Coleda, Vyacheslav Matjukhin, snarkyboojum, sorear, smashz, Jimmy Zhuo, Jonathan "Duke" Leto, Maxim Yemelyanov, Stéphane "cognominal" Payrard, Gerd Pokorra, Bruce Keeler, Ævar Arnfjörð Bjarmason, Shrivatsan, Hongwen Qiu, quester, Alexey Grebenschikov, Timothy Totten If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#31) is scheduled for July 22, 2010. A list of the other planned release dates and code names for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2010.070000644000175000017500000000557013253717231015123 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #31 ("Atlanta") On behalf of the Rakudo development team, I'm happy to announce the July 2010 development release of Rakudo Perl #31 "Atlanta". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the July 2010 release is available from . Please note: This is not the Rakudo Star release, which is scheduled for July 29, 2010 [1]. The Star release will include the compiler, an installer, modules, a book (PDF), and more. The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The July 2010 release is code named "Atlanta" in recognition of Atlanta.pm and their Perl 5 Phalanx project [2], which they selected for its benefits to Perl 6. Some of the specific changes and improvements occurring with this release include: * Rakudo now properly constructs closures in most instances. * Undefined objects can now autovivify into arrays or hashes when subscripted with .[ ] or .{ } . * Arrays can now handle infinite ranges. * Generic, multi-level Whatever-currying now works, e.g. (1, 1, *+* ... *). * The REPL shell now remembers lexical declarations in susbsequent lines. * The open() subroutine now returns a Failure instead of throwing a fatal exception. * Rakudo now provides $*ARGFILES for reading from files specified on the command line. * Added $*PERL, moved %*VM to $*VM. * Simple binding operators := and ::= now work. * Simple feed operators <== and ==> now work. For a more detailed list of changes see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Patrick R. Michaud, Jonathan Worthington, Moritz Lenz, Solomon Foster, Carl Masak, Bruce Gray, Martin Berends, chromatic, Will "Coke" Coleda, Matthew (lue), Timothy Totten, maard, Kodi Arfer, TimToady, Stephen Weeks, Patrick Abi Salloum, snarkyboojum, Radu Stoica, Vyacheslav Matjukhin, Andrew Whitworth, cognominal, Tyler Curtis, Alex Kapranoff, Ingy döt Net, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯, mathw, lue, Вячеслав Матюхин If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#32) is scheduled for August 19, 2010. A list of the other planned release dates and code names for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! [1] http://rakudo.org/node/73 [2] http://code.google.com/p/atlanta-pm-code/ rakudo-2018.03/docs/announce/2010.080000644000175000017500000000541313253717231015120 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #32 ("Pisa") On behalf of the Rakudo development team, I'm happy to announce the August 2010 release of Rakudo Perl #32 "Pisa". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the August 2010 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The August 2010 release is code named "Pisa" in recognition of its excellent work in organizing YAPC::EU 2010, "The Renaissance of Perl" [1,2]. Many Rakudo developers presented at the conference, and it was an excellent location for a hackathon and planning the next phases of Rakudo development. Some of the specific changes and improvements occurring with this release include: * Due to a specification change, Nil is now undefined, and no longer simply an empty Parcel. * Many modifiers are now recognized on the outside of regexes and substitutions, for example s:g:samecase/abc/defg/ * Improvements to the performance of integer operations * Initial implementations of .pack and .unpack methods for the Buf class * Smartmatching against True or False is now an error. Most people who did this really wanted to look at the return value of .so instead. For a more detailed list of changes see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Patrick R. Michaud, Solomon Foster, Will "Coke" Coleda, Carl Mäsak, Jonathan Worthington, Bruce Gray, Patrick Abi Salloum, tylercurtis, Kyle Hasselbacher, Tadeusz Sośnierz, Jonathan Scott Duff, Christopher J. Madsen, Kodi Arfer, Reini Urban, TimToady, felliott, Matt Kraai, Jan Ingvoldstad, szabgab, madsen, Andy Lester, cosimo, Fitz Elliott If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#33) is scheduled for September 23, 2010. A list of the other planned release dates and code names for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! [1] http://www.perl.it/ [2] http://conferences.yapceurope.org/ye2010/ rakudo-2018.03/docs/announce/2010.090000644000175000017500000000540713253717231015124 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #33 ("Milan") On behalf of the Rakudo development team, I'm happy to announce the August 2010 release of Rakudo Perl #33 "Milan". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the September 2010 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The September 2010 release is code named "Milan", because the release manager happens to like the name :-) Some of the specific changes and improvements occurring with this release include: * The specification for temporal objects (DateTime, Date, Instant and Duration) is now completely implemented in Rakudo * Several performance improvements were implemented, most notably in slurp() and reverse() functions * The series operator has been refactored, and updated to the current specification * Enumeration objects now conform much closer to the current specification * 'now' and 'time' are now terms (and not functions anymore). This means you can now write 'time - 1' and do what you mean, but 'time()' does not work anymore For a more detailed list of changes see "docs/ChangeLog". Deprecation notice: * Currently True and False evaluate as '1' and '0' in string context. The specification has changed, and in the next release they will evaluate to 'Bool::True' and 'Bool::False' in string context. To get the old behaviour, use ~+True or ~+False. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Patrick R. Michaud, Carl Masak, Patrick Abi Salloum, Solomon Foster, Kodi Arfer, chromatic, Kyle Hasselbacher, Bruce Gray, Martin Berends, Stephane Payrard, Tyler Curtis, Shlomi Fish, Nick Wellnhofer, Nuno Carvalho, Tadeusz Sośnierz, TiMBuS, NotFound, mathw If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#34) is scheduled for October 21, 2010. A list of the other planned release dates and code names for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2010.100000644000175000017500000000447013253717231015113 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #34 ("Paris") On behalf of the Rakudo development team, I'm happy to announce the October 2010 release of Rakudo Perl #34 "Paris". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the October 2010 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The October 2010 release is code named "Paris", because the of the Perl love at the Open Source Developers Conference held in Paris, France earlier in the month. Some of the specific changes and improvements occurring with this release include: * we now have a simple version of require * the local timezone is available in $*TZ * samespace versions of m// and s/// were implemented as ms// and ss/// respectively. * Str.flip is now 100 times faster than it used to be * the subroutine version of Str.comb now exists * Hyperoperators can now be applied to infix:<+=> and friends. * improved diagnostic messages For a more detailed list of changes see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Kodi Arfer, Patrick R. Michaud, Bruce Gray, Carl Masak, Ronald Schmidt, Jonathan Worthington, TimToady, TimTom, PhatEddy, Patrick Abi Salloum, and your humble release manager Jonathan Scott Duff. If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#35) is scheduled for November 18, 2010. A list of the other planned release dates and code names for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2010.110000644000175000017500000000414413253717231015112 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #35 ("Melbourne") On behalf of the Rakudo development team, I'm happy to announce the November 2010 release of Rakudo Perl #35 "Melbourne". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the November 2010 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The November 2010 release is code named "Melbourne", PM group of Damian Conway, long-time advocate/explicator of and contributor to Perl 6. Some of the specific changes and improvements occurring with this release include: * qw// is now implemented * .trans is now 5 times faster * indexing is now possible with both ranges and Whatever offsets together: @a[0 .. *-2] For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Solomon Foster, Kodi Arfer, Tadeusz Sośnierz, Nick Wellnhofer, Jonathan Scott Duff, Bruce Gray, Jonathan Worthington, Patrick R. Michaud, mikehh, flussence, Jan Ingvoldstad, and your humble release manager Carl Mäsak. If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#36) is scheduled for December 23, 2010. A list of the other planned release dates and code names for 2010 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2010.120000644000175000017500000000400613253717231015110 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #36 ("New York") On behalf of the Rakudo development team, I'm happy to announce the December 2010 release of Rakudo Perl #36 "New York". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the December 2010 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The December 2010 release is code named "New York" the first PM group, created by brian d foy, in tribute to Perl's 23rd anniversary, which was celebrated on the 18th of this month. Some of the specific changes and improvements occurring with this release include: * new .trans algorithm * configuration improvements * several bug fixes For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Carl Masak, Solomon Foster, Kodi Arfer, Fernando Brito, Tomoki Aonuma, Nick Wellnhofer, Patrick R. Michaud, Abi Salloum, frettled, smashz and Jonathan Scott Duff. If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#37) is scheduled for January 20, 2011. A list of the other planned release dates and code names for 2011 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2011.010000644000175000017500000000413413253717231015111 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #37 ("BristolBath") On behalf of the Rakudo development team, I'm happy to announce the January 2011 release of Rakudo Perl #37 "BristolBath". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the January 2011 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The December 2010 release is code named after Bristol & Bath Perl Mongers group. Some of the specific changes and improvements occurring with this release include: * faster subroutine calls (type cache) * implemented 'handles Rolename' trait * 'use Devel::Trace' debugging pragma * improved parsing of keyword boundaries * faster .comb For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Kodi Arfer, smashz, Jonathan Worthington, Solomon Foster, Tadeusz Sośnierz, Kyle Hasselbacher, Patrick R. Michaud, Jonathan Scott Duff, Fitz Elliott, Adrian White, Christoph Otto, Stefan O'Rear, Michael H. Hind, Vasily Chekalkin and Hongwen Qiu. If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#38) is scheduled for February 17, 2011. A list of the other planned release dates and code names for 2011 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2011.020000644000175000017500000000403013253717231015105 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #38 ("Toulouse") On behalf of the Rakudo development team, I'm happy to announce the February 2011 release of Rakudo Perl #38 "Toulouse". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the February 2011 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The February 2011 release is code named "Toulouse". Some of the specific changes and improvements occurring with this release include: * basic IPv6 support * new --ll-backtrace command line option for low level backtraces * the negation meta operator can now only be applied to operators where it makes sense. For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Solomon Foster, Kodi Arfer, Tadeusz Sośnierz, Patrick R. Michaud, Carl Masak, Jonathan Scott Duff, Jonathan Worthington, Vasily Chekalkin, Will "Coke" Coleda, Michael Stapelberg, Arne Skjærholt, Fitz Elliott If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#39) is scheduled for March 17, 2011. A list of the other planned release dates and code names for 2011 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2011.030000644000175000017500000000377213253717231015122 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #39 ("Orlando") On behalf of the Rakudo development team, I'm happy to announce the March 2011 release of Rakudo Perl #39 "Orlando". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the March 2011 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The March 2011 release is code named "Orlando". Some of the specific changes and improvements occurring with this release include: * an improved error message on type check failure in assignment * -n and -p command line options * complex conjugation support implemented For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Tadeusz Sośnierz, Carl Masak, Arne Skjærholt, William Orr, Kyle Hasselbacher, Jonathan Scott Duff, Dave Whipp, Jonathan Worthington, martin, Solomon Foster, JD Horelick, Jimmy Zhuo, Martin Berends, Patrick Abi Salloum, JimmyZ If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#40) is scheduled for April 21, 2011. A list of the other planned release dates and code names for 2011 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2011.040000644000175000017500000000407213253717231015115 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #40 ("ZA") On behalf of the Rakudo development team, I'm happy to announce the April 2011 release of Rakudo Perl #40 "ZA". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the April 2011 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The April 2011 release is code named "ZA" after ZA.pm in Grahamstown, Eastern Cape, South Africa because the denizens of #perl6 have an unusual facination with zebras and ZA just happens to have a "Z" and, according to my meager research, there are indeed zebras in the area. :-) Some of the specific changes and improvements occurring with this release include: * implemented Str.indent * A new, much simpler API and implemention of IO::Socket::INET For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Tadeusz Sośnierz, Martin Berends, Andy Lester, Jonathan Scott Duff, flussence, Patrick Abi Salloum, Carl Masak, Jarrod If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#41) is scheduled for May 19, 2011. A list of the other planned release dates and code names for 2011 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2011.050000644000175000017500000000357613253717231015126 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #41 ("Dahut") On behalf of the Rakudo development team, I'm happy to announce the May 2011 release of Rakudo Perl #41 "Dahut". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the May 2011 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The May 2011 release is code named "Dahut". Some of the specific changes and improvements occurring with this release include: * added a call counter for builtins in Perl 6-level subroutines * gcd (greatest common divisor) and lcm (largest common multiple) operators * implemented Int.base For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Patrick R. Michaud, Moritz Lenz, Jonathan Scott Duff, Tadeusz Sośnierz, Carl Masak, Solomon Foster, bacek If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#42) is scheduled for June 23, 2011. A list of the other planned release dates and code names for 2011 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2011.060000644000175000017500000000457713253717231015131 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #42 ("Bruxelles") On behalf of the Rakudo development team, I'm happy to announce the June 2011 release of Rakudo Perl #42 "Bruxelles". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the June 2011 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The June 2011 release is code named "Bruxelles". DON'T PANIC: Browsing the change log below, it might appear as though not much Rakudo development is taking place. Nearly all of the development activity is now occurring in the "nom" branch of the Rakudo repository (over 500 commits since the 2011.05 release). This new branch will shortly become the mainline branch from which monthly releases are made, and already contains many important bugfixes and performance improvements. Some of the specific changes and improvements occurring in the master branch with this release include: * Fixed a bug with &infix:<=> when used in multiple assignments to aggregate elements. * Improved parrot register handling for more efficient code. * Added take-rw and return-rw functions. For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Patrick R. Michaud, Moritz Lenz, Martin Berends, Tadeusz Sośnierz, JD Horelick, and others. If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#43) is scheduled for July 21, 2011. A list of the other planned release dates and code names for 2011 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun and don't forget your towel! rakudo-2018.03/docs/announce/2011.070000644000175000017500000000526413253717231015124 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #43 ("Beijing") On behalf of the Rakudo development team, I'm happy to announce the July 2011 release of Rakudo Perl #43 "Beijing". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for the July 2011 release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The July 2011 release is code named "Beijing" after the host of the Beijing Perl Workshop 2011, which featured several Perl 6 related talks. This will be the last compiler release made from the current "master" branch of Rakudo. For the past several months, Rakudo compiler development has primarily occurred in the "nom" branch of the Rakudo repository (over 1200 commits since the 2011.05 release). Shortly after this release, the "nom" branch will become the new "master" branch and will be the source for future releases, including the 2011.08 release. We expect there will be several releases in the near future -- watch http://rakudo.org/ for details. Some of the specific changes and improvements occurring in the master branch with this release include: * Fix bug in exponentation of negative numbers * Fix build on systems with little RAM For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Patrick R. Michaud, atrodo, Solomon Foster, bacek and others. If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. Rakudo has traditionally released two days after each Parrot monthly release. Because the new version of the compiler has additional dependencies beyond Parrot, starting in August 2011 we will make releases sometime in the week following each monthly Parrot release. (Parrot releases occur on the third Tuesday of each month.) Thus the next regular release of Rakudo will occur sometime before August 23, 2011. We also expect to have additional "pre-release" versions of Rakudo and Rakudo Star prior to that date. A list of the other planned release dates and code names for 2011 is available in the "docs/release_guide.pod" file. rakudo-2018.03/docs/announce/2011.090000644000175000017500000000762113253717231015125 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #44 ("Riga") On behalf of the Rakudo development team, I'm happy to announce the September 2011 release of Rakudo Perl #44 "Riga". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The September 2011 release is code named after the host city of the YAPC::EU 2011 conference, which included a very successful Perl 6 track and hackathon. This is the first compiler release from the latest development branch of Rakudo. It brings many exciting improvements, but also some regressions, which we are working on. If your primary interest is that your existing code running on Rakudo Perl continues to work, we suggest sticking with the Rakudo Star distribution release for a little longer. If instead you want to play with the latest in Rakudo development - including meta-programming and performance improvements - try this release. Some of the specific changes and improvements occurring with this release include: * numerous speedups * Int, Num and Str are now far more lightweight * int/num as attributes are stored compactly in the object body * meta objects are now much easier to modify * a Pod parser capable of attaching documentation to objects * --doc command line option producing formatted documentation * much more robust handling of infinite list * basic LoL (List of Lists) support * :U and :D type modifiers * improved handling of BEGIN phasers * protos and multis now conform to the new spec * improved enum support * basic 'constant' declarator * .WHAT and friends as macros * support for .gist * run() has been renamed to shell() to conform to current spec * hyper methods now descend into nested data structures * basic safe mode (through --seting=SAFE) * many bug fixes in parametric roles * a custom BUILD does not suppress default values * undeclared attributes detected and reported at compile time * basic support for native int/num types on lexical variables * a new regex engine We briefly regress on a few features since the previous release. Most notably, new regex engine has not implemented proto regexes yet, and only integer-based enums are available. For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Patrick R. Michaud, Tadeusz Sośnierz, Will "Coke" Coleda, Solomon Foster, Kodi Arfer, Carl Mäsak, Martin Berends, kboga, Jonathan Scott Duff, Michael Schröder, JD Horelick, TimToady, Arne Skjærholt, Kyle Hasselbacher, flussence, Dave Whipp, William Orr, Jimmy Zhuo, Andy Lester, Patrick Abi Salloum, Fitz Elliott, snarkyboojum, Ruslan Zakirov, Vasily Chekalkin, kristof, Stefan O'Rear, Geoff Broadwell, Martin Kjeldsen, supernovus, Timothy Totten, Felix Herrmann, Jarrod, mikehh, Michael Stapelberg, baest, Erik Johansen, bbkr If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#45) is scheduled for October 20, 2011. A list of the other planned release dates and code names for 2011 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur two days after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have fun! rakudo-2018.03/docs/announce/2011.100000644000175000017500000000701713253717231015114 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #45 ("Houston") On behalf of the Rakudo development team, I'm happy to announce the October 2011 release of Rakudo Perl #45 "Houston". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The October 2011 release is code named after the Houston Perl Mongers because Houston is a large city in Texas and because Perl 6 could always use more features from Texas. Oh ... and Houston also hosted YAPC::NA 2007 and had a nice Perl 6 hackathon. :-) This compiler release is from the latest development branch of Rakudo. It brings many exciting improvements, but also some regressions, which we are working on. If your primary interest is that your existing code running on Rakudo Perl continues to work, we suggest sticking with the Rakudo Star distribution release for a little longer. If instead you want to play with the latest in Rakudo development - including meta- programming and performance improvements - try this release. Some of the specific changes and improvements occurring with this release include: * Optimizations tuneable from the command line * native types on various operators * Fix start up error when $HOME environment variable isn't set * Fix C3 MRO bug * Start at implementing global matching (m:g//) * Various performance improvements We are still regressed on a few features just as in the previous release. These regressions should be rectified in coming releases. For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Will "Coke" Coleda, Tadeusz Sośnierz, Patrick R. Michaud, Jonathan Scott Duff, Carl Masak, Geoffrey Broadwell, mls, snarkyboojum, gfldex, TimToady, TiMBuS, JimmyZ If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#46) is scheduled for November 17, 2011. A list of the other planned release dates and code names for 2011 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. As always ... Have fun! [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enchance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2011.110000644000175000017500000000720513253717231015114 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #46 ("London") On behalf of the Rakudo development team, I'm happy to announce the November 2011 release of Rakudo Perl #46 "London". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The November 2011 release is code named after the London Perl Mongers, organizers of many London Perl Workshops, including the 2011 edition that took place this month. Over 200 people showed up for this great event, which had some Perl 6 talks amongst the schedule. This compiler release is from the latest development branch of Rakudo. It brings many exciting improvements, but also some regressions compared to the compiler release shipped with the latest Rakudo Star distribution. If your primary interest is that your existing code running on Rakudo Perl continues to work, we suggest sticking with the Rakudo Star distribution release for a little longer; we are aiming to issue a Rakudo Star based on this development branch in December. If instead you want to play with the latest in Rakudo development - including meta-programming and performance improvements - try this release. Some of the specific changes and improvements occurring with this release include: * Big integer support * Basic protoregex support with NFA-driven LTM for some declarative constructs * CATCH blocks are now much closer to spec, and thus much more useful * Improved support for MAIN argument parsing We are still regressed on a few features just as in the previous release. These regressions should be rectified in coming releases. For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Will "Coke" Coleda, Tadeusz Sośnierz, Geoffrey Broadwell, Solomon Foster, Jonathan Scott Duff, Michael Schroeder, Carl Masak, Geoff Broadwell, not_gerd and coto If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#47) is scheduled for December 22, 2011. A list of the other planned release dates and code names for 2011 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have a great deal of fun! [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enchance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2011.120000644000175000017500000000574213253717231015121 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #47 ("Columbus") On behalf of the Rakudo development team, I'm happy to announce the November 2011 release of Rakudo Perl #47 "Columbus". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The December 2011 release is code named after the Columbus Perl Mongers, organizers of YAPC::NA 2010, which featured a Perl 6 track and hackathon. Some of the specific changes and improvements occurring with this release include: * Many regex improvements, including escapes in character classes look-around assertions and many bug fixes * Several performance improvements * Defining new operators, flip flop operators, and the Proxy class are now supported We are still regressed on a few features compared to the 2011.07 release of Rakudo, the most notable of which is autovivification. These regressions should be rectified in coming releases. For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Will "Coke" Coleda, Michael Schroeder, Tadeusz Sośnierz, Solomon Foster, Zohar Kelrich, diakopter, JimmyZ, Jonathan Scott Duff, Geoffrey Broadwell, Woodi If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#48) is scheduled for January 19, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have a great deal of fun! [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.010000644000175000017500000000555613253717231015123 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #48 ("Toronto") On behalf of the Rakudo development team, I'm happy to announce the January 2012 release of Rakudo Perl #48 "Toronto". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The January 2012 release is code named after the Toronto Perl Mongers, organizers of YAPC::NA 2005, which featured a Perl 6 hackathon. Some of the specific changes and improvements occurring with this release include: * regex backtracking into subrules and captures now works * -c (compilation check) command line option works again * better parameter introspection * many bugfixes We are still regressed on a few features compared to the 2011.07 release of Rakudo, the most notable of which is autovivification. These regressions should be rectified in coming releases. For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Kris Shannon, Tadeusz Sośnierz, kboga, Carl Masak, Bruce Gray, Solomon Foster, Geoffrey Broadwell, not_gerd, wollmers. If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#49) is scheduled for February 23, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. Have a great deal of fun! [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.020000644000175000017500000000574013253717231015117 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #49 ("SPb") On behalf of the Rakudo development team, I'm happy to announce the February 2012 release of Rakudo Perl #49 "SPb". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The February 2012 release is code named after the Saint Petersburg Perl Mongers, because Saint Petersburg as a city has provided unmatched inspiration and clarity to at least two Rakudo programmers. Some of the specific changes and improvements occurring with this release include: * Regex syntax: and * &rename and © functions * LHS of infix: now thunks as per spec * Improved backtraces * Rat arithmetic falling back to Num when needed; FatRat * Object hashes * Int($x)-style coercions We are still regressed on a few features compared to the 2011.07 release of Rakudo, the most notable of which is autovivification. These regressions should be rectified in coming releases. For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Jonathan Worthington, Carl Masak, Tadeusz Sośnierz, kboga, Will "Coke" Coleda, TimToady, lumi, not_gerd, PerlJam, not_gerd. If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#50) is scheduled for March 22, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. May a great deal of fun befall you! [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.030000644000175000017500000000646213253717231015122 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #50 ("Argentina") On behalf of the Rakudo development team, I'm happy to announce the March 2012 release of Rakudo Perl #50 "Argentina". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The March 2012 release is code named after Argentina, because that's where one of our core contributors went to relax this month after adding some significant Perl 6 features to Rakudo. Some of the specific changes and improvements occurring with this release include: * greatly reduced startup time * significantly reduced memory usage during compilation of modules and of Rakudo itself. * implemented ENTER, LEAVE, KEEP, UNDO and START phasers * basic macros We are still regressed on a few features compared to the 2011.07 release of Rakudo, the most notable of which is autovivification. These regressions should be rectified in coming releases. Note that Rakudo now dies on 'our multi' declarations, which have poorly defined semantics. Please either declare an 'our proto' that re-dispatches to individual multis, or use exporting instead of package variables. For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Carl Masak, Tadeusz Sośnierz, Siddhant Saraf, not_gerd, Filip Sergot, TimToady, Michael Schroeder, Patrick R. Michaud, sisar, lumi, Felix Herrmann, flussence, felher If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#51) is scheduled for April 19, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I admonish you to try the new release, to live life to its fullest, to cherish each day, and to have fun. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.040000644000175000017500000000650213253717231015116 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #51 ("Brazos Valley") On behalf of the Rakudo development team, I'm happy to announce the April 2012 release of Rakudo Perl #51 "Brazos Valley". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The April 2012 release is code named after Brazos Valley, because they sponsored a Perl 6 Hackathon. Thanks! Some of the specific changes and improvements occurring with this release include: * Support for pseudo packages like MY, OUR, DYNAMIC * Support for indexing into packages like hashes, e.g. Foo::{'$x'} * Warnings now include line numbers * Assorted minor optimizations to compilation, Str methods and iteration * Now passing over 21,400 spec tests. We are still regressed on a few features compared to the 2011.07 release of Rakudo, the most notable of which is autovivification. These regressions will be rectified in coming releases. Two incompatible changes in this release are notable: * $?POD has been renamed to $?pod * 'defined' used to be a prefix operator, it is now an ordinary subroutine. Code like 'defined $a ?? $b !! $c' should be rewritten to use 'defined($a)' or '$a.defined' instead. For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Jonathan Worthington, Patrick R. Michaud, Carl Mäsak, Timo Paulssen, Tadeusz Sośnierz, Felix Herrmann, spider-mario, benabik, timotimo, TimToady and Will "Coke" Coleda. If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#52) is scheduled for May 17, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release. have fun, and let us know about your experience. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.04.10000644000175000017500000000575113253717231015262 0ustar alexalex Announce: Rakudo Perl 6 compiler development release 2012.04.1 On behalf of the Rakudo development team, I'm happy to announce an out-of-schedule release of the Rakudo Perl 6 compiler. Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . This release is a point release in addition to the regular, monthly releases. It contains some of the results of the Perl 6 Patterns hackathon in Oslo. It is intended to be used as the basis for the next Rakudo Star release. The Rakudo developers would like to thank the organizers from Oslo.pm. Some of the specific changes and improvements occurring with this release include: * Support for autovivification. * More robust module precompilation * $.foo, @.foo and %.foo style calls now properly contextualize The 'lib' directory is not in the default search path for modules anymore. Module authors and users can adjust the PERL6LIB environment variable accordingly. For a more detailed list of changes, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Jonathan Worthington, Patrick R. Michaud, Carl Mäsak, Will "Coke" Coleda, Tadeusz Sośnierz, Marcus Ramberg, Timo Paulssen, Felix Herrmann, Geir Amdal, spider-mario, benabik, timotimo, TimToady If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#52) is scheduled for May 17, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release. have fun, and let us know about your experience. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.050000644000175000017500000000610113253717231015112 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #52 ("MadMongers") On behalf of the Rakudo development team, I'm glad to announce the May 2012 release of Rakudo Perl #52 "MadMongers". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The May 2012 release is code named after MadMongers. This release includes a whole lot of changes since the last one, including: * -I and -M command-line options * support for non-Int enums * 'use' now accepts positional arguments and is able to import by tag name * 'import' now works * basic support for Version literals * %*ENV now propagates into subprocesses * basic implementation of pack and unpack ported from 'ng' branch * fff flip-flop operator is now implemented, ff has been improved * various new regex features and improvements Rakudo now also includes the lib.pm module. This is only a small peek at the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Jonathan Worthington, Patrick R. Michaud, Jonathan Scott Duff, Tadeusz Sośnierz, Carl Masak, Will "Coke" Coleda, Marcus Ramberg, kboga, TimToady, Kyle Hasselbacher, Geir Amdal, JimmyZ, benabik and gfldex. If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#53) is scheduled for June 21, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release. Have fun, and let us know about your experience. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.060000644000175000017500000000565013253717231015123 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #53 ("Strasbourg") On behalf of the Rakudo development team, I'm glad to announce the June 2012 release of Rakudo Perl #53 "Strasbourg". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The June 2012 release is code named after Strasbourg, the location of the French Perl Workshop 2012. This release includes a lot of changes since the last one, including: * Longest-Token Matching for | alternations in regexes * Stricter numification of strings (fails if the string does not represent a number) * 'require' now allows argument lists * Faster .map / list handling * Improvements to typed exceptions This is only a small peek at the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Contributors to Rakudo since the release on 2012-05-17: Moritz Lenz, Jonathan Worthington, Patrick R. Michaud, kboga, Jonathan Scott Duff, Tadeusz Sośnierz, Carl Masak, Geoffrey Broadwell, diakopter, Solomon Foster, JimmyZ, TimToady If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#54) is scheduled for July 19, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release. Have fun, and let us know about your experience. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.070000644000175000017500000000575413253717231015131 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #54 ("Tallinn") On behalf of the Rakudo development team, I'm glad to announce the July 2012 release of Rakudo Perl #54 "Tallinn". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The July 2012 release is code-named after Tallinn, a fine old capital where jnthn and masak had much useful discussions about Perl 6 macro design last year. This release includes a lot of changes since the last one, including: - Built-in meta-objects (e.g. Metamodel::ClassHOW) now inherit from Any - &open now supports :enc/:encoding - Changed &dir to return IO::Path objects, not strings - Deprecated .bytes, .ucfirst, and .lcfirst on Str - recognize obosolete rand() and rand(N) forms at compile time - anonymous subset types 'subset :: of Int where { $_ > 0 }' This is only a small peek at the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Patrick R. Michaud, Moritz Lenz, Jonathan Worthington, Jonathan Scott Duff, Carl Mäsak, ronaldxs, Felix Herrmann, harmil, Gabor Szabo, sisar If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#55) is scheduled for August 23, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.080000644000175000017500000000733613253717231015130 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #55 ("Frankfurt") On behalf of the Rakudo development team, I'm glad to announce the August 2012 release of Rakudo Perl #55 "Frankfurt". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The August 2012 release is code-named after Frankfurt.pm, the group that hosted this year's YAPC::Europe conference in Frankfurt am Mein. This release brings a massive amount of changes; some of them are outlined below: - Memory usage of build stage is reduced by 35% - 40% - Sigilless variables in signatures (prefixed by | or \) - Blocks that declare variables don't turn into hash constuctors anymore - Better error reporting for traits - --> ReturnType in signatures and prefix type constraints of routine return types are now honored - Circularities in module loading are now detected - Improvements in inliner, which allow it to inline a wider range of routines Some features have been deprecated: - Parameters preceeded by a | or \ may not have a sigil anymore. sub f(\$x) { say $x } must be changed to sub f(\x) { say x } Usage of \$x will unconditionally warn in 2012.09 and be removed in 2012.10 - IO::Path.dir (which returns the directory part of the path) has been renamed to IO::Path.directory. IO::Path.dir will be removed or re-purposed in 2012.09 - The LAZY statement prefix will be removed in 2012.09. It was a non-specced experiment and did not work out well. This is only a small peek at the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Arne Skjærholt, Geoffrey Broadwell, Will "Coke" Coleda, Tadeusz Sośnierz, Patrick R. Michaud, Felix Herrmann, Carl Mäsak, kboga, thou, Brian Gernhardt, Stefan O'Rear, GlitchMr, ChoHag, Larry Wall and lumi_ If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#56) is scheduled for September 20, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.090000644000175000017500000000634513253717231015130 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #56 ("Perl") On behalf of the Rakudo development team, I'm thrilled to announce the September 2012 release of Rakudo Perl #56 "Perl". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The September 2012 release is code-named after Perl.pm, a group located in scenic Perl in Saarland, Germany, where an important meetup took place on August 16th-19th concerning the reunification of Perl 5 and Perl 6. This release brings changes; some of them are outlined below: - basic macro unquoting - basic support for m:P5/.../ regexes - support for indirect type names in routine and type declarations - support for "is export" traits on constants - Str.wordcase implemented - slightly faster compilation (thanks to switching NQP over to QAST) - tie-breaking with constraints now picks the first matching one rather than demanding they be mutually exclusive A possibly breaking change: - class Iterable does not inherit from class Cool anymore This is only a small peek at the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Carl Mäsak, Salve J. Nilsen, Patrick R. Michaud, Gerhard R, Tadeusz Sośnierz, Will "Coke" Coleda, Geoffrey Broadwell, diakopter, PerlJam, cognominal, Larry Wall If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#57) is scheduled for October 18, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.09.10000644000175000017500000000624113253717231015262 0ustar alexalex Announce: Rakudo Perl 6 compiler development release 2012.09.1 On behalf of the Rakudo development team, I'm announcing an out-of-schedule release of the Rakudo Perl 6 compiler. Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . This release is a point release in addition to the regular, monthly releases. Rakudo 2012.09 (no .1) required Parrot 4.8.0, which was recently discovered to have some unfortunate regressions in standard input/output buffering for many environments. This interim release restores the compiler back to using Parrot 4.4.0 to allow more time to resolve I/O issues. This also means we revert to 2012.08's version of socket encoding (where sockets all assume utf8 encoding of data), but this reversion is considered of lesser harm than the regressions in standard I/O. Other changes since the 2012.09 release are also included in this point release: - add 'is-prime' and 'expmod' operations - enable smart matching against Signature literals - enable binding to signatures in declarators - add the 'is hidden' and base traits - temporarily remove the ability to change socket encodings (reverts to 2012.08's behavior) Both 2012.09 and 2012.09.1 contain a possibly breaking change from 2012.08: - class Iterable does not inherit from class Cool anymore This is only a small peek at the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Patrick R. Michaud, Jonathan Scott Duff, Solomon Foster If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#57) is scheduled for October 18, 2012. A list of the other planned release dates and code names for 2012 is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.100000644000175000017500000000556213253717231015120 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #57 ("Tokyo") On behalf of the Rakudo development team, I'm thrilled to announce the October 2012 release of Rakudo Perl #57 "Tokyo". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The October 2012 release is code-named after Tokyo.pm, hosts of YAPC::Asia 2012. This release brings changes; some of them are outlined below: - delegation to methods using the handles trait - improved handling of :P5 regexes - reduced memory usage for Match objects - each REPL line no longer implies a fresh GLOBAL - import of custom meta-objects only affects the scope they are imported into - can now parse nested pairs of quote delimeters, like q{ foo q{ bar } baz } This is only a small peek at the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Patrick R. Michaud, Solomon Foster, diakopter, Timothy Totten If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#58) is scheduled for November 22, 2012. A list of the other planned release dates and code names for future releases is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.110000644000175000017500000000601313253717231015111 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #58 ("Walnut") On behalf of the Rakudo development team, I'm thrilled to announce the November 2012 release of Rakudo Perl #58 "Walnut". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The November 2012 release is code-named after Walnut, home of "Yet Another Society" aka "The Perl Foundation". This release brings changes; some of them are outlined below: + implemented precedence related traits (equiv, looser, tighter, assoc) + Perl 6 grammar NFAs are pre-computed, saving some work on each invocation; this shaved around 10% off the time needed to run the spectests + regexes and quotes have better support for user-selected delimiters + heredocs + FIRST/NEXT/LAST can now be used in all types of loop (previously limited to for) This is only a small peek at the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Carl M�sak, Jonathan Scott Duff, Will "Coke" Coleda, Tobias Leich, Geoffrey Broadwell, Nicholas Clark, Konrad Borowski, flussence If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#59) is scheduled for December 20, 2012. A list of the other planned release dates and code names for future releases is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2012.120000644000175000017500000000644413253717231015122 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #59 ("Warszawa") On behalf of the Rakudo development team, I'm proud to announce the December 2012 release of Rakudo Perl #59 "Warszawa". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The December 2012 release is code-named after Warszawa, home of Tadeusz Sośnierz (tadzik), whose contributions to Rakudo and the Perl 6 ecosystem during 2012 have been significant. Some of the changes in this release are outlined below: + The .indent method now has better handling of empty lines + Parse errors are much improved, and follow STD, the standard parser, much more closely; they are more accurate and more information is given + Rakudo now keeps parsing after some less serious errors + Better errors for various parse failures + The junction autothreader is now an order of magnitude faster + Texas versions of the Set and Bag operators implemented + Nested Pairs now give correct .perl output + { a => $_ } now correctly considered a block, not a hash as before This is only a small subset of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Tobias Leich, Solomon Foster, Timo Paulssen, Will "Coke" Coleda, Patrick R. Michaud, Amir E. Aharoni, Carl Mäsak, Geoff Broadwell, Shrivatsan Sampathkumar If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#60), assuming the world doesn't end today, is scheduled for January 17, 2013. A list of the other planned release dates and code names for future releases is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.010000644000175000017500000000705213253717231015115 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #60 ("Sonoma") On behalf of the Rakudo development team, I'm proud to announce the January 2013 release of Rakudo Perl #60 "Sonoma". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The January 2013 release is code-named after Sonoma.pm, home of Geoff Broadwell (japhb), whose contributions to Rakudo and the Perl 6 ecosystem during 2012/2013 have been significant. Some of the changes in this release are outlined below: + sink context; for-loops are now lazy by default + first mentioning a variable from outer scope and then redeclaring it in the same scope (my $a; { $a; my $a }) is now an error. + the long-deprecated "SAFE" setting has been removed + 'require' now works with indirect module names + restored socket read semantics to returning the requested number of bytes + $obj.Some::Role::meth() now passes the correct $obj + try/CATCH now returns Nil when the CATCH is triggered, rather than the exception; this brings it in line with try without a CATCH + whatever-star cases of splice now implemented + sequences with Junction endpoints now work + corrected precedence of various set operators + fixed binding of non-Any things into hashes and arrays + can now import multis with the same name from different modules, provided all dispatchers are onlystar This is only a small subset of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Moritz Lenz, Carl Masak, Tobias Leich, Shrivatsan Sampathkumar If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#61), is scheduled for February 21, 2013. A list of the other planned release dates and code names for future releases is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. (And, have a good laugh at conspiracy theorists for their doomed end-of-world predictions!) [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.020000644000175000017500000000610513253717231015114 0ustar alexalex Announce: Rakudo Perl 6 compiler development release #61 ("drinkers") On behalf of the Rakudo development team, I'm proud to announce the February 2013 release of Rakudo Perl #61 "drinkers". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[*] -- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The February 2013 release is code-named after drinkers.pm, as even a camel needs to have a drink from time to time. Some of the changes in this release are outlined below: + "Did you mean ..." suggestions for symbol-not-found errors + Compile-time optimization of some cases of junctions in boolean context + IO::Socket.get now works again with non-Unicode characters + constant folding for routines marked as 'is pure' + natively typed variables and better error reporting in the REPL + speed up eqv-comparison of Bufs + warnings for useless use of (some) literals, variables and constant expressions in sink context This is only a small subset of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Timo Paulssen, Moritz Lenz, Jonathan Worthington, Tobias Leich, Arne Skjærholt, Carl Mäsak, Tadeusz Sośnierz, Will Coleda, Christoph Otto and Solomon Foster. If you would like to contribute, see , ask on the perl6-compiler@perl.org mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#62), is scheduled for March 21, 2013. A list of the other planned release dates and code names for future releases is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [*] What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.03.md0000644000175000017500000000602713253717231015517 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #62 ("Singapore") On behalf of the Rakudo development team, I'm proud to announce the March 2013 release of Rakudo Perl #62 "Singapore". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^1] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The March 2013 release is code-named after Singapore.pm. Some of the changes in this release are outlined below: * Rakudo warns when pure expressions are used in sink context * .substr(...) now correctly accepts whatever-star closures * Implemented shellwords postcircumfix (%h<< $x 'foo bar' >>) * Defining operators spelled like the empty string is now illegal * Array interpolations now properly do LTM * Autothread "none" and "all" junctions before "any" and "one" * Helpful error if you write "else if"/"elif" instead of "elsif" * Throw exception if a Range is used as a Range endpoint * Corrected argument order in IO.seek This is only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, kboga, Tobias Leich, Moritz Lenz, Patrick R. Michaud, Timo Paulssen, Carl Mäsak, Tadeusz Sośnierz, Gerhard R, thundergnat, TimToady If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#63), is scheduled for April 18, 2013. A list of the other planned release dates and code names for future releases is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [^1]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.04.md0000644000175000017500000000551013253717231015514 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #63 ("Albany") On behalf of the Rakudo development team, I'm proud to announce the April 2013 release of Rakudo Perl #63 "Albany". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^1] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The April 2013 release is code-named after Albany.pm. Some of the changes in this release are outlined below: * wrap low level VM objects in ForeignCode, allowing perl6 OO calls on them * for loops are eager again * add link and symlink to IO * add Capture.Bool() * improvements to DUMP() * various optimizations in the optimizer and the runtime * smartmatch against list now supports Whatever wildcards This is only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Geoffrey Broadwell, Jonathan Worthington, Moritz Lenz, Tobias Leich, Timo Paulssen, Will "Coke" Coleda, Carl Masak, Rob Hoelz, Tadeusz Sośnierz, Carl Mäsak, Brent Laabs, diakopter If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#64), is scheduled for May 23, 2013. A list of the other planned release dates and code names for future releases is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release. Take a deep breath. Write some new code. Don't forget to be awesome. [^1]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.05.md0000644000175000017500000000650313253717231015520 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #64 ("Austin") On behalf of the Rakudo development team, I'm proud to announce the May 2013 release of Rakudo Perl #64 "Austin". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ). The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^1] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The May 2013 release is code-named after Austin.pm. You'll see that this release is pure destiny. Its release number is 2**6, its codename has 6 chars, it is named after the place where the next YAPC::NA will happen on the sixth month of this year, a year with a crossfoot of 6. Some of the changes in this release are outlined below: * IO::Spec, a port of Perl 5's File::Spec * speedup of repeated shifts of large lists and arrays by 70%+ * regex special characters can be used as delimiters * allow slice with :exists adverb on hashes * fix regex interpolation slowdown * fix exporting of subroutines * fix reporting of errors in gather/take. * added 125 extra opening/closing bracket-pairs * fix build failure on SPARC and PowerPC * underlying nqp layer supports parrot and JVM as backend, in preparation for JVM support in a future Rakudo release This is only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Brent Laabs, Moritz Lenz, Patrick R. Michaud, Tobias Leich, Jonathan Worthington, Will "Coke" Coleda, Elizabeth Mattijsen, dagurval, Carl Mäsak, Solomon Foster, Larry Wall, Tadeusz Sośnierz, Timo Paulssen, Arne Skjærholt, Timothy Totten If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#65), is scheduled for June 20, 2013. A list of the other planned release dates and code names for future releases is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release. Take a deep breath. Write some new code. Don't forget to be awesome. [^1]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.06.md0000644000175000017500000000622313253717231015520 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #65 ("Poznan") On behalf of the Rakudo development team, I'm proud to announce the June 2013 release of Rakudo Perl #65 "Poznan". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ) and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^1] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The June 2013 release is code-named after Poznan.pm, a mongers group that was founded after two Perl developers visiting this year's PLPW realized they lived in the same city. Some of the changes in this release are outlined below: + JVM backend added - passes initial sanity tests + type captures in signature binder implemented + IO::Handle methods gist, perl, path added + Int.msb and Int.lsb implemented + dir() is now lazy + $/ and $! now visible in eval/REPL + .{} adverb combinations all implemented + &first now returns Nil instead of failing + IO::Path.chmod implemented + Cool.path implemented + div and / fail with X::Numeric::DivisionByZero (rather than dying) This is only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Elizabeth Mattijsen, Stefan O'Rear, Brent Laabs, Tobias Leich, Timo Paulssen, Patrick R. Michaud, Will "Coke" Coleda, Moritz Lenz, thundergnat, Carl Mäsak, dagurval, bbkr If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#66), is scheduled for July 18, 2013. A list of the other planned release dates and code names for future releases is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [^1]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.07.md0000644000175000017500000000600213253717231015514 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #66 ("Edinburgh") On behalf of the Rakudo development team, I'm proud to announce the July 2013 release of Rakudo Perl #66 "Edinburgh". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ) and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^1] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The July 2013 release is code-named after Edinburgh.pm, 'twas there that a now core hacker lived when he got involved with Perl 6. Some of the changes in this release are outlined below: + Huge progress in JVM backend (feature-wise almost on par with Parrot) + fixed handling of indented heredocs + basic support for threads and promises (JVM only) + implemented canonpath for Win32 IO::Spec + implemented squish + made []:(kv|p|k|v) work according to spec These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Elizabeth Mattijsen, Stefan O'Rear, Timo Paulssen, Solomon Foster, Brent Laabs, Tobias Leich, Will "Coke" Coleda, Carl Masak, Moritz Lenz, Donald Hunter, Stéphane Payrard, Patrick R. Michaud, Tadeusz Sośnierz, Larry Wall, GlitchMr If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#67), is scheduled for August 22, 2013. A list of the other planned release dates and code names for future releases is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [^1]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.08.md0000644000175000017500000000633213253717231015523 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #67 ("Bicycle") On behalf of the Rakudo development team, I'm proud to announce the August 2013 release of Rakudo Perl #67 "Bicycle". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine (see ) and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^1] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The August 2013 release is code-named after Bicycle.pm, probably the Perl Mongers group with the coolest t-shirts. Some of the changes in this release are outlined below: + "is default", "is dynamic", "of" and "will" traits on variables + assigning Nil restores the default value + CALLER::<$var> now only works on dynamic variables, as per spec. + improvements to concurrency/parallelism support, including Channel, select, KeyReducer and basic asynchronous file reading (JVM only) + "once" phaser implemented + reimplementation of Buf as a role, and addition of Blob and other sized Buf/Blob related types + ConfigureJVM.pl now takes --gen-nqp, easing the Rakudo on JVM build + printf now correctly handles big integers These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Elizabeth Mattijsen, Jonathan Worthington, Moritz Lenz, Donald Hunter, Tobias Leich, Timo Paulssen, Solomon Foster, Tadeusz Sośnierz, Marton Papp, ivanoff, TimToady, Mouq, Patrick R. Michaud, awwaiid If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#68), is scheduled for September 19, 2013. A list of the other planned release dates and code names for future releases is available in the "docs/release_guide.pod" file. In general, Rakudo development releases are scheduled to occur soon after each Parrot monthly release. Parrot releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [^1]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.09.md0000644000175000017500000000563513253717231015531 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #68 ("Shanghai") On behalf of the Rakudo development team, I'm proud to announce the September 2013 release of Rakudo Perl #68 "Shanghai". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^1] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The September 2013 release is code-named after Shanghai.pm, a Perl Mongers group in a city visited by at least two Rakudo core developers. Some of the changes in this release are outlined below: + candidate argument to bless removed (per spec change) + @a.VAR.name and %h.VAR.name implemented + The $var.++ and $var.() syntaxes work + tr/// implemented + Sockets on JVM implemented These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Elizabeth Mattijsen, Moritz Lenz, Donald Hunter, Tobias Leich, Jonathan Worthington, Carl Mäsak, Geoffrey Broadwell, Paweł Murias, Solomon Foster, Will "Coke" Coleda, Dagur Valberg Johannsson, Tadeusz Sośnierz, BenGoldberg, GlitchMr, Mouq, timotimo If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#69), is scheduled for October 17, 2013. 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 occurs soon after each Parrot monthly release is scheduled to occur. Parrot usually releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, to live life to its fullest, to cherish each moment, and to have fun. [^1]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.10.md0000644000175000017500000000603513253717231015514 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #69 ("Roederbergweg") On behalf of the Rakudo development team, I'm happy to announce the October 2013 release of Rakudo Perl #69 "Roederbergweg". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^1] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The October 2013 release is code-named after Roederbergweg.pm, a Perl Mongers group very near the recent Perl 6 Internals Workshop Some of the changes in this release are outlined below: + postcircumfix {} and [] are now implemented as multi subs rather than multi methods. This should allow for better optimization in the future. + Add support for "is deprecated", making it easy for early adopters to stay current. + Track multiple spec changes for various container classes. + Greatly reduce object creation during Regex parsing. + Various portability fixes. These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Arne Skjærholt, Timo Paulssen, Carl Masak, Moritz Lenz, Tobias Leich, Alexander Moquin, Patrick R. Michaud, Elizabeth Mattijsen, grondilu, Jonathan Scott Duff, Will "Coke" Coleda If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#70), is scheduled for November 21, 2013. 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 occurs soon after each Parrot monthly release is scheduled to occur. Parrot usually releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, step out of your comfort zone, and get a library card. [^1]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.11.md0000644000175000017500000000624113253717231015514 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #70 ("Malmö") On behalf of the Rakudo development team, I'm happy to announce the November 2013 release of Rakudo Perl #70 "Malmö". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^1] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The November 2013 release is code-named after Malmö, from which this release has been launched. Some of the changes in this release are outlined below: + Many concurrency primitives harmonized with new S17, but still pretty fluid + Refactored build system that allows building rakudo on rakudo/JVM in the same place + Order::Increase/Decrease are deprecated. Please use Order::Less/More. + Leading whitespace is ignored for :sigspace + Better null pattern detection in regexes + improved run()/shell(), these return Proc::Status-objects now + The "gethostname" function implemented + Performance optimization: unfold junctions in 'when' clauses + various other bug fixes, optimisations and additional tests These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Moritz Lenz, Tobias Leich, Jonathan Worthington, Timo Paulssen, Will "Coke" Coleda, Mouq, Brian Gernhardt, Arne Skjærholt, L. Grondin, Geoffrey Broadwell, Steve Mynott, Andrew Egeler, Elizabeth Mattijsen If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#71), is scheduled for December 19, 2013. 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 occurs soon after each Parrot monthly release is scheduled to occur. Parrot usually releases the third Tuesday of each month. On behalf of the development team, I encourage you to try the new release, step out of your comfort zone, and get a library card. [^1]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2013.12.md0000644000175000017500000000552613253717231015522 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #71 ("Advent") On behalf of the Rakudo development team, I'm happy to announce the December 2013 release of Rakudo Perl #71 "Advent". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^1] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The December 2013 release is code-named after Advent, the non-geographical group which fits this time of year. Some of the changes in this release are outlined below: + The Whatever Star now works inside chain operators like comparisons + Private attributes from roles are now visible in the classes they apply to + Use invokedynamic in some places on the JVM. + Memory improvements in ListIter + Faster method List.combinations + Simple lookahead assertions in regexes are optimized + Regexes do less superfluous scanning These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Elizabeth Mattijsen, Timo Paulssen, Jonathan Worthington, Moritz Lenz, Tobias Leich, Larry Wall, Carl Mäsak If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#72), is scheduled for January 23, 2014. 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. On behalf of the development team, I encourage you to try the new release, step out of your comfort zone, and get a library card. [^1]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.01.md0000644000175000017500000000706113253717231015515 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #72 ("Plano") On behalf of the Rakudo development team, I'm happy to announce the January 2014 release of Rakudo Perl #72 "Plano". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine, the Java Virtual Machine and the Moar Virtual Machine[^1]. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. The January 2014 release is code-named after Plano, because that suggestion was way better than "Three Blind Mice". hm, so what should we name this release... Fred Three Musketeers Three Stooges Three Blind Mice Three Little Pigs ... maybe we should name it Plano because that implies at least three dimensions oooh! +1 TimToady++ Some of the changes in this release are outlined below: + `Numeric.narrow` to coerce to narrowest type possible + Can now supply blocks with multiple arguments as sequence endpoints + The `eval` sub and method are now spelled `EVAL` + Method calls and hash/list access on `Nil` give `Nil` + Added support for MoarVM; passes >99% of the spectests that Rakudo JVM does + Implement more parts of `NativeCall` for the JVM + Fixed gather/take stack overflow bug in JVM backend These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite and the specification. The following people contributed to this release: Jonathan Worthington, Tobias Leich, Timo Paulssen, Moritz Lenz, Will "Coke" Coleda, Brian Gernhardt, Carl Masak, Rob Hoelz, Geoffrey Broadwell, Kevan Benson, Solomon Foster, grondilu, diakopter, Elizabeth Mattijsen, Mouq, Jonathan Scott Duff, Tadeusz Sośnierz, lue If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#73), is scheduled for February 20, 2014. 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. On behalf of the development team, I encourage you to enjoy the new release, try awesome stuff, and get back to us with feedback. [^1]: See and [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.02.md0000644000175000017500000000625713253717231015524 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #73 ("Karlsruhe.pm") On behalf of the Rakudo development team, I'm happy to announce the February 2014 release of Rakudo Perl 6 #73 "Karlsruhe.pm". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine, the Java Virtual Machine and the Moar Virtual Machine[^1]. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This time it's the Perl Mongers group of Karlsruhe, Germany - where Timo Paulssen has been advertising Perl 6 to the other group members incessantly. Some of the changes in this release are outlined below: + The JVM now has full NativeCall support based on JNA. + The core of Rakudo::Debugger is now part of Rakudo itself and works across all backends. + "make" no longer itemizes its arguments. + for-loops at the statementlist level are now sunk by default. + better parsing of unspaces and formatting codes inside Pod blocks. + lots of improvements to the MoarVM backend including sockets and pipe opening. These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Jonathan Worthington, Tobias Leich, Mouq, Moritz Lenz, Timo Paulssen, Carl Masak, Larry Wall, Rob Hoelz, Jonathan Scott Duff, Matthew Wilson, Pepe Schwarz, Will "Coke" Coleda, Steve Mynott, raydiak, Geoffrey Broadwell, itz_, and Nicholas Clark. If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#74), is scheduled for March 20, 2014. 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. On behalf of the development team, I encourage you to enjoy the new release, try awesome stuff, have the appropriate amount of fun, and get back to us with feedback. [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.03.md0000644000175000017500000000557713253717231015531 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #74 ("Adelaide.pm") On behalf of the Rakudo development team, I'm happy to announce the March 2014 release of Rakudo Perl 6 #74 "Adelaide.pm". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine, the Java Virtual Machine and the Moar Virtual Machine[^1]. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This time it's the Perl Mongers group of Adelaide. Some of the changes in this release are outlined below: + Fix for for-loops to be properly lazy + uniname, uniprop, and unival implemented on MoarVM backend + Numerous Pod parsing and formatting improvements + @ as shortcut for @$, % as shortcut for %$ + list infix reductions no longer flatten + Numerous compiler suggestion improvements These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Larry Wall, Alexander Moquin, Elizabeth Mattijsen, lue, Tobias Leich, Jonathan Worthington, Will "Coke" Coleda, Moritz Lenz, Arne Skjærholt and Reini Urban. If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#75), is scheduled for April 17, 2014. 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. On behalf of the development team, I encourage you to enjoy the new release, try awesome stuff, have the appropriate amount of fun, and get back to us with feedback. [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.04.md0000644000175000017500000000607413253717231015523 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #75 ("Echt") On behalf of the Rakudo development team, I'm happy to announce the April 2014 release of Rakudo Perl 6 #75 "Echt". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine, the Java Virtual Machine and the Moar Virtual Machine[^1]. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This time it's the Perl Mongers group of Echt, who held their first meeting in about five years the other day. Some of the changes in this release are outlined below: + NativeCall passes all its tests on all backends + significant performance enhancement for MoarVM, spectest running 20%+ faster + S17 (concurrency) now in MoarVM (except timing related features) + winner { more @channels { ... } } now works + implemented univals(), .unival and .univals (on MoarVM) + added .minpairs/.maxpairs on (Set|Bag|Mix)Hash + Naive implementation of "is cached" trait on Routines These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Jonathan Worthington, Tobias Leich, Moritz Lenz, Carl Mäsak, Tadeusz Sośnierz, Nami-Doc, David Warring, Alexander Moquin, Timo Paulssen, lue, Donald Hunter, Andrew Egeler If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#76), is scheduled for May 22, 2014. 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. On behalf of the development team, I encourage you to enjoy the new release, try awesome stuff, have the appropriate amount of fun, and get back to us with feedback. [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.05.md0000644000175000017500000000731513253717231015523 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #76 ("Bajor") On behalf of the Rakudo development team, I'm happy to announce the May 2014 release of Rakudo Perl 6 #76 "Bajor". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine, the Java Virtual Machine and the Moar Virtual Machine[^1]. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. I am sure there is a Perl Monger meeting in the Rakantha Province at the time of this writing. Some of the changes in this release are outlined below: + added or updated many Supply methods: act, batch, categorize, Channel, classify, delay, elems, flat, grab, last, live, max, min, minmax, merge, migrate, Promise, reduce, reverse, rotor, sort, squish, stable, start, uniq, wait, zip + added IO::Notification.watch_path / IO::Path::watch which return a Supply of file system changes + added IO::Socket::Async.connect, .send, .chars_supply + added first-index, last-index, grep-index subs/methods + deprecate $*OS, $*OSVER, $*VM, $*VM, $*PERL $*PERL... + added $*KERNEL, $*DISTRO, $*VM, $*PERL as full blown objects + .delta (by recent spec change) in Date/DateTime now instead spelled .later and .earlier + TimeUnit enum removed; string named and positional arguments used instead + "use v5" is no longer a noop, but actually tries to load the "v5" module (soon available as part of Rakudo*) + implemented labeled loops and throwing of labels as payload + added various optimizations, like optimizing out %_ when unused These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Jonathan Worthington, Tobias Leich, Alexander Moquin, Moritz Lenz, Donald Hunter, Carl Masak, Timo Paulssen, lue, Tim Smith, Geoffrey Broadwell, Larry Wall, Filip Sergot, David Warring, Andrew Egeler, Jonathan Scott Duff, Solomon Foster If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#77), is scheduled for June 19, 2014. 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. On behalf of the development team, I encourage you to enjoy the new release, try awesome stuff, have the appropriate amount of fun, and get back to us with feedback. [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.06.md0000644000175000017500000000640513253717231015523 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #77 ("Gdańsk") On behalf of the Rakudo development team, I'm happy to announce the June 2014 release of Rakudo Perl 6 #77 "Gdańsk". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine, the Java Virtual Machine and the Moar Virtual Machine[^1]. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. We hope there is a Perl Mongers group in Gdańsk after meeting Perl developers from Gdańsk during the PLPW this year. They proposed to organize PLPW next year. Some of the changes in this release are outlined below: + an initial implementation of S11 (Compilation Units) is now available + $*DISTRO now works correctly on OS X (with name "macosx") + $*KERNEL now works correctly on OS X (with name "darwin") + initial implementation of $*USER and $*GROUP + IO::Socket::Async now also works on JVM + optimization: + .IO.{d,s,z} are now about 40% faster and return Failure if path doesn't exist + :a(:$b) and attributive binding + IO::Path.contents + push, unshift and comb + say, note + no-args case of @foo>>.bar + implement :42nd colonpair syntax These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Tobias Leich, Jonathan Worthington, Timo Paulssen, Donald Hunter, Pepe Schwarz, Moritz Lenz, Alexander Moquin, Filip Sergot, Rob Hoelz, Reini Urban, Geoff Broadwell If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#78), is scheduled for July 17, 2014. 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. On behalf of the development team, I encourage you to enjoy the new release, try awesome stuff, have the appropriate amount of fun, and get back to us with feedback. [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.07.md0000644000175000017500000000677213253717231015533 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #78 ("Sofia") On behalf of the Rakudo development team, I'm happy to announce the July 2014 release of Rakudo Perl 6 #78 "Sofia". Rakudo is an implementation of Perl 6 on the Parrot Virtual Machine, the Java Virtual Machine and the Moar Virtual Machine[^1]. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This release is named after Sofia, the city where the YAPC::EU will take place in a little bit more than a month. Some of the changes in this release are outlined below: + Cool.eval and eval() are now removed + assigning a single itemized hash to a hash is now DEPRECATED (my %h = {...}) + .hash now turns an itemized hash into a hash + subbuf-rw specced and implemented + minute value is optional in Timezone offsets in DateTime.new(), also a colon to delimit hours/minutes is now optional + the tr/// operator is implemented and has the proper return value + improved string handling for MoarVM backend + re-arranged infixish actions to support [[*]]= etc + all backends now allow C pointer arithmetic and casting of pointers to Perl 6 types (this funtionality is exposed by NativeCall) + fixed 'fail' so it also prints a backtrace + removed hack for $Inf/$NaN: constants Inf/NaN are exposed since a while + made initial/max threads introspectable + make .WHICH also work on type objects These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Jonathan Worthington, Tobias Leich, Timo Paulssen, Filip Sergot, Carlin, Will Coleda, Pepe Schwarz, Will Coleda, Carl Masak, Alexander Moquin, Andrew Egeler, Jonathan Scott Duff, Moritz Lenz If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#79), is scheduled for August 21, 2014. 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. On behalf of the development team, I encourage you to enjoy the new release, try awesome stuff, have the appropriate amount of fun, and get back to us with feedback. [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.08.md0000644000175000017500000000640313253717231015523 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #79 ("Minsk") On behalf of the Rakudo development team, I'm happy to announce the August 2014 release of Rakudo Perl 6 #79 "Minsk". Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1], the Java Virtual Machine and the Parrot Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This release is named after Minsk, the capital and largest city of Belarus. Some of the changes in this release are outlined below: + Many optimizations in both rakudo and the underlying VMs. + remove speed penalty of large ranges in character classes + quote words syntax \ splits on breakable space only + Add HyperWhatever / ** + ∅ is finally recognized as the empty set + If the LOLLY envar is set, have (;;), [;;], etc., turn into LoLs. Otherwise, parsefail + Add SEQ(a; b) to emulate the old behavior of (a; b) + Make &infix:\ many times faster + NaN === NaN (but still NaN != NaN) + fix multi-dimensional slice assignment + can now call exit() in END blocks without hanging or affecting END block execution These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Tobias Leich, Jonathan Worthington, Alexander Moquin, Larry Wall, Rob Hoelz, Jonathan Scott Duff, Will "Coke" Coleda, Timo Paulssen, Pepe Schwarz, Moritz Lenz, Carlin, sergot, Carl Mäsak, Geoff Broadwell If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#80), is scheduled for September 18, 2014. 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. On behalf of the development team, we encourage you to enjoy the new release, try awesome stuff, have the appropriate amount of fun, and get back to us with feedback. [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.09.md0000644000175000017500000000650013253717231015522 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #80 ("HongKong") On behalf of the Rakudo development team, I'm happy to announce the September 2014 release of Rakudo Perl 6 #80 "HongKong". Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1], the Java Virtual Machine and the Parrot Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This release is named after Hong Kong, where two Rakudo developers found themselves this month, sketching out an escape analysis implementation, eating delicious food, and looking at the pretty city blinkenlights by night. Some of the changes in this release are outlined below: + ./perl6 --profile for MoarVM + Workaround OS X make bug for MoarVM + support for submethod DESTROY (MoarVM only) + optimizations to Str.words, Str.lines, IO.lines, chomp, and return + added experimental support for Proc::Async, MoarVM only for now + Reduced memory size of CORE.setting, improved startup time + startup (on Moar) 15% faster than p5 w/ Moose These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Rob Hoelz, Larry Wall, Tobias Leich, Moritz Lenz, Jonathan Worthington, Will "Coke" Coleda, Alexander Moquin, Jonathan Scott Duff, Carl Masak, Steve Mynott, Timo Paulssen, usev6, leont, carlin, Geoff Broadwell, Solomon Foster, brrt If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#81), is scheduled for October 23, 2014. 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. The development team appreciates feedback! If you're using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list of IRC channel. Enjoy! [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.10.md0000644000175000017500000000711013253717231015510 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #81 ("Linz") On behalf of the Rakudo development team, I'm happy to announce the Octover 2014 release of Rakudo Perl 6 #81 "Linz". Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1], the Java Virtual Machine and the Parrot Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This release is named after Linz, because I really wanted to name this release "Salzburg" where the Austrian Perl Workshop was recently held, but there's no Salzburg.pm and Linz.pm was the closest Austria Perl Mongers group. :) Some of the changes in this release are outlined below: - strict pragma implemented and turned off for one-liners - Method form of .exists and .delete have finally been removed - Supply.lines/words and IO::Handle.words implemented, Str.words now lazy - Scoped directory manipulation: indir, tmpdir, homedir - Better deprecation messages - Various performance improvements These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". This is last release of Rakudo to support parrot without ICU. Future versions of Rakudo will require ICU support in the Parrot backend. Note: while this release does not require ICU support in Parrot, some tests in the standard Perl 6 test suite will nonetheless fail without it. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Jonathan Worthington, Tobias Leich, Moritz Lenz, Jonathan Scott Duff, Christian Bartolomäus, Brad Gilbert, Solomon Foster, Larry Wall, Pepe Schwarz, Timo Paulssen, Mikhail Khorkov, Will "Coke" Coleda, abraxxa, skids, Rob Hoelz, leont, laben, Patrick R. Michaud If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#82), is scheduled for November 20, 2014. 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. The development team appreciates feedback! If you're using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list of IRC channel. Enjoy! [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.11.md0000644000175000017500000000742013253717231015515 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #82 ("Helsinki") On behalf of the Rakudo development team, I'm happy to announce the November 2014 release of Rakudo Perl 6 #82 "Helsinki". Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1], the Java Virtual Machine and the Parrot Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This release is named after Helsinki, in honour of the organizers of the Nordic Perl Workshop. Some of the changes in this release are outlined below: - Method 'for' as an alias for 'map'. Map will stop flattening the list eventually, 'for' remains as it is now. - Method 'unique' as a successor for 'uniq' - Introduce IO::Handle.slurp-rest for slurping rest from handle - Using a constant negative subscript now dies at compile time - Better wording for runtime negative index failure - Force calling method for <.foo> even if sub foo exists - Fix tie-breaking issues with longest literal matching - Various performance improvements and bugfixes These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". A note for OS X users: when running a spectest with a high number of parallel tests (e.g. with TEST_JOBS=8), it is likely you will see any number between 0 and 10 test-files with failures, usually because they abort midway through testing. Running these test-files then by themselves, shows no errors whatsoever. Current theory is that something in the MoarVM build on OS X is introducing random memory corruption. Any thoughts / suggestions / fixes will be deeply appreciated. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Tobias Leich, Larry Wall, Jonathan Scott Duff, Timo Paulssen, Alexander Moquin, Moritz Lenz, Steve Mynott, Christian Bartolomäus, Carl Mäsak, Pepe Schwarz, Rob Hoelz, Reini Urban, Geoff Broadwell, [Coke] If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#83), is scheduled for 18 December 2014. 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. The development team appreciates feedback! If you're using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list of IRC channel. Enjoy! [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2014.12.md0000644000175000017500000000777113253717231015527 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #83 ("Cologne") On behalf of the Rakudo development team, I'm happy to announce the December 2014 release of Rakudo Perl 6 #83 "Cologne". Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1], the Java Virtual Machine and the Parrot Virtual Machine[^2]. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^3] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This release is named after Cologne, in honour of the organizers of the Niederrhein.PM meeting this week. Some of the changes in this release are outlined below: These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". INCOMPATIBLE CHANGES: + $str ~~ s/// now returns a Match or list of Matches Other notable changes: + Flakiness on OS X has been fixed (for the most part) + Method FALLBACK implemented + Updated List smart-matching to latest design + $*DISTRO and $*KERNEL updated ($*DISTRO now actually report the Linux dist) + Added Metamodel::Primitives, to open up more meta-programming possibilities (publishing method caches, completely custom meta-objects, etc.) + Support for closure parameter signatures + Implemented chained sequences + Many optimizations, bug-fixes and other additions The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Larry Wall, Jonathan Worthington, Rob Hoelz, Moritz Lenz, Tobias Leich, Timo Paulssen, Christian Bartolomäus, Carl Mäsak, Solomon Foster, Geoffrey Broadwell, Will "Coke" Coleda, raydiak, Alexander Moquin If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#84), is scheduled for 22 January 2015. 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. The development team appreciates feedback! If you're using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list of IRC channel. Enjoy! [^1]: See [^2]: See [^3]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. # Troubleshooting It appears that on OS X, the build will sometimes fail with a message like: .../install/include/libuv/uv-darwin.h:26:11: fatal error: 'mach/mach.h' file not found The only solution found to fix this so far, has been: $ cd install/include/libuv $ ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/mach $ cd ../../.. $ # run make again Note that the 10.9 in the above, represents the major version of OS X being used. On Mavericks use 10.9 (like above), on Yosemite use 10.10. rakudo-2018.03/docs/announce/2015.01.md0000644000175000017500000000654613253717231015525 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #84 (“Gotanda”) On behalf of the Rakudo development team, I’m happy to announce the January 2015 release of Rakudo Perl 6 #84 “Gotanda”. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1], the Java Virtual Machine and the Parrot Virtual Machine[^2]. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^3] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This release is named after Gotanda.pm Some of the changes in this release are outlined below: These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. INCOMPATIBLE CHANGES: + None this release Other notable changes: + All deprecated features will be removed with 6.0.0 (sometime in 2015) + Startup on the JVM has improved by 20% + Many improvements to Java interop for the JVM backend + New simple way of creating an object hash: :{} + Substitution now supports assignment meta-op, e.g. s[\d+] += 2 + Many memory and CPU optimizations + Supply.for deprecated in favour of Supply.from-list The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Moritz Lenz, Pepe Schwarz, Jonathan Worthington, Larry Wall, Tobias Leich, ab5tract, Christian Bartolomäus, Rob Hoelz, Donald Hunter, Timo Paulssen, raydiak, Geoffrey Broadwell, Alexander Moquin, Yun SangHo, skids, Lucas Buchala, Will Coleda, Solomon Foster, Steve Mynott, ugexe, Carl Mäsak, pmurias, woolfy If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#85), is scheduled for 19 February 2015. 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. The development team appreciates feedback! If you’re using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list of IRC channel. Enjoy! [^1]: See [^2]: See [^3]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what’s possible with Rakudo Perl 6 and provide feedback on what works, what doesn’t, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2015.02.md0000644000175000017500000001463513253717231015524 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #85 (“Berlin”) On behalf of the Rakudo development team, I’m happy to announce the February 2015 release of Rakudo Perl 6 #85 “Berlin”. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1], the Java Virtual Machine and the Parrot Virtual Machine[^2]. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^3] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . As described by pmichaud in a recent blog post: http://pmthium.com/2015/02/suspending-rakudo-parrot/ this is the *last* release of Rakudo that supports Parrot as a backend for the foreseeable future. Whether Parrot support can be restored at some point in the future, really depends on people with tuits making the necessary changes. In that light, I would like to emphasize the last paragraph of said blog post: If there are people that want to work on refactoring Rakudo’s support for Parrot so that it’s more consistent with the other VMs, we can certainly point them in the right direction. For the GLR this will mainly consists of migrating parrot-specific code from Rakudo into NQP’s APIs. For the NSA and NFG work, it will involve developing a lot of new code and feature capabilities that Parrot doesn’t possess. The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This release is named after Berlin.pm for several reasons: + Historically, Berlin has been known to be a divided city. Just over 25 years ago, the miracle of reunification started. Berlin today is a thriving city, still redefining itself. The fact that this release will most likely be the last release supporting Parrot, signifies a division that we hope will be undone in the future. The history of Berlin should be an inspiration for this. + In April 2015, the next Perl QA Hackathon will take place in Berlin. This hackathon will be attended by developers who will be working on both Perl 5 as well as Perl 6. A further sign of reunification. Some of the changes in this release are outlined below: These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. INCOMPATIBLE CHANGES: + On MoarVM, symlinks are now followed. This means that e.g. a given path can have both .l and .d be true, if the symlink points to a directory. This behaviour now matches the behaviour on the Parrot and JVM backend, therefore one could consider this a bug fix, rather than an incompatible change. + Overriding invoke/postcircumfix:<( )> for type coercions (ex. MyType(...)) now passes the function arguments as-is, rather than just passing a Capture containing them. To get the old behavior, simply declare a Capture parameter (|c). + "6;" at unit start is no longer a way to say "no strict;". It was deemed to be a bad meme and huffmannized inappropriately. + The NativeCall module (for incorporating external libraries as Perl 6 subs) is now part of the compiler distribution. To activate it, one must still do a "use NativeCall", but it does *not* have to be installed with panda anymore. If you are a module developer, you can now remove NativeCall as a prerequisite from the meta information of your distribution. Other notable changes: + Coercion syntax now works in signatures: sub foo(Str(Any) $a) { ... } will take Any value as its first positional parameter, and coerce it to Str before making it available in $a. Note that Str(Any) can be shortened to Str(). + "sub MAIN;" (as in, rest of file is the MAIN unit) has been implemented. + Metaop "=" now respects the precedence of the op it is meta-ing. + Added numerical "polymod" method: $seconds.polymod(60,60,24) will give you a list with seconds, minutes, hours, days. + Added rational "base-repeating" method: (1/7).base-repeating(10) will give you a base of "0." and a repeating factor of "142857". In contrast, printf("%0.20f",1/7) would give you 0.14285714285714300000, which is less accurate. + Repeated mixins of the same role and same type are now 10x faster, and use much less memory. Str.trans, tr/// and Str.subst on simple Str, are now about 20x faster. + Many optimizations, improved error messages and bugs fixed (over 200 commits to Rakudo since the 2015.01 release). The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Alexander Moquin, Moritz Lenz, Tobias Leich, Jonathan Worthington, Larry Wall, Will "Coke" Coleda, Timo Paulssen, Rob Hoelz, Andrew Egeler, Paul Cochrane, Stefan Seifert, Brad Gilbert, Mikhail Khorkov, Pepe Schwarz, avuserow, nwc10, skids, mj41, Tux, raydiak, Elizabeth Mattijsen If you would like to contribute, see , ask on the mailing list, or ask on IRC \#perl6 on freenode. The next release of Rakudo (#86), is scheduled for 19 March 2015. 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. The development team appreciates feedback! If you’re using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list of IRC channel. Enjoy! [^1]: See [^2]: See [^3]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Nothing else. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what’s possible with Rakudo Perl 6 and provide feedback on what works, what doesn’t, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2015.03.md0000644000175000017500000001364513253717231015525 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #86 (“Cluj”) On behalf of the Rakudo development team, I’m happy to announce the March 2015 release of Rakudo Perl 6 #86 “Cluj”. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1] and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^3] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . As described by pmichaud in a recent blog post: http://pmthium.com/2015/02/suspending-rakudo-parrot/ this is the first release of Rakudo that does *not* support Parrot [^2] as a backend. Whether Parrot support can be restored at some point in the future, really depends on people with tuits making the necessary changes. In that light, I would like to emphasize the last paragraph of said blog post: If there are people that want to work on refactoring Rakudo’s support for Parrot so that it’s more consistent with the other VMs, we can certainly point them in the right direction. For the GLR this will mainly consists of migrating parrot-specific code from Rakudo into NQP’s APIs. For the NSA and NFG work, it will involve developing a lot of new code and feature capabilities that Parrot doesn’t possess. The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This release is named after Cluj.pm which just celebrated its third birthday. Some of the changes in this release are outlined below: These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. + Incompatible changes and deprecations: + renamed internal hash/array/code/* methods: | OLD | NEW | |----------------------|--------------------| | at_pos | AT-POS | | exists_pos | EXISTS-POS | | delete_pos | DELETE-POS | | assign_pos | ASSIGN-POS | | bind_pos | BIND-POS | | at_key | AT-KEY | | exists_key | EXISTS-KEY | | delete_key | DELETE-KEY | | assign_key | ASSIGN-KEY | | bind_key | BIND-KEY | | invoke | CALL-ME | | Supply.on_demand | Supply.on-demand | | Supply.schedule_on | Supply.schedule-on | + renamed traits - hidden_from_backtrace hidden-from-backtrace - hidden_from_USAGE hidden-from-USAGE + Deprecated use MONKEY_TYPING for use MONKEY-TYPING. + Deprecate IO::Handle.input-line-separator for .nl + Features + Allow Buf.AT-POS to return an l-value. + Implement method ^foo($) { ... } syntax. + Implemented PairMap (the simple case only, for now). + Implemented .antipairs (pairs with value => key). + Implemented .pairup for creating pairs from lists. + Implemented LEXICAL, OUTERS and CALLERS pseudo-packages + Add a array[T], usable for native int/num (MoarVM only for now) + Other native improvements, e.g. my int $a; $a++ + Implement IO::Path.resolve on r-m/POSIX + Fixes + Fix JVM runner generation on Windows. + Make $?TABSTOP immutable + Make CALLER::<&?ROUTINE> work + Errors like "expected Array[Str] but got Array[Str]" have been fixed. + Optimizations + Make my int/num @a = Range about 1000x faster + Make s/// up to 25% faster + Make substr(-rw) about 10% faster + Test.pm changes + Add simple use-ok implementation + NativeCall.pm changes + 'is native' will also accept Callables to allow runtime library detection + Implemented nativesizeof(T) + Add typed Pointer type as replacement for OpaquePointer The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Jonathan Worthington, Larry Wall, Tobias Leich, ugexe, Alexander Moquin, Moritz Lenz, Timo Paulssen, Pepe Schwarz, Andrew Egeler, Christian Bartolomäus, Kamil Kułaga, Solomon Foster, Geoffrey Broadwell, Jonathan Scott Duff, Paul Cochrane, Carl Masak, Will "Coke" Coleda, raydiak, Donald Hunter, Stefan Seifert, Rob Hoelz, sue spence, Brad Gilbert, Ven, Steve Mynott, [Tux], Nicholas Clark, avuserow If you would like to contribute, see , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#87), is scheduled for 23 April 2015. 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. The development team appreciates feedback! If you’re using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! [^1]: See [^2]: See [^3]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what’s possible with Rakudo Perl 6 and provide feedback on what works, what doesn’t, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2015.04.md0000644000175000017500000000730513253717231015522 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #87 ("Vladivostok") On behalf of the Rakudo development team, I'm happy to announce the April 2015 release of Rakudo Perl 6 #87 "Vladivostok". Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1] and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This month's release is named after Vladivostok, because we've run out of .pm groups in China. Some of the changes in this release are outlined below: * Installation directory layout changed: it now uses $PREFIX/share instead of $PREFIX/languages * "0" (0 as a string) is now True, no special-casing anymore * an Int() coercion type in a multi now creates two candidates: Any and Int * numerous small fixes * native arrays * 'bit' and 'byte' native types * starts-with/substr-eq/ends-with for comparing strings inside other strings * basic implementation of Uni, NFC, NFD, NFKC, and NFKD on Moar backend * where constraints on variable and attribute declarations * 'is rw' parameters implemented for native subs (they get passed as a pointer) * Str.codes/chars/uc/lc/tc/tclc/ord/flip about 25% faster * use Foo:from\ and EVAL $code, :lang\ are now supported as long as Inline::Perl5 is installed. Allows passing most of S01 spec tests. * many smaller speedups These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Jonathan Worthington, Larry Wall, Elizabeth Mattijsen, Tobias Leich, Pepe Schwarz, Moritz Lenz, Will "Coke" Coleda, Carl Mäsak, Alexander Moquin, raydiak, Brent Laabs, Christian Bartolomäus, Timo Paulssen, Jonathan Stowe, Stefan Seifert, Jonathan Scott Duff, Rob Hoelz, Edwin Steiner, Geoffrey Broadwell, nwc10, eli-se, lucasb If you would like to contribute, see , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#88), is scheduled for 21 May 2015. 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. The development team appreciates feedback! If you're using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2015.05.md0000644000175000017500000001110313253717231015512 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #88 ("Dresden") On behalf of the Rakudo development team, I'm happy to announce the May 2015 release of Rakudo Perl 6 #88 "Dresden". Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1] and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This month's release is named after Dresden, where this year's German Perl Workshop happened. Some of the changes in this release are outlined below: * NFG, NFC, NFD, Uni * Implemented CLIENT:: (nearest CALLER:: from different package) * Implemented "is nodal" for signalling behaviour under hypers * Rudimentary tab completion available via the Linenoise module * "unit" declaration needed for blockless packages * Various API changes for the Great List Refactor, such as... + 'for' loops not longer flatten; use 'for flat' for that + .map no longer flattens, map as a listop does. Use .flatmap to get the old behavior + Likewise other methods that used to flatten their invocant no longer do: all, any, one, none, unique, squish, min, max, minmax, classify, and categorize + Nil no longer iterates like the empty List. Use () or Empty instead. * .pick($n)/roll($n) now always return lists, even when $n == 1 * $?FILE is now always an absolute path * The "is cached" trait no longer works on methods, throws a NYI instead * Method .map should be used instead of .for * Test.pm functions are now kebab-cased (e.g. throws_like -> throws-like) * Hashes use much less memory on Moar * The REPL is strict by default now, that leaves only '-e' lines to be lax * site/lib is now in the C library (.dll/.so/.dylib etc) search path * generating backtraces is now lazy, improving the speed of e.g. warnings * Implement new @*INC handling (about 30% faster startup time) (bare startup time is now below 100 ms on some machines) * Implemented CUnions which map to the union C type definition for NativeCall * Implemented HAS declarator for attributes to mark it embedded into the CStruct or CUnion These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Jonathan Worthington, Tobias Leich, Sterling Hanenkamp, Arne Skjærholt, Paul Cochrane, Larry Wall, Rob Hoelz, Carl Masak, raydiak, Timo Paulssen, Christian Bartolomäus, Will "Coke" Coleda, Bart Wiegmans, Moritz Lenz, Jonathan Stowe, skids, Pepe Schwarz, Brent Laabs, Steve Mynott, Jeffrey Goff, Solomon Foster, Radek Slupik, Elise, tony-o, Stefan Seifert, Jimmy Zhuo, Nicholas Clark, Brad Gilbert, Nick Logan, ven, lembark, Justin DeVuyst, David Warring, Xinyuan Wang, David Farrell If you would like to contribute, see , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#89), is scheduled for 18 June 2015. 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. The development team appreciates feedback! If you're using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2015.06.md0000644000175000017500000000671513253717231015530 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #89 ("Salt Lake") On behalf of the Rakudo development team, I'm happy to announce the June 2015 release of Rakudo Perl 6 #89 "Salt Lake". Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1] and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This month's release is named after Salt Lake City, where this year's YAPC::NA happened. Some of the changes in this release are outlined below: * Lexical pragma 'use trace' now outputs statements on STDERR * $=finish now contains text after first =finish/=for finish/=begin finish * Added :as named param to .classify / .categorize * EVALFILE added, for evalling source in a file * Implemented 'quietly' statement prefix to prevent warnings being issued * DateTime default timezone format is now +HH:MM (used to be +HHMM) * "".IO / IO::Path.new("") no longer legal, use "." for current dir * next/last/redo don't allow expressions to be evaluated anymore * sign(NaN)/NaN.sign is now NaN * Stubbed-out code (via .../!!!) no longer results in X::AdHoc These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on Parrot, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Tobias Leich, Jonathan Worthington, Timo Paulssen, Rob Hoelz, Christian Bartolomäus, Will "Coke" Coleda, Bart Wiegmans, Larry Wall, Moritz Lenz, Justin DeVuyst, Steve Mynott, Carl Masak, Solomon Foster, cygx, smls, Alexander Moquin, Jonathan Stowe, Brent Laabs, Dagur Valberg Johannsson, Sam S If you would like to contribute, see , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#90), is scheduled for 23 July 2015. 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. The development team appreciates feedback! If you're using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2015.07.md0000644000175000017500000000673413253717231015532 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #90 ("Prague") On behalf of the Rakudo development team, I'm happy to announce the July 2015 release of Rakudo Perl 6 #90 "Prague". Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1] and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it's announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This month's release is named after Prague, new home to one of the Rakudo core developers. Some of the changes in this release are outlined below: * Cool.substr(-rw) and &substr(-rw) now also accept a Range * Added trait "is required" on class attributes * &?ROUTINE and &?BLOCK * &words implemented (to completement .words) * Numeric comparison ops (== > etc) for DateTimes * samewith() now also works in subs * Calling the .clone method with alternate values no longer changes original * .grep and &grep now consume multiple elements for many-param blocks * ENTER phaser now can be used as an r-value These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on the design docs, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Jonathan Worthington, Elizabeth Mattijsen, Tobias Leich, skids, Moritz Lenz, Christian Bartolomäus, Jonathan Scott Duff, Nick Logan, Timo Paulssen, Carl Mäsak, Steve Mynott, Larry Wall, Rob Hoelz, Jonathan Stowe, Will "Coke" Coleda, Jimmy Zhuo, Stefan Seifert, Faye Niemeyer, David H. Adler, Bart Wiegmans, Lucas Buchala, Paul Cochrane, Cédric Vincent, Stéphane Payrard, Brent Laabs, Daniel Dehennin, Geoff Broadwell, Sue, Sue Spence, smls, ab5tract, Dmitriy Olshevskiy If you would like to contribute, see , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#91), is scheduled for 20 August 2015. 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. The development team appreciates feedback! If you're using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! [^1]: See [^2]: What's the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the "Using Perl 6" book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what's possible with Rakudo Perl 6 and provide feedback on what works, what doesn't, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2015.08.md0000644000175000017500000000425313253717231015525 0ustar alexalex# Announce: Rakudo Perl 6 compiler, August 2015 scheduled release On behalf of the Rakudo development team, I'd like to announce that we have skipped the regularly scheduled release planned for August 2015. The team has been working hard on finishing the GLR (Great List Refactor) which is one of the last disruptive changes planned before we are able to release a candidate that might be eligible for Christmas. Many of our developers were able to get together and work on this and other items at the recent Swiss Perl Workshop, but the schedule of the workshop and the amount of work involved made it difficult to complete the work in time for the scheduled August release. Our plan now is to include the work done as part of the GLR in the *next* scheduled monthly release. We will also remove all the functionality that has been deprecated - we've been warning about this for some time, and we want to give the module ecosystem a chance to deal up with these last set of disruptive changes before the Christmas release this year. Thank you for your patience as we work to bring you the best version of Perl 6 that we can. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1] and the Java Virtual Machine. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on the design docs, the Perl 6 test suite, MoarVM and the specification. If you would like to contribute, see , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#91), is scheduled for 17 September 2015. 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. The development team appreciates feedback! If you're using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! [^1]: See rakudo-2018.03/docs/announce/2015.09.md0000644000175000017500000001017513253717231015526 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #91 (“Zürich”) On behalf of the Rakudo development team, I’m happy to announce the September 2015 release of Rakudo Perl 6 #91 “Zürich”. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1] and the Java Virtual Machine. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This month’s release is named after Zürich Perl Mongers, hosts of the recent Swiss Perl Workshop. Some of the changes in this release are outlined below: * Great List Refactor - See http://design.perl6.org/S07.html * All Deprecations removed in preparation for Christmas release * Added support for calling into C++ libraries and calling methods on C++ classes * New slurpy parameter, +args or +@args, to allow for one-argument style binding * New with/orwith/without conditionals allow you to check for .defined but topicalize to the actual value returned * New `supply`, `whenever` and `react` blocks for easy reactive programming * All Unicode digits can now be part of literal numbers * `val()` and allomorphic types implemented * Most European quoting styles are now supported * New $[...] and ${...} constructs allow prefix itemization * The .gist and .perl methods can now deal with self-referential structures These are only some of the changes in this release. For a more detailed list, see "docs/ChangeLog". Apologies, there are a few failures in the JVM test suite this month, as we’ve been focusing on our primary backend, MoarVM. Please bear with us. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on the design docs, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Jonathan Worthington, Stefan Seifert, Elizabeth Mattijsen, Tobias Leich, Moritz Lenz, Pawel Murias, Larry Wall, Faye Niemeyer, Rob Hoelz, skids, Jimmy Zhuo, Timo Paulssen, Will "Coke" Coleda, Solomon Foster, Paul Cochrane, Pepe Schwarz, David Warring, Jonathan Scott Duff, Christian Bartolomäus, Nick Logan, niner, laben, Brent Laabs, Carl Masak, Kamil Kułaga, Francois Perrad, Bart Wiegmans, Ben Tyler, Geoffrey Broadwell, Leon Timmermans, Will Coleda, Justin DeVuyst, Steve Mynott, alexghacker, vendethiel, Tim Smith, Jonathan Stowe, David Warring, Carl Mäsak, sergot, Stéphane Payrard, Daniel Dehennin, Mike Francis, Sue Spence, Zoffix Znet If you would like to contribute, see , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#92), is scheduled for 22 October 2015. 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. The development team appreciates feedback! If you’re using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what’s possible with Rakudo Perl 6 and provide feedback on what works, what doesn’t, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2015.10.md0000644000175000017500000001076113253717231015517 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #92 (“Niceville”) On behalf of the Rakudo development team, I’m very happy to announce the October 2015 release of Rakudo Perl 6 #92 “Niceville”. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1] and the Java Virtual Machine. This is the “Birthday” release of Rakudo Perl 6; It’s the first release candidate/beta of the compiler for the anticipated 6.0 “Christmas” release. The “Christmas” release will occur on or about 17 December 2015, assuming no critical bugs are found between now and then. Please try the release, your feedback is greatly appreciated. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This month’s release is named after the Niceville chapter, because it sounds like a wonderful, magical place. Some of the changes in this release are outlined below: + We are now officially in beta! + There is now an infix:<.> operator that does method calls with slightly looser precedence than the postfix unary method call. + New operator 'infix o' for function composition + 'fc' for Unicode-correct case folding implemented + grep now accepts :k, :v, :kv, :p attributes + 'Supply.throttle' for rate-limiting + Array.push is now used for pushing one element (mostly); Array.append exists for pushing multiple values. Same for 'unshift'/'prepend' + Basic arithmetic operations ('+', '*', '-', '/') on Range objects that shift or scale the end points while maintaining exclusions + The v notation now allows alphabetic components: v1.2.beta. (Incompatible because method calls on a version must be protected by \ or () now.) + 'use v6b+;' notation is now recognized and enforced + Many built-in methods that return iterables are now much faster + Better error messages when comparing version strings with numbers + Several error messages that were lacking line numbers now include them These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on the design docs, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Elizabeth Mattijsen, Larry Wall, Jonathan Worthington, Pawel Murias, Christian Bartolomäus, Tobias Leich, Stefan Seifert, Will "Coke" Coleda, Pepe Schwarz, Francois Perrad, skids, Rob Hoelz, Faye Niemeyer, Moritz Lenz, Jimmy Zhuo, Timo Paulssen, Stéphane Payrard, cygx, Nick Logan, Solomon Foster, tony-o, Bart Wiegmans, Steve Mynott, diakopter, niner, Tokuhiro Matsuno, Carl Mäsak, Nicholas Clark, thundergnat, Jonathan Scott Duff, Shoichi Kaji, sue spence, David Warring If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#93), is scheduled for 19 November 2015. 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. The development team appreciates feedback! If you’re using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what’s possible with Rakudo Perl 6 and provide feedback on what works, what doesn’t, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2015.11.md0000644000175000017500000001071413253717231015516 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #93 (“Bend”) On behalf of the Rakudo development team, I’m very happy to announce the November 2015 release of Rakudo Perl 6 #93 “Bend”. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1] and the Java Virtual Machine. This is the final pre-Christmas release of Rakudo Perl 6. It’s the second release candidate/beta of the compiler for the anticipated 6.0 “Christmas” release. The “Christmas” release will occur on or about 17 December 2015, assuming no critical bugs are found between now and then. Please try the release, your feedback is greatly appreciated. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, with each release named after a Perl Mongers group. This month’s release is named after the Bend chapter, because we’re nearly around the bend with the upcoming Christmas release. Some of the changes in this release are outlined below: New in 2015.11: + Initial shaped array support + \r\n (Carriage Return/LineFeed) is now a single (synthetic) grapheme + Unicode support adheres to Unicode Annex #29 + Unicode quotes are now also allowed in regular expressions + Improved newline support with "use newline" and updates to IO::Handle + Added List.head, List.tail, List.repeated methods + Str.encode now allows :replacement parameter for unencodable sequences + Str.split now accepts multiple strings to split on + New Range.int-bounds returns first/last value for integer ranges + Auto-generated meta-ops vivified by referring to them, instead of executing + Illegal assignment of different Numeric values now caught at compile time + &nextcallee implemented, which returns the routine that nextsame would invoke + Many speedups These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on the design docs, the Perl 6 test suite, MoarVM and the specification. The following people contributed to this release: Jonathan Worthington, Elizabeth Mattijsen, Larry Wall, Pawel Murias, Will "Coke" Coleda, Christian Bartolomäus, Pepe Schwarz, Timo Paulssen, Tobias Leich, Mike Francis, Nicholas Clark, Dagfinn Ilmari Mannsåker, Moritz Lenz, Steve Mynott, Jens Rehsack, cygx, Stefan Seifert, Jimmy Zhuo, Nick Logan, Lucas Buchala, Zoffix Znet, Donald Hunter, Lloyd Fournier, Ronald Schmidt, Bart Wiegmans, Tomasz Konojacki, Sterling Hanenkamp, Vladimir Lettiev, Faye Niemeyer, johnspurr, Tim Smith, Rob Hoelz, grondilu If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. 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, 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. The development team appreciates feedback! If you’re using Rakudo, do get back to us. Questions, comments, suggestions for improvements, cool discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what’s possible with Rakudo Perl 6 and provide feedback on what works, what doesn’t, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2015.12.md0000644000175000017500000005262313253717231015524 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Development Release #94 (“коледа”) On behalf of the Rakudo development team, I’m proud to announce the Christmas release (December 2015) of Rakudo Perl 6 #94 “коледа”. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1] and the Java Virtual Machine. This is the Christmas release of Rakudo Perl 6. This version of the compiler targets the v6.c “Christmas” specification of the Perl 6 language. The Perl 6 community has been working toward this release over the last 15 years. Together, we've built a language that: + Retains the core values of Perl: expressiveness, getting the job done, taking influences from natural language, and pushing the boundaries of language design + Has clean, modern syntax, rooted in familiar constructs but revisiting and revising the things that needed it + Is truly multi-paradigm, enabling elegant object-oriented, functional, procedural, and concurrent programming + Serves as a great glue language, allowing for easy calling of C/C++ (using NativeCall) and staying compatible with Perl 5 (via Inline::Perl5). + Provides composable constructs for working with asynchronous data and parallel computations + Dramatically reforms and sets a new standard in regex syntax, which scales up to full grammars - powerful enough to parse Perl 6 itself + Has outstanding Unicode support, with strings working at grapheme level + Values lexical scoping and encapsulation, enabling easy refactoring + Is extensible through meta-object programming, user-defined operators, and traits The tag for this release is “коледа”[^2], a slavic word for an ancient winter festival that has been incorporated into Christmas. We hope you join us in our celebration of getting our Christmas release shipped! While we are extremely happy to ship an official Perl 6 release, this is not the end of Rakudo’s development. We will continue to ship monthly releases, which will continue to improve performance and our user’s experience. We’ll also continue our work on the specification, with feedback from the community. To be clear on that point, this Rakudo release is not considered the primary deliverable for this Christmas; it is the language specification, known as "roast" (Repository Of All Spec Tests), that is considered the primary deliverable. The specification tests that define this 6.c version[^3] of the language are now frozen, and we hope it will be quite some time before we feel obligated to define a 6.d (Diwali) version of the language. This Rakudo release targets those tests (over 120 thousand of them), and passes them all on at least some architectures when the moon is in the right phase. But Rakudo itself is not frozen. There is still plenty of work ahead for us to improve speed, portability, and stability. Do not expect the level of perfection that you see in established products. This is essentially a .0 release of a compiler. We do not claim an absence of bugs or instabilities. We do not claim the documentation is complete. We do not claim portability to many architectures. We do not claim that all downstream software will work correctly. Think of it as a first kernel release, and now we get to build and port various distributions based around that kernel. What we do claim is that you now have a stable language specification, and you can enjoy getting some stuff done with Perl 6 without us breaking it every month—as long as you stick to the features that are actually tested in the test suite, that is. Please note that any “feature” you discover that is not tested in the test suite is considered fair game for change without notice. Have the appropriate amount of fun! The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^4] --- it’s announcing a new release of the compiler and the specification. For the latest Rakudo Star release, see . A Christmas-based version will be available soon. In addition to being our Christmas release, this is yet another monthly compiler release; Some of the changes that are new in release are outlined below: New in 2015.12: + Fixed size and multi-dimensional typed and native arrays + Greatly overhauled module loading and installation, including handling precompilation at module installation time in Rakudo + while/until loops can now return lists of values + We now catch many more kinds of "Useless use of X in sink context" + 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 + Add support for USAGE argument help + Provide tau constant (also: τ) + Can now use channels with supply/react/whenever + Bool is now a proper enum + Supply/Supplier improvements + Use of EVAL now requires a declaration of 'use MONKEY-SEE-NO-EVAL' + Make pack and unpack experimental + Dynamic variables are now visible inside start { ... } blocks + Autoincrements on native ints are now faster than on Int + The ~~ operator can now chain with other comparisons in many circumstances + Various numeric operations now return overflow/underflow failures instead of wrong value + The :ss, :ii, and :mm options to s/// now all work together This is only a partial list of the changes in this release. For a more detailed list, see “docs/ChangeLog”. The development team thanks all of our contributors and sponsors for making Rakudo Perl possible, as well as those people who worked on the design docs, the Perl 6 test suite, MoarVM and the specification. Additionally, the Pugs, Parrot, and Niecza projects were all instrumental with their contributions to the specification and the community. The following people contributed to the development of the Christmas release; We’ve gone back through the logs of all the various projects. Thanks to everyone who has worked to make this release happen over the past 15 years. We would also like to thank everyone who submitted bug reports or dropped in on the various forums to discuss things. Finally, we’d like to extend a special thanks to everyone who we accidentally left out of this list. Gisle Aas, abcxyzp, Chuck Adams, Colin Paul Adams, Rod Adams, C.J. Adams-Collier, David H. Adler, Chirag Agrawal, Amir E. Aharoni, Bilal Akhtar, Julian Albo, Alekssasho, alexghacker, Paco Alguacil, Brandon S Allbery, Geir Amdal, Markus Amsler, Paul C. Anagnostopoulos, Nikolay Ananiev, anatolyv, andras, Saleem Ansari, Joji Antony, Tomoki Aonuma, Syed Uzair Aqeel, arathorn, Arcterus, Kodi Arfer, Daniel Arbelo Arrocha, ash, Ted Ashton, Arnaud Assad, atroxaper, Ori Avtalion אורי אבטליון, Auzon, Greg Bacon, Ivan Baidakou, Alex Balhatchet, Szabó, Balázs, Amir Livine Bar-On עמיר ליבנה בר-און, Luca Barbato, Mattia Barbon, Ann Barcomb, Christian Bartolomäus, Alex "Skud" Bayley, bcmb, Jody Belka, Shachaf Ben-Kiki, Andrei Benea, benedikth, Zev Benjamin, benmorrow, Kevan Benson, Martin Berends, Anton Berezin, Arthur Bergman, Anders Nor Berle, bestian, Peter Bevan, Mark Biggar, Carlin Bingham, Ævar Arnfjörð Bjarmason, J. David Blackstone, Ronald Blaschke, Ingo Blechschmidt, bloonix, blwood, Kristof Bogaerts, Dan Bolser, Конрад Боровски, Christopher Bottoms, Gonéri Le Bouder, Jos Boumans, Brad Bowman, Matt Boyle, bpetering, H.Merijn Brand, Terrence Brannon, Gwern Branwen, Stig Brautaset, Herbert "lichtkind" Breunung, bri, brian_d_foy, Fernando Brito, Geoffrey Broadwell, Leon Brocard, Benjamin Brodfuehrer, Samuel Bronson, Dan Brook, Nathan C. Brown, Roger Browne, Philippe Bruhat (BooK), David Brunton, Corwin Brust, Klaus Brüssel, Lucas Buchala, buchetc, Christoph Buchetmann, Norbert Buchmuller, Buddha Buck, Alexandre Buisse, Tim Bunce, Bryan Burgers, Sean M. Burke, Matthew Byng-Maddick, András Bártházi, Jürgen Bömmels, Caelum, Aldo Calpini, Edward Cant, David Cantrell, Carlin, Michael Cartmell, Hezekiah Carty, Nuno 'smash' Carvalho, Marcelo Serra Castilhos, Piers Cawley, cdavaz, cdpruden, Gianni Ceccarelli, cfourier, Marc Chantreux, Mitchell N Charity, Oliver Charles, Vasily Chekalkin, Yuan-Chen Cheng 鄭原真, Daniel Chetlin, Hsin-Chan Chien 簡信昌, N. Hao Ching, Joshua Choi, Elizabeth Cholet, David Christensen, chuck, cjeris, Nicholas Clark, Steve Clark, Jeff Clites, cmarcelo, cmeyer, Paul Cochrane, Daniel Colascione, Jason Cole, Will "Coke" Coleda, Sylvain Colinet, cono, Tim Conrow, Géraud Continsouzas, Damian Conway, Neil Conway, Stuart Cook, David Corbin, Deven T. Corzine, cosmicnet, Timothy Covell, Beau E. Cox, Simon Cozens, Philip Crow, cspenser, Franck Cuny, Tyler Curtis, David Czech, Daenyth, Dagur, Ritz Daniel, darkwolf, Chris Davaz, David Warring, Justin DeVuyst, Daniel Dehennin, Akim Demaille, Detonite, Lars "daxim" Dieckow 迪拉斯, Matt Diephouse, Bob Diertens, Wendy "woolfy" van Dijk, Jeffrey Dik, John M. Dlugosz, dimid, diotalevi, Hans van Dok, Chris Dolan, Mark Dominus, Bryan Donlan, Andy Dougherty, Dave Doyle, drKreso, dr_df0, dudley, Jonathan Scott Duff, dug, Lee Duhem, Darren Duncan, Andrew Egeler, Havard Eidnes, Nelson Elhage, Fitz Elliott, Alex Elsayed, Jay Emerson, Aankhola Encorporated, ennio, Enveigler, Jon Ericson, Shae Matijs Erisson, Eryq, Mike Eve, Pat Eyler, Aaron Faanes, Kevin Falcone, David Farrell, Angel Faus, Jason Felds, Paul Fenwick, Jose Rodrigo Fernandez, Nelson Ferraz, Adriano Ferreira, João Fernando Ferreira, Chris Fields, Caio Marcelo de Oliveira Filho, Steve Fink, Shlomi "rindolf" Fish שלומי פיש, Mark Leighton Fisher, Scott Fitzenrider, Dudley Flanders, Richard Foley, Vincent Foley, Julian Fondren, Ruben Fonseca, David Formosa, Karl Forner, Solomon Foster, Chaddaï Fouché, Lloyd Fournier, Michael Fowler, Matt Fowles, franck, Austin Frank, Carl Franks, Kent Fredric, Chaim Frenkel, Piotr Fusik, gabriele, John Gabriele, Christoph Gärtner, Martin von Gagern, Felix Gallo, Salvador Ortiz Garcia, Rafaël Garcia-Suarez, Joshua Gatcomb, Jerry Gay, gcomnz, Jonathan Gentle, iVAN Georgiev, Brian Gernhardt, Bram Geron, Alessandro Ghedini, Imran Ghory, Peter Gibbs, Tanton Gibbs, Brad Gilbert (b2gills), Karl Glazebrook, Nick Glencross, Mark Glines, Flávio S. Glock, Jason Gloudon, Simon Glover, gnuvince, Garrett Goebel, Jeffrey Goff, Mikhael Goikhman, Benjamin Goldberg, Arcady Goldmints-Orlov, Dimitry Golubovsky, Gerard Goossen, Goplat, Alex Gough, Léo Grange, Chad "Exodist" Granum, Kenneth A Graves, Bruce Gray, Nathan Gray, Mark Grimes, Lucien Grondin, Rolf Grossmann, David Grove, Marcel Grünauer, Daniel Grunblatt, Uri Guttman, gwern, Swaroop C H, Richard Hainsworth, Roger Hale, John "ab5tract" Haltiwanger, Nigel Hamilton, Eric Hanchrow, Sterling Hanenkamp, Ask Bjørn Hansen, Christian "chansen" Hansen, Eirik Berg Hanssen, Samuel Harrington, Trey Harris, John Harrison, Carsten Hartenfels, Richard Hartmann, Kyle Hasselbacher, Austin Hastings, Carl Hayter, Florian Helmberger, Gordon Henriksen, Felix Herrmann, Peter Heslin, Fred Heutte, Jarkko Hietaniemi, Michael H. Hind, Joshua Hoblitt, Zack Hobson, Eric Hodges, Rob Hoelz, Masahiro Honma, Lyle Hopkins, JD Horelick, Jeff Horwitz, Chris Hostetter, Laurens Van Houtven, Jeremy Howard, Yiyi Hu 鹄驿懿, Benedikt Huber, Brad Hughes, Sterling Hughes, Tom Hughes, Tristan Hume, Donald Hunter, Douglas Hunter, Juan Francisco Cantero Hurtado, Kay-Uwe 'kiwi' Hüll, Ran Eliam, Alin Iacob, Ibotty, ibrown, ihrd, Roland Illing, Jan Ingvoldstad, Joshua Isom, isop, Ivan_A_Frey, ivanoff, Akash Manohar J, jafelds, Robert G. Jakabosky, jamesrom, S. A. Janet, jani, Heiko Jansen, Stuart Jansen, Jarrod, Jedai, Chris Jepeway, Chris Jeris, Dagur Valberg Johannsson, Erik Johansen, Paul Johnson, johnspurr, Isaac Jones, Norman Nunley, Jr, Yoshikuni Jujo, Brian S. Julin, Brian S. Julin, Josh Juran, Michal Jurosz, David KOENIG, Prakash Kailasa, Shoichi Kaji, Daniel Kang, Isis Kang, Chia-Liang Kao 高嘉良, Dmitry Karasik, Luben Karavelov, Amir Karger, Offer Kaye, Bruce Keeler, James E Keenan, Cole Keirsey, Adam Kennedy, Matt Kennedy, Shane Kerr, khairul, Mikhail Khorkov, Krzysztof Kielak, Andres Kievsky, Daehyub Kim, Rob Kinyon, Oleg Kiselyov, OOLLEY kj, Martin Kjeldsen, Thomas "domm" Klausner, Zohar "lumi" Kelrich זהר קלריך/卡卓哈, Damian Miles Knopp, Dan Kogai 小飼弾, Yuval "nothingmuch" Kogman יובל קוג'מן, Tomasz Konojacki, Vadim Konovalov, Nick Kostirya, Matt Kraai, Thomas Kratz, Adrian Kreher, John van Krieken, Matthias Krull, Bradley M. Kuhn, Bob Kuo, Colin Kuskie, Kamil Kułaga, Sage LaTorra, Brent Laabs, laben, Johannes Laire, Markus Laire, Fayland Lam 林道, Mike Lambert, lanny, Leo Lapworth, last.of.the.careless.men, Bart Lateur, Jia-Hong Lee, Lola Lee, Jonathan Leffler, Tobias Leich, lembark, Mark Lentczner, Moritz A Lenz, Jean-Louis Leroy, Andy Lester, Jonathan "Duke" Leto, Vladimir Lettiev, Mike Li 李曉光, Stefan Lidman, Yung-Chung Lin 林永忠, Glenn Linderman, Vladimir Lipsky, Zach Lipton, Stevan Little, Kang-Min Liu 劉康民, Skip Livingston, David M. Lloyd, Daniel Lo, Peter Lobsinger, Andres Löh, Nick Logan, Eric Lubow, Nolan Lum, Peter Lunicks, LylePerl, Ian Lynagh, lysdexsik, Kiran Kumar M., Jerry MacClure, Noel Maddy, Christopher J. Madsen, Abhijit A. Mahabal, Max Maischein, Peter Makholm, Ujwal Reddy Malipeddi, malon, Christopher Malon, Dagfinn Ilmari Mannsåker, Michael Maraist, Roie Marianer רועי מריאנר, markmont, Simon Marlow, martin, Paolo Martini, Ilya Martynov, Jaume Martí, James Mastros, Michael J. Mathews, Vyacheslav Matjukhin, Tokuhiro Matsuno, mattc, Mike Mattie, Elizabeth "lizmat" Mattijsen, Вячеслав Матюхин, Markus Mayr, Josh McAdams, Martin McCarthy, Mark McConnell, Steven McDougall, John McNamara, Scott McWhirter, mdinger, Olivier "dolmen" Mengué, Kevin Metcalf, Patrick R. Michaud, mimir, mjreed, Tom Moertel, Michael Mol, Paolo Molaro, Shawn M Moore, Brandon Michael Moore, Alexander Moquin, Ion Alexandru Morega, Dino Morelli, Kolia Morev, Zach Morgan, mr_ank, Alex Munroe, muraiki, Paweł Murias, mvuets, Steve Mynott, mzedeler, Carl Mäsak, naesten, Tim Nelson, Ailin Nemui, Ingy döt Net 應吉大聶, David Nicol, Faye Niemeyer, Nigelsandever, Karl Rune Nilsen, Salve J. Nilsen, Per Christian Nodtvedt, Ben Noordhuis, Paweł Nowak, Norman Nunley, Tony O'Dell, יהושע "שי" אוחיון, Clayton O'Neill, Stefan O'Rear, Sean O'Rourke, Matt Oates, Tony Olekshy, Martin Olsen, Dmitriy Olshevskiy, Dave Olszewski, Nelo Onyiah, William Orr, Jon Orwant, Andrei Osipov, Christoph Otto, Pawel Pabian, Walter Pallestrong, Luke Palmer, Bartłomiej Palmowski, Pancake, Paolo, Marton Papp, Andrew Parker, Roman M. Parparov, Anthony Parsons, Mike Pastore, Nova Patch, Timo Paulssen, Tony Payne, Stéphane "cognominal" Payrard, Slava Pechenin, Gael Pegliasco, Stéphane Peiry, Felipe Pena, Nayden Pendov, Wenzel P. P. Peppmeyer, François Perrad, Markus Peter, Ben Petering, Steve Peters, Tim Peterson, Ronny Pfannschmidt, Clinton A. Pierce, Jerrad Pierce, Thilo Planz, plunix, pmakholm, Curtis 'Ovid' Poe, Gerd Pokorra, Peter Polacik, Flavio Poletti, Kevin Polulak, John Porter, Ryan W. Porter, Stephen P. Potter, Philip Potter, Adam Preble, premshree, Klāvs Priedītis, Adam Prime, Richard Proctor, Christopher Pruden, Kevin Puetz, Gregor N. Purdy, purl, Hongwen Qiu, Jerome Quelin, quester, Gerhard R., Peter Rabbitson, Florian Ragwitz, raiph, Matt Rajca, Marcus Ramberg, Claudio Ramirez, Prog Rammer, Allison Randal, David Ranvig, Lars Balker Rasmussen, Curtis Rawls, raydiak, Robin Redeker, Ted Reed, Jens Rehsack, Charles Reiss, Gabriele Renzi, Kenneth C. Rich, Jason Richmond, Ryan Richter, Sebastian Riedel, Dennis Rieks, Jens Rieks, Lanny Ripple, John Rizzo, rkhill, Andrew Robbins, Amos Robinson, Jonathan Rockway, Stefano Rodighiero, Andrew Rodland, Lindolfo Rodrigues, Bob Rogers, Dave Rolsky, David Romano, ron, Eric J. Roode, Garret Rooney, Garrett Rooney, David Ross, Andreas Rottmann, Brent Royal-Gordon, Shmarya Rubenstein, Sam Ruby, Simon Ruderich, Daniel Ruoso, Jake Russo, ruz, Joseph Ryan, Gilbert Röhrbein, Sam S, s1n, sahadev, Patrick Abi Salloum, salty_horse, Chip Salzenberg, Shrivatsan Sampathkumar, Igor Rafael Sanchez-Puls, Hugo van der Sanden, Thomas Sandlaß, Yun SangHo, sanug, Siddhant Saraf, Sasho, Andrew Savige, John Saylor, Matt Schallert, Bernhard Schmalhofer, Arthur Axel Schmidt, Ronald Schmidt, Michael Schroeder, Steven Schubiger, Steve "thundergnat" Schulze, Andreas Schwab, Randal L. Schwartz, Pepe Schwarz, Frederik Schwarzer, Calvin Schwenzfeier, Michael G. Schwern, Steffen Schwigon, Tom Scola, Ariel Scolnicov, Michael Scott, Peter Scott, Rick Scott, Stefan Seifert, Austin Seipp, Mark Senn, Filip Sergot, Seth Gold (Sgeo), William Shallum, Kris Shannon, shenyute, Aaron Sherman, Mark Shoulson, Ryan Siemens, Ricardo Signes, Hinrik Örn Sigurðsson, Jonathan Sillito, Miroslav Silovic, Steve Simmons, Alberto Manuel Brandao Simoes, John Siracusa, Arne Skjærholt, Barrie Slaymaker, Radek Slupik, Mike Small, Benjamin Smith, Melvin Smith, Tim Smith, Adrian White aka snarkyboojum, Richard Soderberg, SolidState, Vishal Soni, Syloke Soong, Shawn Sorichetti, Tadeusz Sośnierz, sue spence, Cory Spencer, Robert Spier, Michael Stapelberg, Edwin Steiner, stephenpollei, Michael Stevens, Don Stewart, Radu Stoica, Klaas-Jan Stol, Alek Storm, David Storrs, Mark Stosberg, Jonathan Stowe, Cosimo Streppone, Jonathan Strickland, Pascal Stumpf, Su-Shee, Sue, Laye Suen, Dan Sugalski, Mark Summerfield, Simon Sun, Cheng-Lung Sung 宋政隆, Sunnavy, Samuel Sutch, svatsan, svn, Andrew Sweger, sygi, Sebastian Sylvan, Gábor Szabó, Bálint Szilakszi, Marek Šuppa, TOGoS, Arvindh Rajesh Tamilmani, Audrey Tang 唐鳳, Bestian Tang 唐宗浩, Adrian Taylor, Jesse Taylor, Philip Taylor, Kevin Tew, the_dormant, Marcus Thiesen, Adam Thomason, Richard Tibbetts, Carey Tilden, Marcel Timmerman, Leon Timmermans, tkob, John Tobey, Frank Tobin, Bennett Todd, Graham Todd, Leopold Tötsch, Daniel Toma, Nathan Torkington, Timothy Totten, John J. Trammell, Matt S. Trout, Nat Tuck, Adam Turoff, Ben Tyler, ujwal, Bernd Ulmann, Reini Urban, parrot user, uzair, VZ, Ilmari Vacklin, vamped, Wim Vanderbauwhede, vendethiel, David Vergin, Ted Vessenes, Sam Vilain, Cédric Vincent, Jesse Vincent, Jos Visser, John van Vlaanderen, vmax, Jeremy Voorhis, Martin Vorländer, Johan Vromans, Maxim Vuets, Juerd Waalboer, Mariano Wahlmann, Kevin Walker, Gloria Wall, Larry Wall, Lewis Wall, Michal J Wallace, John Paul Wallington, walter, Matthew Walton, Ting Wang, Xinyuan Wang, Andy Wardley, Bryan C. Warnock, wayland, Stephen Weeks, Zhen-Bang Wei, Nick Wellnhofer, Shu-Chun Weng, Danny Werner, Brian Wheeler, David E. Wheeler, Dave Whipp, Adrian White, Andrew Whitworth, Bart Wiegmans, Nathan Wiger, Brock Wilcox, Edwin Wiles, Bob Wilkinson, Chris 'BinGOs' Williams, Greg Williams, Josh Wilmes, Matthew Wilson, Ashley Winters, Brian Wisti, Dave Woldrich, Helmut Wollmersdorfer, Kevin J. Woolley, Jonathan Worthington, Kuang-Che Wu 吳光哲, xenu, Liang-Qi Xie 謝良奇, Xtreak, Gaal Yahas גל יחס, Thomas Yandell, Alvis Yardley, Thomas Yeh 葉志宏, Natan Yellin, yiyihu, Matt Youell, Tony Young, Shen, Yu-Teh, Ilya Zakharevich, Ruslan Zakirov, Ahmad M. Zawawi, Michael A. D. Zedeler, zengargoyle, zeriod, Agent Zhang 章亦春, Jimmy Zhuo, Ziggy6, Rob Zinkov, Zoffix Znet If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#95), is tentatively scheduled for 16 January 2016. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! [^1]: See [^2]: See [^3]: See [^4]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what’s possible with Rakudo Perl 6 and provide feedback on what works, what doesn’t, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2016.01.md0000644000175000017500000001301413253717231015512 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #95 (2016.01) On behalf of the Rakudo development team, I’m very happy to announce the January 2016 release of Rakudo Perl 6 #95. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This is the first post-Christmas release of Rakudo Perl 6, and continues to implement Perl v6.c. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Thanks to all the individuals, companies, and organizations who donated money, services, equipment, or their employee's time to the effort. This includes efforts going back to 2000 over multiple Perl 6 related projects. As with our developer list on the Christmas release, our sincere apologies to anyone who was accidentally left off this list. * ActiveState * BBC * Blackstar * Booking.com * craigslist * Richard Dice of Toronto.pm * Dijkmat * Edument * ETH Zürich * Google Summer of Code (https://developers.google.com/open-source/gsoc/) * Ian Hague * Manning Publications * Morgan Stanley * Mozilla * NLNet * noris network AG * O'Reilly Media * Frédéric Schütz of the Swiss Institute of Bioinformatics * Stonehenge Consulting * The Perl Foundation * TPF's Perl 6 Core Development Fund sponsors (http://www.perlfoundation.org/perl_6_core_development_fund) * VA Linux * WenZPerl * Fritz Zaucker of Oetiker+Partner AG Upcoming releases in 2016 will include new functionality that is not part of the v6.c specification, available with a lexically scoped pragma. Our goal is to insure that anything that is tested as part of the v6.c spec will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, but please bear with us post-Christmas. We are working hard to insure that we don’t break anything now that we have a released spec, and it make take us a few months to settle back into a rhythm. The changes in this release are outlined below: New in 2016.01: + Chained .grep calls on Supply fixed (RT #127297) + Fixed interaction with perl6-debug and precompilation that resulted in an endless loop + re-enabled warning when smart-matching against a True or False literal + Fixed internal error when reporting certain type errors (RT #127207) + Fixed rare "duplicate definition of symbol" errors (RT #127107) + Fixed interpolating of pairs with non-key strings into signatures + Fixed error when smart-matching Seq against a Set (RT #127166) + Improved error message when smart-matching against an S///-expression + Fixed bad interaction between EXPORTHOW and multiple declarations (RT #126566) + Fixed various issues regarding precompilation + Improved accuracy of Complex.sqrt + hyper now preserves order of results, as designed + Range.sum on an empty, numeric Range is now 0 + Fixed Promise.allof() with an empty list of promises (RT #127101) + Improved message on premature virtual method call (RT #127097) + Better error message for module load failures of types that are part of the setting + Support for Readline in addition to Linenoise The following people contributed to this release: Geoffrey Broadwell, Piers Cawley, Paul Cochrane, Will "Coke" Coleda, Panu Ervamaa , Lloyd Fournier, Rob Hoelz, Donald Hunter, Dan Kogai, Tobias Leich, Moritz Lenz, Nick Logan, Dagfinn Ilmari Mannsåker, Elizabeth Mattijsen, Pawel Murias, Steve Mynott , Anthony Parsons, Nova Patch, Timo Paulssen, Francois Perrad, Dave Rolsky, Stefan Seifert, skids, John Spurr, Tommy Stanton, Jonathan Stowe, Larry Wall, David Warring, Andy Weidenbaum, Bart Wiegmans, Jonathan Worthington, Jimmy Zhuo If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#96), is tentatively scheduled for 20 February 2015. A list of the other planned release dates and code names for future 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what’s possible with Rakudo Perl 6 and provide feedback on what works, what doesn’t, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2016.02.md0000644000175000017500000000763413253717231015526 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #96 (2016.02) On behalf of the Rakudo development team, I’m very happy to announce the February 2016 release of Rakudo Perl 6 #96. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2016 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to insure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, but please bear with us post-Christmas. We are working hard to insure that we don’t break anything now that we have a released spec, and it make take us a few months to settle back into a rhythm. The changes in this release are outlined below: New in 2016.02: + Fixes: + Many memory leaks fixed in MoarVM + Set.hash now returns an object hash (RT #127402) + Use the order of arguments in usage display, rather than hash order + Specifying ::a now gives proper compile time error (RT #127504) + Enums with a type object now fail with an NYI error + .first(:end) on uncached iterators no longer fails + Additions: + REPL now supports multi-line statements (experimental) + Can now uninstall distributions + Efficiency: + Str.trans can now be up to 160x faster + @a.chrs now 3x faster, chrs(@a) now 9x faster These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. The following people contributed to this release: Elizabeth Mattijsen, Pawel Murias, Jonathan Worthington, Will "Coke" Coleda, Rob Hoelz, Moritz Lenz, Tobias Leich, Salvador Ortiz, Donald Hunter, Timo Paulssen, niner, Stefan Seifert, Aleks-Daniel Jakimenko-Aleksejev, Dave Rolsky, Jonathan Stowe, LLFourn, Nick Logan, okaoka, John Spurr, Páll Haraldsson, Carl Masak, Zoffix Znet, Sylvain Colinet, Andy Weidenbaum, Tommy Stanton If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#97), is tentatively scheduled for 19 March 2016. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what’s possible with Rakudo Perl 6 and provide feedback on what works, what doesn’t, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2016.03.md0000644000175000017500000001122113253717231015512 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #97 (2016.03) On behalf of the Rakudo development team, I’m very happy to announce the March 2016 release of Rakudo Perl 6 #97. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2016 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to insure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, but please bear with us post-Christmas. We are working hard to insure that we don’t break anything now that we have a released spec, and it make take us a few months to settle back into a rhythm. The changes in this release are outlined below: New in 2016.03: + Fixes: + Buf.push|append|unshift|prepend now can take int arrays + Better error messages when trying to put illegal values into Blob|Buf + The REPL now allows statements spread over multiple lines + No longer show compilation error twice when loading module with errors + Only Bufs can now be specified as parameter to subbuf-rw + Values in %*ENV now have allomorphic semantics + Supply.Channel / Channel.Supply no longer lose exceptions + Calling .prepend on a native array no longer infiniloops + Blob.WHICH now indicates a value (immutable) type + Better error reporting for problems with sprintf() + Some obscure unicode codepoints causing segfaults no longer segfault + Directory listings now handle wrongly encoded data using utf8-c8 + Additions: + Native str arrays (my str @a) + Buf.pop, Buf.shift and Buf.splice (similar to List.*) + Blob|Buf.allocate($elems, @init-pattern) + Buf.reallocate($elems) added + &*EXIT can be set to handle exit() statements (for embedding Perl 6) + Efficiency: + Auto-generated accessors/mutators use less memory and are faster + Most Blob|Buf related options use less memory and/or are (much) faster + Same for much of the native array support and IO reading operations + Many Parameter/Signature related options are much faster + Punning a role is much faster + Modules can now be shared between rakudo versions These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. The following people contributed to this release: Elizabeth Mattijsen, Jonathan Worthington, Pawel Murias, Timo Paulssen, Tobias Leich, Will "Coke" Coleda, Pepe Schwarz, Rob Hoelz, Salvador Ortiz, Donald Hunter, Moritz Lenz, Steve Mynott, Simon Ruderich, Nick Logan, skids, Jonathan Scott Duff, Andy Weidenbaum, Stefan Seifert, Gerd Pokorra If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#98), is tentatively scheduled for 16 April 2016. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. Rakudo Star is meant for early adopters who wish to explore what’s possible with Rakudo Perl 6 and provide feedback on what works, what doesn’t, and what else they would like to see included in the distribution. rakudo-2018.03/docs/announce/2016.04.md0000644000175000017500000000705313253717231015523 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #98 (2016.04) On behalf of the Rakudo development team, I’m very happy to announce the April 2016 release of Rakudo Perl 6 #98. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2016 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to insure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, but please bear with us post-Christmas. We are working hard to insure that we don’t break anything now that we have a released spec, and it make take us a few months to settle back into a rhythm. The changes in this release are outlined below: New in 2016.04: + Fixes: + "magic" inc/dec cleanup + utf8-c8 encoding crashes that occurred on random data + fix missing pre-comp store unlock + missing module error mentions line number + Additions: + Improved REPL + Add :kv to .first + Add provisional $*DEFAULT-READ-ELEMS + Efficiency: + Removed leaks associated with EVAL + Speed up .minpairs/.maxpairs + Speed up Object:D cmp Object:D + Speed up sort 3-15% These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. The following people contributed to this release: Pawel Murias, Elizabeth Mattijsen, Jonathan Worthington, Timo Paulssen, Will "Coke" Coleda, Rob Hoelz, Larry Wall, Pepe Schwarz, Moritz Lenz, Ahmad M. Zawawi, ab5tract, Christian Bartolomäus, Jonathan Scott Duff, Stefan Seifert, Salve J. Nilsen, 0racle, Steve Mynott, Brad Gilbert, Nelo Onyiah, Stéphane Payrard, bspecht, skids, Matthew Wilson, Leon Timmermans, David Warring If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#99), is tentatively scheduled for 21 May 2016. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2016.05.md0000644000175000017500000001014013253717231015513 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #99 (2016.05) On behalf of the Rakudo development team, I’m very happy to announce the May 2016 release of Rakudo Perl 6 #99. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2016 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to insure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The Rakudo Perl compiler follows a monthly release cycle, but please bear with us post-Christmas. We are working hard to ensure that we don’t break anything now that we have a released spec, and it make take us a few months to settle back into a rhythm. The changes in this release are outlined below: New in 2016.05: + Fixes: + Fix EVAL during precompilation + .substr fixes + many precompilation fixes + clean up error messages + Streamline some core classes + Harden Mu.Str against moving GC + JVM fixes + Simplify `$*USER`/`$*GROUP` initialization + Additions: + Ability to use a customer debugger module + `$*MAIN-ALLOW-NAMED-ANYWHERE` allows MAIN to be friendlier about where it accepts flags + Add richer set of comparison operators for Versions + Many improvements to precompilation - building OS packages with precomp'd code should now be possible! + Introduce .Map coercer + Implement alternate ways to call subtest + Efficiency: + Version comparisons are now 2x faster + List.minmax is about 3.5x faster + Num.perl is about 2.4x faster + Int division/modulus is about 1.5x faster + LoL accesses are about 3x faster + autothreader is about 2-3x faster + Make Any junction methods 14x faster + Make Junctions faster + Map.kv is about 10% faster These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. The following people contributed to this release: Elizabeth Mattijsen, Pawel Murias, Jonathan Worthington, Stefan Seifert, Timo Paulssen, Pepe Schwarz, Bart Wiegmans, Jimmy Zhuo, Will "Coke" Coleda, Leon Timmermans, David Warring, Christian Bartolomäus, Daniel Green, tomboy64, Moritz Lenz, Altai-man, Rob Hoelz, Zoffix Znet, Salvador Ortiz, Tom Browder, Ahmad M. Zawawi, Xliff, Matt Oates, Nick Logan, Jonathan Stowe If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#100), is tentatively scheduled for 2016-06-18. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2016.06.md0000644000175000017500000001030213253717231015514 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #100 (2016.06) On behalf of the Rakudo development team, I’m very happy to announce the June 2016 release of Rakudo Perl 6 #100. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2016 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . Notable changes in this release are outlined below: + Fixes: + Arrays with holes (e.g. from :delete) now correctly iterate/auto-vivify + Precompilation on file systems with coarse timestamps no longer fails + An issue with reverse dependencies of installed modules was fixed + Additions: + The "is-approx" sub from Test now allows for relative/absolute tolerance + A fail in a custom BUILD will now be returned, rather than thrown + Efficiency: + .map between 10% and 30% faster + .unique, .repeated and .squish 10% to 20% faster + gather/take about 10% faster + Basic object creation (using either .new or .bless) now up to 3x faster + (+@a), (*@a) and (**@a) signature handling between 20% and 4x faster + All routines now have less overhead, thanks to improved implementation of return handlers (including those that do not use return) + Deprecations: + The "is_approx" sub (note underscore) from Test + Potential issues: + There's been an unconfirmed report this release fails NativeCall tests when attempting to build an .rpm package. Basic evaluation showed packaged NativeCall still works fine and currently the cause of test failures is unknown. These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. The following people contributed to this release: Elizabeth Mattijsen, Jonathan Worthington, Jan-Olof Hendig, Zoffix Znet, Josh Soref, Pawel Murias, Wenzel P. P. Peppmeyer, Aleks-Daniel Jakimenko-Aleksejev, Tom Browder, Daniel Green, Jonathan Stowe, titsuki, Stefan Seifert, Pepe Schwarz, Christian Bartolomäus, Will "Coke" Coleda, Steve Mynott, Tobias Leich, Larry Wall, Timo Paulssen, Brock Wilcox, Moritz Lenz, Bruce Gray, raiph, LLFourn, Bart Wiegmans, Jimmy Zhuo, Steve Bertrand, Brad Gilbert, diakopter, Nick Logan, Sterling Hanenkamp, Carl Masak, Rob Hoelz, David H. Adler, David Warring, ab5tract, Christopher Bottoms If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#101), is tentatively scheduled for 2016-07-16. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2016.07.1.md0000644000175000017500000000624213253717231015664 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release 2016.07.1 On behalf of the Rakudo development team, I'm announcing an out-of-schedule release of the Rakudo Perl 6 compiler. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release is a point release in addition to the regular, monthly releases. Rakudo 2016.07 (note: no .1) was discovered to have issues with make DESTDIR[^3], which creates a problem for packagers. As this month will also see the next Rakudo Star[^2] release, based on the latest Rakudo, the development team decided it was worth it to make a point release fixing the packaging issues. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . Other changes since the 2016.07 release are also included in this point release: New in 2016.07.1: + Fixes: + `make DESTDIR` now correctly finds CompUnit::Repository::Staging + .polymod with a lazy list no longer loses mods if the list runs out + Output from Test.pm6's diag() is no longer lost in non-verbose prove output when called at the start of the test file or during TODO tests + Bitwise operators that return int/Int no longer fail with candidate error when given a native int argument + Additions: + Improved error message when IO::Path.new is given incorrect arguments + Improved error message when .polymod is given a zero as divisor + Efficiency: + Str.samecase is now 5x faster + Str.indices is 10% faster + Str.rindex is 30% faster + Str.index is 30% faster The following people contributed to this release: Zoffix Znet, Stefan Seifert, Elizabeth Mattijsen, Christian Bartolomäus If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#102), is tentatively scheduled for 2016-08-20. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? [^3]: See https://rt.perl.org/Ticket/Display.html?id=128652 The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2016.07.md0000644000175000017500000001245113253717231015524 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #101 (2016.07) On behalf of the Rakudo development team, I’m very happy to announce the July 2016 release of Rakudo Perl 6 #101. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2016 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2016.07: + Fixes: + Mu can now be the result of a Promise + samewith() now also works on none-multi's + Many fixes in the area of pre-compilation and installing modules + count-only and bool-only now are optional methods in Iterators (only to be implemented if they can work without generating anything) + IO::ArgFiles.slurp / IO::ArgFiles.eof are fixed + REPL whitespace and error handling + CompUnit::Repository::Installation no longer considers `bin/xxx` and `resources/bin/xxx` the same content address + min/max on Failures throw instead of returning ±Inf + NativeCall's is mangled trait no longer ignored for CPPStruct + Additions: + Support for new leap-second at 31-12-2016 added + The "is required" trait on Attributes can now take a Bool or a Str + IO::[Path,Handle] gained a .mode method which returns the POSIX file permissions + Distribution is now a role interface that enables encapsulating IO used for distribution installation + CompUnit::Repository::Installation now uses the new Distribution interface + Custom repository implementations now supported, including precompilation + Efficiency: + The MMD cache accepts candidates with named parameters if it can. (This made adverbed slices about 18x as fast) + Str.samemark is 50x faster + Str.contains is 6x faster + Baggy.pick(N)/pick()/roll()/grab() are 6x faster + Array.List is 5x faster + List.elems is 4.5x faster + for/map with 2 arguments is 4x faster (e.g. for @a.kv -> $i, $v { }) + Str.substr-eq is 4x faster + List.Bool is 4x faster + Map eqv Map is 3x faster + Make "for List.pairs {}" 2.5x faster + Array.pop is 2.5x faster + List.AT-POS/EXISTS-POS are 2.5x faster + Creating arrays with [] is 2.5x faster + Array.AT-POS/ASSIGN-POS/BIND-POS at least 2x faster for unreified elements + Array.DELETE-POS is 7x faster + Str.starts-with is 2x faster + Array.shift is 2x faster + Blob/Buf.AT-POS is 2x faster (underlying method of e.g. "$buf[2]") + List.STORE is 2x faster (e.g. "my ($a,$b,$c) = (1,2,3)") + Make "for List.kv {}" 1.8x faster + Array.push/append is 40% faster + Str.comb 30% faster + Map/Hash initializations are now 30% faster + A slurpy taking a list is 30% faster ("sub a(*@a) { }; a(1,2,3,4)") + Pair.new is 10% faster + {}|[]:adverb is 2.5x faster These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. The following people contributed to this release: Elizabeth Mattijsen, Zoffix Znet, Jan-Olof Hendig, Stefan Seifert, Tom Browder, Wenzel P. P. Peppmeyer, Pepe Schwarz, Brock Wilcox, Jonathan Worthington, Aleks-Daniel Jakimenko-Aleksejev, Pawel Murias, Will "Coke" Coleda, Daniel Green, Josh Soref, Nick Logan, Christian Bartolomäus, Salvador Ortiz, Altai-man, Jonathan Stowe, Timo Paulssen, Brad Gilbert, Moritz Lenz, Steve Mynott, David H. Adler, neuron, ianmcb, Tobias Leich, Matt Oates, Rob Hoelz, Altai-ch, LLFourn If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#102), is tentatively scheduled for 2016-08-20. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2016.08.1.md0000644000175000017500000000447113253717231015667 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release 2016.08.1 On behalf of the Rakudo development team, I'm announcing an out-of-schedule release of the Rakudo Perl 6 compiler. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release is a point release in addition to the regular, monthly releases. Rakudo 2016.08 (note: no .1) references a problematic NQP[^3] git tag. While testing did not reveal any issues when building 2016.08 Rakudo from scratch, users who pulled in new changes into existing repositories had build issues where the configuration script was failing to find that NQP tag. The 2016.08.1 NQP was released to fix the tag issues and Rakudo 2016.08.1 is being released as a pre-emptive measure. The tarball for this release is available from . New in 2016.08.1: + No changes, other than an updated build reference to the new NQP tag Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The next release of Rakudo (#102), is tentatively scheduled for 2016-08-20. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? [^3]: NQP stands for 'Not Quite Perl', which is a language/environment that Rakudo is largely written in. See https://github.com/perl6/nqp The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2016.08.md0000644000175000017500000002032313253717231015522 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #102 (2016.08) On behalf of the Rakudo development team, I’m very happy to announce the August 2016 release of Rakudo Perl 6 #102. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2016 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2016.08: + Fixes: + Numerous improvements to content of error messages and addition of new previously-undetected warnings, such as on sinks and ... terms + Concatenation/substr with strings constructed with repeat operator no longer results in incorrect strings + Fixed error for unknown symbol in parametric type + Fixed compilation and behaviour of :D on subsets + Assigning Nil to a :D variable now fails (unless its default is :D) + Fixed merge global symbols failures when changing repositories + Fixed -Ilib and friends not overriding installed dependencies + Fixed <[a..z]> ranges breaking grapheme awareness + Fixed a race condition in Channel.Supply + Fixed an occasional deadlock when using the supply/react syntax + Fixed a race condition involving tearing down listening async sockets + @a.splice now returns array with correct descriptor + Range.rotor with Rat arguments no longer crashes + .hash on Bag, Mix, BagHash, and MixHash types no longer stringifies keys + .abspath on filenames starting with '-' no longer results in empty string + loop and repeat now properly self-sink + for { ... .map } now properly sinks + Bool.Int now properly returns an Int + Starting the REPL with a module loading error, will now just exit + Fixed loading of modules when a FileSystem repo doesn't actually exist + Additions: + Str.samemark('') now returns self instead of failing + Test.pm now provides bail-out() + Added PERL6_TEST_DIE_ON_FAIL env var in Test.pm6 to bail out of the test suite on first failure + Implemented $?MODULE and ::?MODULE + Implemented CompUnit::Repository::Installation::installed + .min/.max can now be called on Hashes + Invocant marker (:) can now be used in bare signatures + Added X::Syntax::NonListAssociative exception type + Buf.push|append|unshift|prepend also allow Blob:D + .succ now increments additional 29 digit ranges, such as Thai digits + Implemented :exists on multi-dim assoc subscript literals + Efficiency: + Improved dynamic variable lookup (2x as fast) + Hash.AT-KEY is about 35% faster + Hash.ASSIGN-KEY about 2x as fast + Hash.DELETE-KEY about 2x as fast + Hash[Any,Any].AT-KEY about 20% faster + Hash[Any,Any].ASSIGN-KEY about 15% faster + Hash[Any,Any].BIND-KEY about 15% faster + Hash[Any,Any].EXISTS-KEY about 10% faster + Hash[Any,Any].DELETE-KEY 10% faster + Repeated calls on Bag.WHICH now 5x as fast + Backtrace creation 25% faster + .first/.first(:end) iteration is now about 10% faster after testing 1000 elements + .minmax about 25% faster + .min/.max about 40% faster + min/max/minmax on native arrays is between 15x and 25x faster than non-native equivalent + Array.splice() almost infinitely faster and is much easier on memory (no longer copies anything but instead transplants internals) + Array.splice(offset,size) is now 20x to 40x faster for small offsets and sizes + Array.splice(offset,size,@) is about 10x faster + 10% improvement to .map/for in special cases of one-argument block that has a return signature that excludes Slips, such as -> Int $_ --> Str { .Str } + Many Set/SetHash methods are now at least 5% faster + Coercing a MixHash/BagHash to a Mix/Bag is now 300x faster + Coercing a Bag/BagHash to Mix coercion is now 1000x faster + Coercing a SetHash to a Set is now 80x faster These are only some of the changes in this release. For a more detailed list, see “docs/ChangeLog”. The following people contributed to this release: Zoffix Znet, Wenzel P. P. Peppmeyer, Elizabeth Mattijsen, Pawel Murias, Jonathan Worthington, Altai-man, Larry Wall, Tom Browder, Will "Coke" Coleda, Jan-Olof Hendig, Stefan Seifert, Moritz Lenz, Itsuki Toyota, Christopher Bottoms, Aleks-Daniel Jakimenko-Aleksejev, Christian Bartolomäus, Sterling Hanenkamp, Timo Paulssen, Steve Mynott, Claudio Ramirez, LemonBoy, Brian S. Julin, Clifton Wood, Daniel Green, Brian Duggan, Nick Logan, LE Manh Cuong, Pepe Schwarz, Daniel Dehennin, cognominal, David Warring, LLFourn, smls, Jonathan Stowe, Jimmy Zhuo, Brent Laabs, Trey Harris, nsvedberg, Bill Barry, 0racle, dmaestro, Eike Frost, ab5tract Regrettably, a deficiency has been discovered in the contributor gathering script, where it silently left out contributors to perl6/doc repository, if the release manager did not have it checked out at a specific location. Due to this, those contributors very likely have been accidentally left out from previous announcements. Since Christmas 2015, the following people contributed to our ever-improving documentation: Wenzel P. P. Peppmeyer, Zoffix Znet, Jan-Olof Hendig, Tom Browder, Aleks-Daniel Jakimenko-Aleksejev, Altai-man, Jonathan Stowe, Josh Soref, Will "Coke" Coleda, Steve Mynott, Elizabeth Mattijsen, Brian S. Julin, Daniel Green, Itsuki Toyota, Moritz Lenz, Brock Wilcox, Simon Ruderich, Christopher Bottoms, raiph, Sterling Hanenkamp, Ahmad M. Zawawi, Daniel Perrett, Claudio Ramirez, David Brunton, Jonathan Worthington, Jake Russo, Salvador Ortiz, Siavash Askari Nasr, Bruce Gray, jjatria, John Gabriele, Paul Cochrane, Jim Davis, Timo Paulssen, sylvarant, David H. Adler, Sylvain Colinet, Donald Hunter, LLFourn, Shlomi Fish, Tobias Leich, Eric de Hont, Mathieu Gagnon, parabolize, Brian Duggan, Jason Cole, dogbert17, Fritz Zaucker, cognominal, Marcel Timmerman, Larry Wall, Dave Olszewski, Dabrien 'Dabe' Murphy, smls, Emeric54, ab5tract, Jeffrey Goff, VZ, okaoka, Steve Bertrand, ianmcb, Daniel Dehennin, vinc17fr, Dave Rolsky, Matt Oates, Trey Harris, Nat, Altai-ch, nsvedberg, Bill Barry, fireartist, 0racle, Robert Newbould, Coleoid, Brad Gilbert, James ( Jeremy ) Carman, Stéphane Payrard, Dale Evans, Nick Logan, thundergnat, dmaestro, Carl Masak, Eike Frost, Martin Dørum Nygaard, gotoexit, Neil Shadrach, Stefan Seifert If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. The next release of Rakudo (#103), is tentatively scheduled for 2016-09-17. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2016.09.md0000644000175000017500000001577513253717231015542 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #103 (2016.09) On behalf of the Rakudo development team, I’m very happy to announce the September 2016 release of Rakudo Perl 6 #103. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2016 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2016.09: + Fixes: + Various improvements to the content of error messages + Defaults on a slurpy params now throw instead of crashing at the VM level + Distribution::Path now handles native libraries correctly + Junctions now work in .classify + Control statements (e.g. `next`) in toplevel REPL now show useful error + IO::Handle.encoding now returns correct values + .comb/.split on binary handles now throws X::NYI + Fixed filehandle leak in precompilation + Regex in .grep and .first on Pairs now works correctly + Pod parser returns proper Bool instead of Int on passed config options + Fixed PERL6_TEST_DIE_ON_FAIL=1 exiting the test suite too soon or dieing on failing tests inside TODOed subtests + Fixed failure to accept enums as types for optional arguments + Fixed blocking bug when using socket accept and threads + Fixed fatal bug when using Non-ASCII tokens in regex/grammars + Fixed missing adverbs and candidates in Cool.split; made same as Str.split + Fixed missing adverbs in Cool.trans; made same as Str.trans + Fixed NativeCall CArray hanging when created from empty list + Fixed various issues with reading chars from an async socket (uncatchable exceptions on decode errors, and mis-handling of graphemes and multi-byte sequences over packet boundaries) + Fixed "%%foo @@bar" interpolation trying to find %foo and @bar variables + Fixed mis-compilation and possible compiler crash when using a construct like /$=@(1,2)/ + Fixed a memory leak involving EVAL + Fixed a multi-dispatch cache unbounded growth bug involving calls with many named arguments + Fixed warnings emitted when using hyper operators on two hashes + Channel.elems now returns a Failure rather than eating all values + Fixed type error ion IO::Path.rw + Fixed …, ???, and !!! yadas not working to stub classes + Fixed tab-completion issues with non-identifiers in REPL + Additions: + Coercions now work in return types + Added RAKUDO_EXCEPTIONS_HANDLER env var to control exceptions output + IO::Handle.slurp-rest now has :close flag + CompUnit::Repository::Installation now cleans up short-name folders when empty + Added support for very large numbers in :42foo colon pairs + Added a .Map coercer for object hashes + All Unicode quotes can now be used as quoters inside qqww/qww + LEFT/RIGHT DOUBLE PARENTHESIS characters can now be used with q and others + Unicode digits can now be used with Match variables ($١), quote pairs (:۳<12>), negative numbers (-١), and radix bases (:۳("22")) + Efficiency: + Numerous improvements in CUR, offering up to 10x faster module loading + Baggy.ACCEPTS(Baggy) is now about 25x faster + Baggy eqv Baggy is now at least 10x faster + Infix === now checks identicality, offering performance gains on large objects, such as a Bag with 1000 elements + Many metaops are now about 10% faster + Made Junction.Bool|ACCEPTS about 2x faster + Improvement in performance of IO::Path::child + Made permutations() about 5x faster + Made List.permutations about 40x faster + Made combinations() about 1.8x faster + Made List.combinations about 7x faster + Made Unix's canonpath several times faster for simple paths + Made Buf|Blob.reverse 1.5x faster + Made .IO.lines about 10% faster on large files + Changed APIs: + The operator precedence configuration rule `O()` has been changed to be more precompilation-friendly; rather than taking a string containing colonpairs, it now takes named arguments directly. This is not strictly a Perl 6 change, but rather a change in NQP, and thus only applies if you're doing fairly involved hacking on the grammar. If the sentences above made no sense to you, your code is not affected by this change. The following people contributed to this release: Zoffix Znet, Elizabeth Mattijsen, Jonathan Worthington, Daniel Green, Tom Browder, Jan-Olof Hendig, Will "Coke" Coleda, Stefan Seifert, LemonBoy, Pawel Murias, Timo Paulssen, Itsuki Toyota, Christian Bartolomäus, Arne Skjærholt, Moritz Lenz, Jonathan Stowe, Rob Hoelz, Armand Halbert, Brock Wilcox, Wenzel P. P. Peppmeyer, Larry Wall, Altai-man, Steve Mynott, Nick Logan, Aleks-Daniel Jakimenko-Aleksejev, Thor Michael Støre, Jonas Kramer, Douglas L. Schrag, cygx, dmaestro, Sterling Hanenkamp, Leon Timmermans If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#104), is tentatively scheduled for 2016-10-15. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2016.10.md0000644000175000017500000001621613253717231015521 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #104 (2016.10) On behalf of the Rakudo development team, I’m very happy to announce the October 2016 release of Rakudo Perl 6 #104. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2016 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2016.10: + Fixes: + Many fixes and additions improving JVM backend support + Several improvements to error messages + Fixed .tree([&first]) incorrectly calling .tree($count) candidate + Fixed unwanted errors when smartmatching objects against IO::Path + Fixed is-deeply with Seqs showing Seq.new-consumed() in failure text + Fixed concurrency race when setting up NativeCall routines + Fixed Match.list treating inner unmatched captures as end of list + .first now correctly handles Junction matchers + Fixed GLOBAL symbol clash re-compiling due to a repo change + Fixed Backtrace.map candidate being uncallable + Fixed multiple bugs in Hash/Baggy.classify-list/categorize-list + Fixed PERL6_TEST_DIE_ON_FAIL not exiting on failed subtests + Fixed autovification using Junctions as keys + Fixed infix:<^^>(Mu, Callable) candidate being uncallable + Fixed IO.l for dangling symlinks + Fixed infinite recursion in duckmap when mapper returned Any + Fixed .subst/.subst-mutate treating incorrect arguments as failed matches + Fixed .subst-mutate not returning all matches with :x + Fixed hang on smartmatching Promises against numerics + Fixed failure to smartmatch Numeric:U against Numeric:D + Fixed hang on incorrect .splice arguments + Fixed hang on incorrect .split offset + Fixed multi-argument WhateverCode not detected in double closures + Fixed Baggy:U ~~ Baggy:D emitting gut-referencing warnings + Fixed uncallable Dateish.IO + Fixed Exceptions::JSON for exceptions with no `message` method + Fixed Exceptions::JSON for exceptions with non-JSON-friendly attributes + Proc::Async decoding exceptions are now catchable + Prevented return handler being optimized out in `sub { 42.return }()` + Fixed error reporting when trying to invoke a native parameter + Fixed uncallable 0- and 1-arg candidates of infix: + Fixed Cool.match not setting $/ + Fixed Cool:U.IO coercion emitting internal warnings + Fixed Nil.chrs failing when called + Num:U++ now returns a Num zero instead of an Int one + Removals: + Removed argument-taking Dateish candidates for is-leap-year, days-in-month, and day-of-week [were never part of the spec] + Cool.IO no longer accepts any arguments + Overflow check has been removed from infix:<**>(int, int) + Additions: + Added basic Unicode 9 support (NFG changes for latest TR#29 still to do)) + X::Proc::Unsuccessful now includes command that was run + IO::Handle.new now uses 'utf8' encoding by default + Bare `put` now requires parentheses to call as sub + .head/.tail with no arguments now return the item and not a 1-item List + Added basic native attribute parameter binding + Made nativecast and spurt multies + Added .^elems metamodel method to enums + Enums can now be used to declare array shapes + Added X::Invalid::ComputedValue exception + Throw when dereferencing a null pointer in NativeCall + It's now possible to refer to sigiless parameters inside `where` clauses + Added extra candidates to .splice to allow for all combinations of Int|Whatever|Callable for both $start and $elems arguments + Made enums able to typecheck against the roles they do + Made Complex.new() return 0+0i + Int.new can now handle any value that can .Int + Added shortname() method to CurriedRoleHOW + Proc::Async new, stdout, and stderr methods now take :enc + IO::Socket::Async listen, connect, and Supply methods now take :enc + .Date and .DateTime are now supported on :U/:D Date/DateTime + Trailing empty cells can now be omitted in Pod tables + Mix/MixHash with non-Int weights can now be coerced to .Bag/.BagHash + Efficiency: + Made List.reverse about 5% faster + Made auto-threading about 10% faster + Made huge improvement to CUR::Filesystem.id performance + Made dir() about 20% faster + Made Regex.Bool about 2x as fast + Made Str.match about 3% faster The following people contributed to this release: Zoffix Znet, Pawel Murias, Elizabeth Mattijsen, Wenzel P. P. Peppmeyer, Jonathan Worthington, Will "Coke" Coleda, Pepe Schwarz, Christian Bartolomäus, Tom Browder, Daniel Green, Jan-Olof Hendig, Jonathan Stowe, Luca Ferrari, Stefan Seifert, Tobias Leich, Itsuki Toyota, Moritz Lenz, Francis Grizzly Smit, Sterling Hanenkamp, Cuong Manh Le, Aleks-Daniel Jakimenko-Aleksejev, Alexis, Bart Wiegmans, Garrett Goebel, Brian S. Julin, David Warring, Salve J. Nilsen, Nic, Larry Wall, Altai-man, Timo Paulssen, cygx, raydiak, Dominique Dumont, dogbert17, Harrison Chienjo, LLFourn If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#105), is tentatively scheduled for 2016-11-19. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2016.11.md0000644000175000017500000003045413253717231015522 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #105 (2016.11) On behalf of the Rakudo development team, I’m very happy to announce the November 2016 release of Rakudo Perl 6 #105. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2016 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2016.11: + Fixes: + Various improvements to warning/error-reporting + Fixed assigning values to shaped arrays through iterators [839c762] + Fixed Str.Int not failing on numerics with combining characters [d540fc8] + [JVM] Fixed .antipairs breakage [dd7b055] + defined routine now correctly authothreads with Junctions [189cb23] + Fixed poor randomness when .pick()ing on ranges with >32-bit numbers [34e515d] + Fixed infix: silencing Failures [2dd0ddb] + Fixed edge case in is-approx that triggers DivByZero exception [f7770ed] + (Windows) Fixed returning of an error even when succeeding in mkdir [208a4c2] + (Windows) Fixed precomp unable to rename a newly compiled file [44a4c75] + (Test.pm) Fixed indent of multi-line diag() and test failure messages [43dbc96] + Fixed a callframe crash due to boxing of NULL filenames [200364a] + ∞ ≅ ∞ now gives True [4f3681b] + Fixed oversharing with grammars used by multiple threads [7a456ff] + Fixed incorrect calculations performed by acotan(num) [8e9fd0a] + Fixed incorrect calculations performed by asinh(num)/acosh(num) [a7e801f] + Fixed acosh return values for large negative numbers [5fe8cf7] + asinh(-∞) now returns -∞ instead of NaN [74d0e36] + atanh(1) now returns ∞ instead of throwing [906719c][66726e8] + Fixed missing close in IO::Path.slurp(:bin) [697a0ae] + :U QuantHashes now auto-vivify to their correct type and not Hash [79bb867] + Mix/MixHash.Bag/BagHash coersion now ignores negative weights [87bba04] + arity-0 infix: now returns a Seq instead of a List [3fdae43] + Fix augment of a nested package [87880ca] + Smartmatch with Regex variable now returns a Match instead of Bool [5ac593e] + Empty ()[0] now returns Nil instead of False [f50e39b] + Failed IO::Socket::Async connection no longer produces unexpected crash [f50e39b] + Quitting Supplies with no QUIT phasers no longer unexpectedly crash [f50e39b] + Fixed NativeCall issues on big endian machines [627a77e] + Fixed broken handling of $/ in some uses of `.match` [ba152bd] + Fixed Lock.protect not releasing the lock on control exceptions [48c2af6] + MoarVM now builds on any version of macOS [b4dfed2] + Fixed concurrency crashes due to garbage collection [6dc5074] + Fixed race condition in EmptyIterator [ed2631c] + Fixed hang with multi-threaded long-running NativeCall calls [f99d958] + Made my @a[10] = ^Inf work [aedb8e7] + Fixed [;]:delete [3b9c4c9] + Fixed incorrect handling of negative weights in ∪ operator [e10f767] + duckmap now preserves types of Iterables [43cb55f] + Fixed premature overflow to Inf with large Num literals [729d7e3] + Fixed race condition in NativeCall callsite used by multiple threads [49fd825] + Fixed instabilities in programs launching many threads at startup [0134132] + Fixed crash when reporting X::Composition::NotComposable or X::Inheritance::Unsupported exceptions [a822bcf] + Fixed clock_gettime issue on macOS [ee8ae92] + Fixed SEGV in multi-threaded programs with strings-as-strands [395f369] + `regex` TOP Grammar rule will now backtrack if needed [4ccb2f3] + Fixed .rotate/.reverse on 1-dimmed arrays assigning to self [2d56751] + Fixed exponentiation involving zeros for Complex numbers [7f32243] + Fixed Label.gist [29db214][53d7b72] + Fixed certain edge cases of incorrect stringification of Rationals with .Str, .perl, and .base [b5aa3c5] + Additions: + Added TWEAK submethod for object construction [fdc90a2][9409d68] + Added DateTime.hh-mm-ss [bf51eca] + Added parse-base routine [7e21a24] + is-approx with no explicit tolerances now uses more complex algorithm to choose a tolerance to use (same as old is_approx) [82432a4] + on failure, is-approx now displays actual values received [b4fe680] + Added Iterator.skip-one to skip a single value [71a01e9] + Added Iterator.skip-at-least to skip several values [8d357af] + Re-imagined Str.match [b7201a8]: + the family of :nth is now lazy will return whatever can find + non-monotonically increasing :nth iterator values will now die + Str.match/subst/subst-mutate now have :as adverb [1b95636][c9a24d9][aaec517] + &infix: now works with Setty objects [d92e1ad] + :ov and :ex adverbs are now illegal in Str.subst [b90c741] + Made nextwith/samewith/nextsame/callwith to be real subroutines [70a367d] + Added CX::Emit and CX::Done control exceptions [07eeea8] + Setty.Mix/.MixHash coercers now use Int weights instead of Bool [7ba7eb4] + Implemented :kv,:p,:k,:v on 1-element multidim [;] [764cfcd] + .chrs can now also accepts codepoint numbers as Str [4ae3f23] + Added support for compilation of Rakudo on Solaris [a43b0c1] + IterationEnd.perl/gist/Str now returns text "IterationEnd" [59bb1b1] + Added X::Syntax::Number::InvalidCharacter exception [2faa55b] + .reverse/rotate on 1-dimmed arrays are now nodal [cd765e6] + .line and .file on core Code now references original source files [b068e3a] + .rethrow now works on unthrown exceptions [58a4826] + All Reals now accept `Whatever` as the second argument to .base() [c1d2599] + sub MAIN usage message shows possible Enum values if param is named and is an Enum [a3be654] + Efficiency: + Made slip(@a) about 1.2x faster [37d0e46] + Made initialization of 2+dimmed array 10x to 16x faster [dfb58d4] + Str.match is now about 5% faster [4fc17df] + Str.match with :nth feature is now about 2x faster [41e2572] + my @a = Str.match(...) is now about 5% faster [e472420] + Str.comb(Regex) is now about 7x faster [1794328] + Simple Str.subst/subst-mutate is now about 30% faster [364e67b] + Match.Str|prematch|postmatch is now about 2x faster [e65d931] + Match.Bool is now about 1% faster (not much, but used a lot) [1fce095] + Made ~~ /foo/ faster: 2% for successful/6% for failed matches [05b65d0] + Made ~~ /foo/ about 2x faster [e4dc8b6] + Made %h ~~ /foo/ about 2x faster [33eeb32] + Frequent accesses of multiple adverbs (e.g. %h:p:exists) is now 2x faster [f22f894] + Made infix: faster: Str: 14x, type: 10x, Range: 3.5x, Int|Seq|Hash: 1.5x, Array: 1.2x [bc7fcc6] + IO::Spec::Unix.canonpath is now 7x to 50x faster [f3f00fb] + Baggy.roll/pick is now about 10% faster [fc47bbf] + Made copying shaped arrays 10x to 20x faster [a1d8e93][0cf7b36][d27ecfa] + Made setting up a shaped array 2x as fast [f06e4c3] + Made creation of typed shaped arrays 15% faster [f5bf6c1] + Made 2d/3d array accesses about 7x as fast [d3a0907] + Made AT-POS on 1,2,3dim arrays about 20x faster [feb7bcb] + Made creating a shaped array about 50% faster [1293188][576f3a1] + Made .AT-POS on 3+ dimmed arrays 20% faster [1bb5aad] + Made over-indexed .AT-POS on 1,2,3 dimmed arrays about 10% faster [1bb5aad] + Made multi-dimmed ASSIGN-POS about 30% faster [5b2bdeb] + Made .ASSIGN-POS for 1,2,3dimmed arrays about 40x faster [050cf72] + Made n-dimmed .EXISTS-POS about 1.5x faster [006f008] + Made .EXISTS-POS for 1,2,3dimmed arrays about 10x faster [b1c41b7] + Made n-dimmed DELETE-POS about 1.3x faster [6ccecb1] + Made .DELETE-POS for 1,2,3dimmed arrays about 20x faster [55b9e90] + Made n-dimmed BIND-POS about 1.3x faster [2827edb] + Made .BIND-POS for 1,2,3dimmed arrays about 20x faster [9f94525] + Made @a[10].STORE at least as fast as @a.STORE [8064ff1] + Made .kv on shaped Arrays about 4x faster [e42b68e] + Made .pairs/.antipairs on shaped Arrays about 2.8x faster [0f2566a][f608a33] + Made List.kv about 30% faster [7a2baf4] + for loops on 1-dimmed arrays are now 3x faster [ed36e60] + .kv on 1-dimmed arrays is now 7x faster [608de26] + .pairs/.antipairs on 1-dimmed arrays is now 3x faster [b7d9537][1c425f9] + postcircumfix[;] on 2/3 dimmed arrays is now 9x faster [0b97362] + Assignment to [;] for 2/3 dimmed arrays is now 10x faster [ce85ba3] + [;]:exists for 2/3 dimmed arrays is now 7x faster [e3e3fef] + [;]:delete for 2/3 dimmed arrays is now 10x faster [3b9c4c9] + [;] := foo for 2/3 dimmed arrays is now 10x faster [eaf4132] + .iterator and .values on shaped arrays are now about 4x faster [736ab11] + Fixed optimization of shaped arrays that gives 10% gain on simple `for` loops and likely will give larger gains on bigger programs [b7e632e] + Made starting MappyIterator faster, affecting all Hash/Map/Baggy iterator methods. 2-elem Hash iteration is 1.6x faster [97fb6c2] + Made starting a grepper faster: .grep on with no adverbs on 2-element list is now 20% faster [077c8f0] + Made Date/DateTime creation 20% faster [0e7f480] + Hashes now use 4 (32-bit) or 8 (64-bit) bytes less memory per stored item [395f369] + Rational.Str is now about 40% faster [b5aa3c5] + Rational.base is now about 30% faster [b5aa3c5] + Various streamlining of code that's hard to measure the final impact of The following people contributed to this release: Elizabeth Mattijsen, Zoffix Znet, Will "Coke" Coleda, Pawel Murias, Jonathan Worthington, Wenzel P. P. Peppmeyer, Christian Bartolomäus, Daniel Green, Tom Browder, Will Coleda, Timo Paulssen, Tobias Leich, Jan-Olof Hendig, cpin, adaptiveoptics, Francis Grizzly Smit, Brock Wilcox, Moritz Lenz, seatek, Altai-man, ab5tract, Stefan Seifert, Aleks-Daniel Jakimenko-Aleksejev, Sterling Hanenkamp, Vynce Montgomery, David Warring, Athos Ribeiro, Paul Cochrane, Samantha McVey, Geoffrey Broadwell, Jonathan Stowe, Nic, Vladimir Marek, Larry Wall, Garrett Goebel, Pepe Schwarz, raiph, bazzaar, Clifton Wood, Carl Masak, Dominique Dumont, samcv, David H. Adler, José Albert Cruz Almaguer, Harrison Chienjo If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#106), is tentatively scheduled for 2016-12-17. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2016.12.md0000644000175000017500000002426113253717231015522 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #106 (2016.12) On behalf of the Rakudo development team, I’m very happy to announce the December 2016 release of Rakudo Perl 6 #106. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2016.12: + Fixes + Fixed inability to autocurry superscript exponents properly [c35d562] + Fixed Match.prematch and Match.postmatch for zero-width matches [c04b8b5] + Fixed Match objects being erroneously treated as value types [7f26e8b] + Made U+2212 minus work in places it didn't [cb9df2b][01775b7][6cd2144] + prefix:<~> now calls .Str on Str types (helps with allomorphs) [e0a415f] + Fixed errors in `$*ARGFILES.lines` limit counter [bd42363] + Fixed bug with add history for Readline module in REPL [f544e4c] + sum and [+] metaop now correctly work on Junctions [8d04bec] + Fixed various scoping bugs with NEXT/LAST/QUIT [6bb8823] + Fixed issues in QUIT handlers running asynchronously [c027e6a] + Fixed occassional hangs in Proc::Async [e4d78c6] + Fixed operations still running after supply deactivation [f928a20] + Fixed Iterator.flat occasionally skipping inner iterables [61a18c0] + Fixed slurp not propagating :bin and :enc args on `$*ARGFILES` [15f51a5] + Fixed negative zero handling in many places [f1263ab][e2587cd][a9654c0][085145f] + Synthetics in numbers in colonpairs in :42foo format now throw [4663d43] + Fixed hang in .subst with no arguments [0a874fb] + Fixed sleep() with huge values failing to sleep [c797d3f][7c5ea31][2f72fa0] + Fixed attributive binding not looking outward for `self` [843a6be] + Fixed sprintf($format) without args issuing spurious warnings [35183f3] + Fixed infix:<===> failing when both sides are allomorphs [4a59ab4] + Fixed data race in Supply.interval [47ffdea] + Fixed data races in supply/whenever [33f7456] + Fixed memory corruption in Proc::Async [74eb6b9] + Fixed handling of time resolutions below 1ms in Supply.interval [c38f1ad] + Fixed issues with `-Inf` being a single term [ae614f9] + Fixed Signature.gist stripping sigils from anon typeless scalars [219f527] + Made permutations/combinations/grep die instead of fail()ing [ab3a59c][bc13bb5] + Fixed spurious warnings on .trans with regex pair complements [2e1b82c] + Fixed premature frees in async sockets when errors occur [b2ac4e4] + Fixed handling of superscript powers larger than int [0428b79] + Fixed Proc::Async sending empty string to taps on program exit [7532297] + Fixed wrong results for .first on Numerics [8cb3e1b] + Fixed matcher-less .first not respecting its adverbs [ababb24] + Fixed `sink` statement prefix failing to explode Failures [345f6a7] + Fixed regression in S:g/// not returning original string [5476d60] + Reverted .match/.comb to return empty List instead of Empty when failing to match [5476d60] + Fixed Mu.clone incorrectly marking all attributes as initialized [9a161fa] + Fixed cloned Baggy having an undefined .WHICH [9a161fa] + Fixed smartmatching against UInt type object [f9d34a9] + Fixed some Date constructors accepting invalid dates [aa27d5c] + Fixed .rotor on empty list returning an internal iterator object [5558710] + Fixed unimatch to check canonical short/alternate unicode props [b456471] + Fixed uniprop to return correct values for na, uc, tc, lc properties [2a8ec40] + Fixed uniprop for 'Numeric_Value' not returning a numeric value [9ff5b7e] + Fixed crash with Rat Ranges constructed with Range ops [1d46004] + Fixed crash with tapping supplies supplied by thunked block [a980eb1] + Fixed .perl on parametarized Hashes with no items in them [003e654] + Fixed .perl for itemized Slips [8eef234] + Fixed chained `andthen`/`orelse` operators returning internals [287af6a] + Fixed ThreadPoolScheduler.cue not applying delays to all cues [b286048] + Fixed control exception propagation when thrown from within statements handled by `without`, `with`, `andthen`, or `noandthen` [9a3c350] + Fixed Rand.rand generating value equal to excluded end point [334d134] + Fixed `last` not working inside .grep's block [7021861][f775474] + Fixed .head not always returning a .Seq [69d808f] + Various fixes and improvements in error reporting + Additions: + Bare \b, \B, and \K in regexes now throw [08589d3][ee14067] + Added SQL as an output option for --profile-filename [f20b8b6] + Implemented native str Arrays [014d4cf][6d726f8] + sub MAIN now allows Enums as type constraints [546dbd9] + Count in .pick/pickpairs/grab/grabpairs can now be a Callable [e9487d6] + REPL with Readline module now loads `inputrc` files [573ed59] + REPL with Readline module now saves history [9043f58] + perl6 --doc=Text now shows signature parameter pod [6ea6563] + Generated sub MAIN usage message now shows original program name [b597b7c] + Added arity-1 infix:<~> for Blobs [77e9d4b] + Added IO::Handle.printf [8774f24][3c4ac3c] + Added ability to negate all numeric literals in signatures [5baa064] + Added .reverse/.rotate/.sum to shaped 1-dimmed arrays [a2ede36][4f4737d] + Added Mu.emit [4e76827] + Added --with-nqp Configure option for having NQP in a different prefix [6f6e6db] + Added .gist, .perl, and .Str to BOOTSTRAPATTR [3dd2916] + Made .sum nodal [4fd6e94] + Implemented uniprops [f55ff82][0328422][05db996] + Added 5 new sets of matching brackets for available delimiters [8965145] + Removals: + Removed X::Syntax::Number::InvalidCharacter exception [a8ff3b9] + Efficiency: + Made indirect type lookup 3x as fast [939d273] + Made shaped(int|num|str)array.AT-POS at least 15% faster [bfe89a5] + Made shaped(int|num|str)array.ASSIGN-POS at least 10% faster [ecc202e] + Made shaped(int|num|str)array.EXISTS-POS at least 20% faster [bbbb2b6] + Made 1-dimmed native arrays at least 3x faster [4a711bc] + Made native shaped array creation about 1.5x faster [1b840f1] + Made native 1-dimmed array init at least 11x faster [b6de5e8] + Made native 1-dimmed array copying at least 25x faster [b6de5e8] + Made use of native 2-dimmed arrays 2.5x–4x faster [172898e] + Made use of native 3-dimmed arrays 2.5x–4x faster [64343d7] + Made copying 1+ dimmed native arrays up to 9x faster [e0c0ae5][331c2e2] + Made copying intX[2;2] to intY[2;2] native array just as fast as copying intX[2;2] to intX[2;2] [79090b2] + Made native shaped array initialization 4x–6x faster [d704820] + Made iteration of 1-dimmed native arrays 17x faster [947422b] + Made iteration of >1 dimmed native arrays 11x faster [3e93ddd] + Made .(anti)pairs for native shaped arrays 7x faster [39261e7][471cea2] + Made .kv for native shaped arrays 16x faster [965fa4d][c1a3a3c] + Made native array.reverse|rotate about 20x faster [0ee6bc0] + Made @a[2;2] about 40% faster [b9e2ffa] + Optimized Int->int coercion [b2ac4e4] + Made infix:<..> on Nums 13x faster [a8ba26b] + Made uniprop with the default lookup 5x faster and other lookups 15% faster. [474ea33] + Made print, say and note 25% faster to stderr and stdout [e9ce28a] The following people contributed to this release: Zoffix Znet, Pawel Murias, Elizabeth Mattijsen, Wenzel P. P. Peppmeyer, Will "Coke" Coleda, Samantha McVey, Altai-man, Jonathan Worthington, Stefan Seifert, Daniel Green, Christian Bartolomäus, ZzZombo, Aleks-Daniel Jakimenko-Aleksejev, Jan-Olof Hendig, Moritz Lenz, Tom Browder, Itsuki Toyota, Larry Wall, Bahtiar `kalkin-` Gadimov, seatek, Pepe Schwarz, Paul Cochrane, Brian Gernhardt, Ronald Schmidt, Daniel Mita, 0racle, Timo Paulssen, Jonathan Stowe, Fernando Correa de Oliveira, Steve Mynott, Douglas L. Schrag, Jonathan Scott Duff, Donald Hunter, Siavash Askari Nasr, Paweł Murias, Breno G. de Oliveira, bazzaar, cygx, francois, Lucas Buchala If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#107), is tentatively scheduled for 2017-01-21. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.01.md0000644000175000017500000003277613253717231015533 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #107 (2017.01) On behalf of the Rakudo development team, I’m very happy to announce the January 2017 release of Rakudo Perl 6 #107. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.01: + Fixes: + Fixed importing globals nested in imported packages [85d8b14] + Fixed "Object of type A in QAST::Var value, but not in SC" [43d20eb] + Fixed use Foo::Bar; class Foo {my Foo::Bar $bar} not finding Foo::Bar [5c4db5e] + Fixed class Foo { use Foo::Bar; my Foo $foo; } not finding Foo [226cb36] + Fixed our scoped nested package swallowed by lexically scoped parent [85b9d8a] + Fixed imported nested enum colliding with symbols from outer scope [a962928] + Multiple methods that return listy things now throw instead of failing to avoid accidental Failure silencing through 1-elem lists [99e33fc][bd4e1f4] + Made List.roll always return a Seq [bd4e1f4] + Fixed SEGVs and GC panics in certain deep recursions [58c79e2] + Fixed detection of runtime errors in threads [b8df3a6] + Made sure .sort on shaped arrays uses the leaves [a4bc51a] + Made U+2212 infix:<−> and prefix:<−> same as regular `-` for all types [91af128] + Made sub MAIN usage ignore anon *% param [38ec79c] + Fixed lack of warning on unitilized values in infix: [c498d5b] + Fixed Distribution::Path bin/resources file format [393afcf] + Fixed spurious warnings in List.reduce [1ee24cc] + Sorting uninitialized List now returns a new list [005166e] + Made .sort always return a .Seq [434bf75] + Fixed combinations() incorrectly returning 1-item list in some cases [d86c419] + Made combinations() always return a Seq on succcess [db1836a] + Fixed useless "useless use" warnings in hypered ++ and -- [7193df1] + Fixed numerous bugs with $limit in lines() [19df358] + Fixed regression with mutability of .pairs on shaped arrays [dc7b688] + Fixed regression with infinite lists assignment to shaped arrays [aa35065] + Fixed regression with looping over uninitialized shaped array [696b1f4] + Fixed regression with regex match against NFC [8d35951] + Fixed infix: with 0-denominator rationals [a567eb4] + Fixed crashes in X::OutOfRange reporting with 0-denominator rationals [b2332c2] + Fixed &infix:<==> on 0-denominator rationals [73182d4] + Fixed &infix:<===> on 0-denominator rationals [cb2476f] + Fixed incorrect .isNaN result for 0/0 rationals [7434a8f] + Fixed IO::Socket::INET.new not parsing IPv6 URLs correctly [cb9ec03][df20d8b][fbd061b][8751f05] + Made IO::Socket::INET.new fail when invalid port or family is given [cb9ec03] + Fixed Range.AT-POS on int ranges failing for too-high indexes [c5e54ef] + Fixed (^) set operator on Baggies to take weights into account [a687d95] + Fixed incorrect dispatch in some cases of multi subs with where clauses [0c0dd82] + Fixed unwanted role punning due to attached Pod [d487657] + Made Routine.prec(key) return '' rather than Nil on fail [d7d76b7] + Moved .prec from Routine to Code [a7ccfc6] + Fixed an occasional heap profiler crash, and prevent heap profiler from greatly reducing the number of full GC collections [e182deb] + Fixed specializer log slots keeping alive, and so leaking, objects once specialized code has been produced [e182deb] + Fixed build under some versions of MSVC [e182deb] + Fixed code-gen bug in dispatch: [3d86286][ba8a284] + Fixed `1,*,3 Z~ ` case using Whatever value for the rest of list [471f4ba] + Fixed threading issues in ||=, //=, and &&= [d1c2e76] + Fixed GC in spesh triggered by managed mutex use [25615c7] + Fixed bugs in interaction between inlining, GC, and threads [25615c7] + Fixed endpoint-exclusion on string ranges with non-alphanumeric chars [daf7e51] + Fixed fatality of Nil.chomp/chop (back to just a warning) [7c81bec] + Fixed infix: on NaN and signed zeros [3f80e13] + Fixed crash in infix: when comparing Real and RatStr [8ec54ba] + [TEST] Test.pm tests no longer backslash every backslash in descriptions [b183cab] + [TEST] Fixed TAP::Harness parsing of single backslashes in test descriptions [b120ac4] + [TEST] Fixed TAP::Harness failing to parse full-file skip directive [aee7af3] + [UNI] Fixed `ISO_Comment` property in uniprop [4ff2fb2] + [UNI] Fixed uniname() on "\x[80]", "\0" and other controls [8163113] + [UNI] Made unival() use full Unicode names for Numeric_Value_* [dbbf9dd] + [UNI] Fixed several aliases for Unicode characters [5ba982a][644cd34] + [UNI] Fixed number of characters reported for hundreds of Unicode Emoji [823f0f7] + [UNI] Fixed compilation of /:ignoremark \"/ to actually ignore marks [6188771] + [UNI] Fixed mismatched closers on U+298D/U+2990/U+298E/U+298F brackets [76283f6] + [UNI] Fixed return value of uniprop Bidi_Mirroring_Glyph if no BMG [48e8ccc] + [UNI] Fixed breaking after Prepend characters [7c8b705] + [JVM] Fixed build issues [7bba13a][adcfb8b][e6ccb47][29f487e] [fb4f161][4320fdc][39bf63f] + Assorted improvements in error reporting + Additions: + Made importing globals from loaded modules lexical [4b529c8] + Added degenerate Any.match [3fe5893][cc0f836] + Added infix +/- for DateTime/Duration [6b850ba] + parse-base() now allows for omitted whole part [3282813] + Using a Bool:D literal as type constraint in signatures now warns [b01dfcd] + Made Bool.ACCEPTS work with Junctions [9fc616f] + Made Proc::Async sub-class friendly [a2cc58a][1dc0c01] + Implemented .clone for SetHash, BagHash, and MixHash [1ee9c82] + Implemented .List on shaped arrays [8568dd1] + Added own .perl method to Empty [ec0258a] + Made Inf and Whatever work as part of rotor()'s cycle [7ddc5f7] + Made it possible to use Inf and Whatever in .head and .tail [93b0ffa] + Implemented `next` in `whenever` blocks [f97d5c2] + [TEST] Test::is() now handles Mu types [268dc92] + [UNI] uniprop now handles Emoji properties [3baffe7] + [UNI] Implemented Bidi_Mirroring_Glyph as an integer property [7c8b705] + [UNI] Implemented Emoji grapheme breaking and other combined codes [7c8b705] + [UNI] Added Emoji Unicode properties [7c8b705] + [UNI] Added secondary and tertiary Unicode collation support [ee38721] + [UNI] Re-implemented UTF8-C8 streaming decode [7c8b705][ee38721][e182deb] + [UNI] Made all Nd chars accepted in ${} special variables [eba3fe0] + [UNI] Made all Nd chars accepted as regex quantifiers [e40a129] + Removals: + [UNI] Unicode 1 character names are now deprecated and issue a warning [e7c1d51] + Removed IO::Path:U.chdir candidate on account of it being a footgun [94df18c] + Efficiency: + [UNI] Made unival() slightly faster for repeated lookups [dbbf9dd] + [UNI] Made decoding UTF-8 text 14% faster [528ec53] + Made improvements to memory management of various aspects of invocation records (aka call frames), greatly reducing memory pressure in a number of cases, especially in applications that produce and store a large number of closures. Up to 20% improvement to CORE.setting build time and ~10% peak memory use reduction observed [e182deb] + Made I/O memory buffers properly contribute to full collection criteria, reducing memory overhead required [e182deb] + Made @a[*-1] 13% faster [b39c0d8][ab26b58] + Removed unnecessary caching on .elems in core code [ab26b58] + perl6 -ne '' is now about 40% faster [541d127] + Made IO::ArgFiles.lines about 10% faster [73797b7] + Made List.sort() about 4x faster [8d33b89] + Made native @a.sort() about 12x faster [4b2cea0] + Made Str.split() about 3x faster [f0398fb] and then 10%-40% faster on top of that, based on length of string [2496963] + Made Any.sort(&by) about 40% faster [1374fcf][def5262] + Made List.sort(&by) about 5% faster on reified List/Array [1e54371] + Made .sort on 0- and 1-element lists 10%-40% faster [340bc90] + Made .sort on 2-element lists about 50% faster [4724bd6] + Made Supply.sort a multi for faster dispatch [54cc06b] + Made Cursor.MATCH about 10-15% faster [9eef565] + Made QuantHash.AT-POS and Baggy.new about 5%-8% faster [c13e67b] + Made is nodal check a bit faster [0f25d83][996ab6a] + Made Capture.Bool about 3x faster [516e527] + Made sorting of 0,1,2 element native arrays about 30% faster [4038c6c] + Made generating iterator after List.eager does not reify again [7a759d7] + Added Seq.join that's 25% faster than List.join [3c52aa0] + Make @a Z @a 5x faster [4ab020f][3d1d699] + Made slow-path in grep 10% faster [362f674] + Made fast-path in grep about 1.4x slower as a result of a bug fix [362f674] + Made internal improvements with Empty and SlippyIterator [ebe9147] + Streamlined .prec on operators [caba0d3] + Made zip(@a,@b,:with(&[+|~]) about 12x faster [62f7027] + Made zip(@a,@b,:with(&op)) about 7x faster [62f7027] + Made zip with generic listinfix ops (e.g. zip(@a,@a,:with(&[minmax])) about 2x as fast [5c685f2] + Made zip(@a,@a,:with(&[=>])) about 5x faster [46cdf16] + Made generic right-assoc zip ops in zip(@a,@a,:with(...)) form at least 2x faster [6703b4c] + Made Zop handling (except for non-LHS-thunky ops) 13x faster [f66d4b3] + Made List.from-iterator about 10% faster [8f3476d] + Streamlined Array.from-iterator, making it 30% faster in some cases [fab1a14] + Improved ||=, //=, and &&= by avoiding thunking and invocation [d1c2e76] + Made List.combinations(N) about 20% faster [1a54bba] and on top of that made List.combinations() 1.5x, List.combinations(3..5) 2x faster [502fc77] + Made permutations() 2x to 24x faster [78edbbb][b5293c2][c64aeb3] + Made roundrobin() about 4x faster [73d0cec] + Made X and cross(...,:with) about 5x faster [8a3ff7b] + Made Xop about 7x faster [a26f513] + Made 1 X foo about 20% faster [d4a5b69] + Made List.rotor between 15x and 20x faster [d7b8214] + Made Range.excludes-(min|max|infinite|is-int) 2.5x as fast [99b186b] + Made reified List.Array about 3x faster [c9a9bc8] + Made List/Array.sum about 30% faster [017c6cf] + Made List/Array.fmt with no args about 60x faster [22e589a] + Made List/Array.fmt("%s") about 60x faster [7ef3682] + Made List/Array.join about 20% faster [ed482ec] The following people contributed to this release: Elizabeth Mattijsen, Zoffix Znet, Samantha McVey, Pawel Murias, Wenzel P. P. Peppmeyer, Jonathan Worthington, Will "Coke" Coleda, Christian Bartolomäus, Daniel Green, Stefan Seifert, Itsuki Toyota, Moritz Lenz, Larry Wall, Tom Browder, Ronald Schmidt, Douglas Jenkins, Jan-Olof Hendig, Armand Halbert, Aleks-Daniel Jakimenko-Aleksejev, Altai-man, Bahtiar `kalkin-` Gadimov, faraco, Will Coleda, Brian S. Julin, Steve Mynott, Jonathan Stowe, Alexis, Timo Paulssen, Naoum Hankache, Joachim Durchholz, Nick Logan, Nic Q, JJ Merelo, Douglas L. Schrag, dugword, Juan Julián Merelo Guervós, flussence, Elise, Jonathan Scott Duff, Siavash Askari Nasr, Paweł Murias, Bart Wiegmans, brian d foy, smls, Lucas Buchala, Fernando Correa de Oliveira, ab5tract, Tommy Stanton, Dagfinn Ilmari Mannsåker If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#108), is tentatively scheduled for 2017-02-18. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.02.md0000644000175000017500000002466113253717231015526 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #108 (2017.02) On behalf of the Rakudo development team, I’m very happy to announce the February 2017 release of Rakudo Perl 6 #108. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.02: + 6.d.PREVIEW changes: + It is now possible to use different language versions in different comp units. Pragma `use v6.d.PREVIEW;` loads PREVIEW version of 6.d language [9044fca] + Made `await` non-blocking (i.e. not using a thread for waiting) [dd1cb5f] + Made `react` non-blocking [4aa8d70] + Various improvements to error reporting [ee7c1bb][a2d69a0][f22170f] + Fixes: + Fixed data race in NFA cache [8f53a6f] + Fixed handling of Unicode characters on Windows command line [8f53a6f] + Fixed overflow during full GC collection on 32-bit systems [8f53a6f] + Fixed GC problem in string repeat op [8f53a6f] + Fixed .perl.EVAL roundtripping for circular Arrays and Hashes [67aeefa][673f06b] + Fixed instantiation of subclasses of classes that do Rational [7f245f7] + Fixed incorrect handling of precision flag in sprintf '%d' [a1c7d01] + Fixed `infix:(..., *)` for empty Slips [4e49ec1] + Fixed .pairs, .values, and .kv with native shaped arrays not having values in writable containers [0fdb9e4][1181afe][e195e5f] + Changed Pair.AT-KEY on non-existent key to return Nil [9728c4a] + Fixed Slip.List not returning a Slip instead of a List [4d4822a] + Made Map.List and Hash.List always return a List [6dd542f] + Fixed crash when using `.=` to initialize attributes [700a077] + Fixed leak of asynchronous task handles [483e4fd] + Fixed issues in .skip-one in internal Mappy iterator [3a77cb5][e7ea4c2] + Fixed count-only on all Hash based .kv methods reporting only half of actual value [aecbb3e] + Fixed crash in internal iterator used by .rotor and .batch [bcd902a] + Fixed LAST phaser called twice in sunk do for {} loops [3424465] + Fixed various discrepancies as a result of inlining non-native types [f8b3469] + Fixed leaks and an invalid read in synchronous sockets on errors [9ed4449] + Fixed NFA generation for the constructs `x ** 1..2` and `:i <[A..Z]>`, and hardened NFA processing in MoarVM so as to not read out of bounds [9ed4449] + Fixed memory leaks on startup and module load with augmented types [9ed4449] + Fixed smartmatch of Complex against Ranges [f2894d3] + Fixed premature overflow of `div` on native int types [c98b3a5] + Fixed flat()/Iterable.flat not propagating `is-lazy` [51b0aba][ca102c5] + Fixed hang with `*@` slurpies when given infinite list [51b0aba] + Fixed abs() failing with negative zeros [f85978b] + Fixed List.perl of containerized empty lists [a148c70] + Fixed at-times incorrect result of Rational.ceiling [6372417][79553d0] + Fixed Rational.norm failing to normalize the Rational [aac9efc] + Fixed issues with close() and read() on closed async sockes [f16cf37] + Fixed occasional disordering of messages in Supplier::Preserving [cabf6fb] + Fixed a data race in NFA caching causing SEGV [62bd30b] + Fixed data races and over-sharing of %*ENV in precompilation [bab1c02] + Fixed data races in CompUnit::PrecompilationStore::File [accc156][39c517e][917d473][a88da2e][6c374d5][2b1eb64] + Various improvements to error reporting [10bcec2][5822605][f230224][b51a550] [8733aa5][483e4fd][f0b9234][e922275][51ebfb1][acae345][1b99196][301bcf9] + Additions: + Implemented Array.clone [dc69daf] + Implemented Mu:U.clone [11d005e][4b85db6] + Added experimental `infix:` [6f6f0cf][5870ef9][eb3356c][6990133] + Added experimental `infix:`, `Any.collate`, and `$*COLLATION` [2061485][4efcc29][46313fa][1923878][5611425][6990133][f85978b] + Implemented Any.skip [8a6bfc6] + Implemented Supply.skip [d71bf1e][15753fd] + Implemented Any.batch [e0201f1][f6531d3] + Added Supply.rotor($batch) candidate [5694727] + Added support for all Nd characers in sprintf format strings [483e4fd] + Added support for more named Unicode sequences [3a77406] + Made named Unicode lookups (e.g. "\c[...]") case insensitive [3a77406] + Added support for Support East_Asian_Width Unicode property [9ed4449] + Made CompUnitHandle.globalish-package return the actual Stash [960a789] + Made Test.pm6's skip() only accept Int test counts [ae9d517] + Numerious fixes related to colonpair-extended names on subroutines [48abeee] + Made merging of Perl 5 symbols use the same mechanism as for Perl 6 [4e7ab20] + Included try-load in CompUnit::PrecompilationRepository's interface [d932355] + Made S/// set $/ to Match objects made during substitution and avoid returning the result in $/ causing container-reuse in loops [97359ae] + Made CompUnit::Repository::Installation sort binaries by version [7c39bbf] + Made it possible to call IO::Path.s on a directory [25fd1ca] + Gave fakesignature a $/, $_, and $! to avoid unintended sharing [71a1283] + Implemented smartmatch of character Ranges [8477f3b] + Str ~~ Numeric no longer throws if Str cannot be coerced to Numeric [1615c83] + Efficiency: + Made SetHash.iterator|pairs|antipairs|kv|values about 20x faster [a2fbe20] + Made Int.WHICH about 1.7x faster [9841313] + Made Baggy.kv about 15% faster [e995107] + Made Baggy.kxxv about 30% faster [5db0b29] + Made Baggy.antipairs about 25% faster [2922ec4] + Sped up postincrement and postdecrement by about 5% [fd74c91] + Internal improvements for 1%+ faster parsing [dd514da][9493ffb][951a441] + Made `` parsing 5%+ faster [0bb7c20][d5262e6] + Generalized sink branch optimize logic improving performance for sunk post increment [5401a1a] + Improved radix operations (50% faster with non-ASCII digits) [9ed4449][c98b3a5] + Made uniprop/unival/unimatch 1.1x to 2.1x faster [411782e] + Fixed performance loss on `infix:` with very large number [8878af8] + Made Map.sort about 1.5x faster (also affecting its .perl/.gist/.Str) [0ee3b7d] + Made an improvement in candidate selection order of &sort [b7c6e73] + Made .skip of internal mappy iterator about 15% faster [54f647d] + Made List.keys on lazy lists a bit faster [0ad05ce] + Made Seq.InfiniteLoopIter about 6% faster [00e60d9] + Made do repeat while about 3%-11% faster [a832944][af49026] + Made `do while foo { bar }` loops about 20% faster [4932112] + Made `do repeat while foo { bar }` about 20% faster [3888b42] + Made `do loop ( init; while; next ) { }` loops about 6% faster [c2eb7fb] + Made `.map: -> $_ --> non-Slippy-Foo { ... }` maps about 2x faster [fdcf462] + Made firing of phasers about 25% faster [7e98504] + Made `my @a = do for @b { ...; PHASER foo }` about 1.5x faster [031efe0][3424465] + Made `for @b { ...; PHASER foo }` about 15% faster [031efe0] + Made `@b = @a.map: { }` 10% and `@b = do for @a { }` 20% faster [3e28b1e] + Made `for @a { ... }` about 1% faster [d69f375] + Made `my @b = @a.map: -> \a,\b { }` about 15% faster [9f15a4d] + Made `for @a -> \a, \b { }` about 2% faster [7384939] + Made .tail on reified List/Array about 8x as fast as `[*-1]` and .tail(N) about 16x as fast as `[*-N .. *-1] [*-N .. *-1]` [833fe43] + Made improvements and refactoring of various internal iterators [f2b97b0][18e6f0d][87f61d9][c069f45][ad90806][4ef37cf][54f647d][49e2d40a] [7c26985][4d8fc05][b1afc13][072d959][9d5c3fd][6b6a0b4][b31c591][b9d9279] [f799a03][98f9d8a] + Made improvements to performance of internals [ed4ef3b][f85978b] The following people contributed to this release: Zoffix Znet, Elizabeth Mattijsen, Samantha McVey, Pawel Murias, Will "Coke" Coleda, Jonathan Worthington, Wenzel P. P. Peppmeyer, Antonio Quinonez, Altai-man, Cale, Daniel Green, Tom Browder, Moritz Lenz, Christian Bartolomäus, Ronald Schmidt, Stefan Seifert, Larry Wall, Aleks-Daniel Jakimenko-Aleksejev, JJ Merelo, Jonathan Stowe, Timo Paulssen, Brad Gilbert, Christopher Bottoms, Will Coleda, Christian Walde, Siavash Askari Nasr, Nic, Curt Tilmes, raiph, Carl Masak, smls, Jan-Olof Hendig, Sam S If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#109), is tentatively scheduled for 2017-03-18. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.03.md0000644000175000017500000002167413253717231015530 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #109 (2017.03) On behalf of the Rakudo development team, I’m very happy to announce the March 2017 release of Rakudo Perl 6 #109. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.03: + Fixes: + Made IO::Path.lines non-lazy so it can always close the file handle [0083c4f] + Fixed unwanted container re-use in `infix:` [5b7b7fb] + Made Emoji_Modifier_Base return Bool instead of int with uniprop [2125d4d] + Fixed JIT rounding bug for negatives in nqp::div_i [deac603][f73d984] + Fixed failure in `\c[]` with non-ASCII names [deac603] + Fixed issues in `infix:
` optimization [deac603] + Fixed .split(...:skip-empty) not skipping with empty strings [fc86084] + Fixed duplicated .done/.quit on Channels in Proc::Async on exit [c4a4c84] + Fixed error handling when Proc::Async process failed to spawn [f73d984] + Made sure `infix:` always returns a Seq [1eb7b1f] + Partially fixed `infix:` being non-lazy [f190f24] + Fixed SC collision when loading identical modules from different dists [254f76a] + Fixed CURI loading of modules with identical short-names [c1a0fa7] + Fixed SEGV in exception handler resolution in sub/INIT/return [b2eb115] + Fixed SEGV on `xx` with a huge repeat values [1cafc67] + Fixed SEGV on chars with a huge number of combiners [1cafc67] + Fixed SEGV when `Scalar` type object is processed by `unique` [cfe0e04] + Fixed .comb(Int) failing to work on Cool [a08e953] + Fixed hang in dispatch of .lines/.words when given wrong args [7425737] + Fixed cases of lack of panic upon with quantifiers in regexes [91a4ac5] + Fixed broken thunking of infix: [5e6f30a] + Fixed failure to thunk RHS on `or=`, `and=`, and `notandthen=` [3e88c41] + Fixed precision loss with `cmp` involving Rationals/Int [9e8ecb7] + Fixed crash in .Bool, .so, .not, .hash, and .elems on Baggy:U [e8af855] + Fixed crash in .Str on Bool:U [3de5fb2] + Fixed crash in IO::Special .WHICH/.Str [dd4dfb1] + Fixed install wrapper when no binaries are found [796b6a8] + Fixed crash when calling .sort on reified empty Array [8e250db][75e070f] + Fixed `Nil` being displayed as `Mu` in REPL [a274bdd][cd47e2a] + Fixed previous output silencing exceptions in REPL [db70a1f][61a65ce][7f9235c] + Fixed loss of data when using a hash in assignment to itself [ae7bcf1] + Fixed IO::Path.e failing to detect changes on the filesystem [76f7187] + Fixed `infix:` with Seq/List containing same elements [f9eb811] + Fixed CArray to pass NULL when for type object elements [26e6993] + Fixed GC deadlock when event loop worker thread was spawned [26e6993] + Fixed `:i` in regexes using lowercase instead of fold case [26e6993] + Fixed parsing issue with detached methods in `[…]` metaop [e1ebb50] + Fixed unwanted list flattening in triangle reduce [10f5f74] + Fixed Range.int-bounds for NaN and Inf end points [79f2681][16ef21c] + JVM backend fixes [b1def95][2f6d2c6][dc19892][cef41b2] + Various improvements to error reporting [dc5fb20][d66c382][b11dc88][6cb9be2][3bf734f][26e6993] [20fa14b][127338a][1934a56][27dc7b1][1e24666] + Additions: + Made symbol imports of `require`d modules lexical. For more information, see http://rakudo.org/2017/03/18/lexical-require-upgrade-info/ [63cf5ca][3e86d0f][5b98caa][6771dee][9da6de4][4fce405][030c4c5] + Added ≤, ≥, ≠ as Unicode versions of <=, >=, and != [5c68ea6] + Made it possible to hyper ops that return a Seq [e2db7b8] + Made `infix:<∘>` keep RHS's .count and .arity and LHS's .of [032b283][cb149a8] + Made purity propagate up through meta-meta ASTs [68a40f7] + Made Proc::Async default to translating newlines [05add43][2973ccd] + Implemented Str.parse-names [5c1761a] + Added `$epsilon` argument to Complex.Rat/.FatRat [a4af702] + Fixed loss of precision in Instant.Rat [a4af702] + Implemented .FatRat coercer in Cool and Numeric [a4af702] + Added Mu candidate for `infix:` [e270a15] + Implemented Mu.iterator [81fcd1b] + Made sure Str.split always returns a Seq [f595733][8301a30] + Made List.reverse return a Seq [beda576] + [EXPERIMENTAL] Added support for Parameter.set_default [d6c95ea] + Implemented new internal braids API to make future optimizations easier. This affects any slang modules that access `%*LANG`, `%*PRAGMAS`, and `$*ACTIONS` internals using unofficial API. + Removals: + Removed IO::Path.Bridge [212cc8a] + Removed support for IO::Handle.lines(:close) agument [76a59cf] + Efficiency: + Made min/max/min=/max= about 3x faster [a9c5196] + Made .WHICH of numerous types about 1.8x faster [79bb179][65b0040] + Made case-insensitive regex match 20%-30% faster [5b6e0fb][f73d984] + Made triangle reduce right op with 2 params 2x faster [e114d52] + Made triangle reduce right op with 2+ params 1.5x faster [d04c47f] + Made IO::Handle.lines about 10% faster [9019a5b] + Made IO::Handle.getc about 3% faster [9019a5b] + Made reduce chain op about 5% faster [9cec31a] + Made IO::Handle.lines about 10% faster [9da50e3] + Made List.reverse 0%–30% faster and reduced memory pressure by up to 70% [beda576] + Made loops/maps with NEXT phaser about 5% faster [80e0bce] + Made `infix:<%%>` about 14x faster for Int,Int case [755e25b] + Made `infix:<%>` about 8x faster for Int,Int case [5ec2517] + Made Junction creation about 20% faster [fafe663] + Made callframe() about 20% faster [7966dad][9a74cd0] + Made meta reduce with right-assoc. op 30%–200% faster [60a8f9e][2cf9b53] + REMOVED caching of IO::Path.e results to fix unwanted behaviour [76f7187] + Assorted internal improvements to CPU/memory use [b2e0ac0][25a3cc5][b61b3c7][829762a][45b3af8][7010ae9][556db9d][9e9a4ad] [8e8cd14][7556498][adb6f87][9a109c9][3de7b08][b283e52][0be7247][74573d0] [79d5670][313e7b2][e723e00][5843ee6][7c279c3][318f8ee][4ef1e69][9d497e9] [b597398][4bc826d][9da50e3][2a2e460][0633f03][d444f65][f94a2c7] The following people contributed to this release: Zoffix Znet, Elizabeth Mattijsen, Wenzel P. P. Peppmeyer, Samantha McVey, Will "Coke" Coleda, Pawel Murias, Jonathan Worthington, Daniel Green, Brian Duggan, Tom Browder, Larry Wall, Christian Bartolomäus, Altai-man, Fernando Correa de Oliveira, Stefan Seifert, Itsuki Toyota, LLFourn, Aleks-Daniel Jakimenko-Aleksejev, Naoum Hankache, Bart Wiegmans, Cale, Fernando Correa, Timo Paulssen, Nick Logan, Ronald Schmidt, Brad Gilbert, Claudio Ramirez, Will Coleda, raiph, ven, David Warring, Jan-Olof Hendig If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#110), is tentatively scheduled for 2017-04-15. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.04.1.md0000644000175000017500000000527213253717231015664 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release 2017.04.1 On behalf of the Rakudo development team, I'm announcing an out-of-schedule release of the Rakudo Perl 6 compiler. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release is a point release in addition to the regular, monthly releases. Rakudo 2017.04 (note: no .1) inadvertently included debugging output when `new SomeClass:` calling form was used. In this release that output is disabled. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.04.1: + Fixes: + Removed unwanted debugging output [c9ebfc20] + Reverted 9d8e391 IO::Path.resolve fix for JVM, as it does not yet know how to do utf8-c8 decode [88a6facc] The following people contributed to this release: Larry Wall, Zoffix Znet If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#111), is tentatively scheduled for 2017-05-20. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? [^3]: NQP stands for 'Not Quite Perl', which is a language/environment that Rakudo is largely written in. See https://github.com/perl6/nqp The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.04.2.md0000644000175000017500000000560213253717231015662 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release 2017.04.2 On behalf of the Rakudo development team, I'm announcing an out-of-schedule release of the Rakudo Perl 6 compiler. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release is a point release in addition to the regular, monthly releases. This release fixes an issue with method calls on paths in %?RESOURCES that was introduced in 2017.04 release. The issue impacted installation of several ecosystem modules. We're currently working on an automated extended testing system that will prevent such issues from affecting future releases. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.04.2: + Fixes: + Fix "Cannot invoke this object (REPR: Null; VMNull)" [4a560aa] + Improve relations between %?RESOURCES and Native trait [647abfe] + Support all appropriate IO::Path methods on Distribution::Resources [f4f1c42] The following people contributed to this release: Stefan Seifert, Zoffix Znet If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#111), is tentatively scheduled for 2017-05-20. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? [^3]: NQP stands for 'Not Quite Perl', which is a language/environment that Rakudo is largely written in. See https://github.com/perl6/nqp The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.04.3.md0000644000175000017500000000707013253717231015664 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release 2017.04.3 On behalf of the Rakudo development team, I'm announcing an out-of-schedule release of the Rakudo Perl 6 compiler. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release is a point release in addition to the regular, monthly releases. This release fixes an issue with `)>` regex capture working incorrectly when .MATCH is called, e.g. in grammar actions. In addition, it fixes false positive regex matches when using case-insensitive regexes and start of string and end of string match. Also, it fixes failure to load history file when using REPL with Linenoise or Readline on OSX. Last but not least, this release tests how many point releases is too many :) As mentioned in previous release announcement, we're working on a system to do extended testing during and before releases that will include testing of multiple ecosystem modules. This will prevent issues that require point releases. The tarball for this release is available from . **This point release requires a newer NQP and MoarVM than 2017.04**. There has not been any further NQP or MoarVM *release* tags, but the version/git tags required are at least: * NQP 2017.04-24-g87501f7b * MoarVM 2017.04-44-gf0db8822 Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.04.3: + Fixes: + Fix REPL history file failure with Linoise on [6c66c1b88c] + Fix `)>` to work whenever .MATCH is called [2f143f476d][0150c7b8c5] + Fixed issues with false positive case-insensitive regex matches when only start of string and end of string match [f756b4b54f][25048824c8] The following people contributed to this release: Samantha McVey, Timo Paulssen, Larry Wall, Zoffix Znet If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#111), is tentatively scheduled for 2017-05-20. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? [^3]: NQP stands for 'Not Quite Perl', which is a language/environment that Rakudo is largely written in. See https://github.com/perl6/nqp The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, the most recent incarnation of the “Using Perl 6” book, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.04.md0000644000175000017500000003665613253717231015537 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #110 (2017.04) On behalf of the Rakudo development team, I’m very happy to announce the April 2017 release of Rakudo Perl 6 #110. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.04: + SPECIAL NOTES: + There are two Upgrade Notifications for this release: - Part 1: http://rakudo.org/2017/04/02/upgrade - Part 2: http://rakudo.org/2017/04/03/part-2 - Part 3: http://rakudo.org/2017/04/17/final-notes + Changes for Texas operators listed in this release also apply to their fancy Unicode alternatives. https://docs.perl6.org/language/unicode_texas.html + Fixes: + Fixed infinite loop due to wrong args in many Cool methods [8c88b0c] + Fixed failure to distinguish rw args in Capture.WHICH [4605d52] + Fixed regression in .rotor with negative gaps [5917b81] + Fixed a 1-arg-no-phasers path in .map stopping after 1 value [86dc997] + Fixed containerization issues in listinfix metaops [16f950b] + Fixed Inline::Perl5 detection in t/harness6 [b15cd20] + Fixed incorrect number of tests run in t/harness6 [8766370] + Fixed t/harness5 incorrectly failing NOTESTS runs [f28c515] + Fixed crash in S/// and s/// for some combinations of adverbs [43e0902] + Fixed crash when doing EVAL from multiple threads [218f8c4] + Fixed errors in concatenations of Hangul script with \r\n in it [a123eb3] + Fixed case insensitive string compare with synthetics in haystack [e87179d] + Fixed case insensitive regex with synthetics [666ce35] + Fixed issues with foreign lang cursor without a name [ffeb896] + Fixed introspection of attributes with explicitly typed keys [a6ba994] + Fixed spurious warnings in define_slang [666ce35] + Fixed issues in :exists with multidimensional hash slice lookup [a758c0b] + Fixed unwanted overflow when too-large values were *assigned* to native attributes [666ce35] + Fixed failure to set $/ by matching routines when used in loops [a62b221] + Fixed handling of Baggy (|) Mixy, Mixy (|) Baggy in dispatch [48619f8] + Fixed Allocations tab in --profile output [c16cdb2c] + Made `is equiv` to not propagate operator's `assoc` value [f9f0883] + Made Code.ACCEPTS pass take its parameter `is raw` [c0eb9bd] + Fixed SEGV in IO::Pipe.t [3e275dd] + Made `dynamic` default to False instead of Nil on Scalar/Hash/Array [28a6e80] + [IO] Fixed wrong results in IO::Path.resolve for paths with combiners on `/` [9d8e391] + [IO] Fixed a crash when using Whatever limit in in IO::Pipe.lines [0c62815] + [IO] Fixed crash in smartmatch of Cool ~~ IO::Path for some Cools [c360ac2] + [IO] Made IO::Path:: subclasses instantiate a subclass, not IO::Path [a0b82ed] + [IO] Fixed crash when very large files were read with IO::Path.slurp [d0924f1] + [IO] Ensured IO::Handle.Str coerced .path to Str [1f689a9] + [IO] Fixed crash when binary slurping large files with &slurp/IO::Path.slurp [756877e] + [IO] Fixed occasional zero byte read when binary slurping files [756877e] + [IO] IO::Handle.symlink/.link now take name of the link as argument; the invocant is the target [8c09c84] + Various improvements to warnings and error reporting [6a77cda][d90c6bf][f9968b3] [27f5469][41ac4b4][75c3f29][87fe800][7ba2fc5][093bb89][d3c93ad][6ee71c2][490ffd1][7112a08] + Additions: + Gave `Thread` a numeric representation [e5528dd] + Made Any.maxpairs/.minpairs use `cmp` and return Seq [5927186] + Made `Parameter` object available in bind error [0f9f000] + Added typed exception for parameter constraint failure [f1cd8e3] + Allowed nativesize to be unset in NativeHOW, but still compose [af4aae2][932b59f] + Made sure that Baggy and Setty handle bare objects [7433947][e660a57] + Added experimental coverage reporter tool with MoarVM backend (so far works with reports for core code; more work needed to expand for wider use) [932b59f][d0924f1] + Made it possible to assign to system dynamic vars on initialization [1b9d53c] + Broadened acceptance in `(<+)`/`(>+)`: all Quanthashes can be considered Settys and all Baggys can be considered Mixys [1ebeeb3] + Implemented `skip-all` option in &plan in Test.pm [14b6d5f] + Made it possible to use `.head(*-N)` (all but last N) [1fea495] + Made it possible to use `.tail(*-N)` (all but first N) [188b7b1] + Allowed `*` and `Inf` args to Array|List.tail [1b34ea6] + Made .Set, .SetHash, .Mix, .MixHash, .Bag, and .BagHash nodal [189615c][3e412b9][7025050] + Made `infix:<(&)>` a multi and added basic candidates [e8cb9a2] + Made `(-)` a multi [495f970] + Added default descriptions for Test.pm's `like`, `unlike`, and `use-ok` [4b915f7] + Made `is rw` on optional params throw a typed exception instead of generic one [8370675] + Made it possible to pass IO::Path to `is native` trait [9984080] + Implemented bypass of dependency resolution in the Staging repo via RAKUDO_RERESOLVE_DEPENDENCIES env var [5b862a3][d4d6a99][2a0a2d3] + Merged Cursor into Match; in preparation of for future removal of Cursor [b7c036c][cdd625b] + [IO] Added more powerful features to IO::Path.extension [b1e7a01][15a25da] + [IO] Added IO::Path.add [40217ed][0b5a41b] + [IO] Implemented IO::Path.sibling [8bacad8] + [IO] Implemented IO::Handle.lock [214198b] + [IO] Made IO::Path throw when path contains NUL byte [e681498] + [IO] Implemented `:completely` param in IO::Path.resolve [6a8d63d][51e4629] + [IO] Implemented IO::Handle.slurp [f1b4af7] + [IO] Made IO::Path.dir a `multi` method [fbe7ace] + [IO] `$*TMPDIR` now has a container, so it's possible to `temp` it [b62d1a7] + [IO] Allowed IO::Path.z to be called on directories, to mirror .s [b6838ee] + [IO] Implemented IO::Handle.spurt [a5800a1] + [IO] Implemented &indir [a0ef2ed][ca1acb7] + [IO] Implemented IO::Path.concat-with [966a7e3] + [IO] Made `&*chdir` return new `$*CWD` [5464b82] + [IO] Expanded accepted arguments from Cool to IO() in &spurt [099512b] + [IO] Implemented :parent in IO::Spec::Cygwin.canonpath [0c8bef5] + [IO] Made IO::Path.lines lazy again (reversal from last release) [90da80f] + [IO] Re-added :close param to IO::Handle.lines (reversal from last release) [90da80f] + [IO] IO::Handle.lines($limit, :close) now closes the handle when $limit is reached [90da80f] + [IO] Added IO::Pipe.path and .IO methods to return an IO::Path type object [d46e8df] + [IO] Made IO::Path.mkdir return invocant on success [c01ebea] + [IO] IO::Path now `does` role `IO`. This exists solely as a future compatibility feature with `IO()` coercer type check and provides no new methods [87987c2][c95c4a7][fd503f8] + [IO] &chdir and IO::Path.chdir now support :r, :w, :d, :x args for file tests and default to :d test only [a0ef2ed] + [IO] Changed coercers from Str() to IO() in `&*chdir`, &chdir, IO::Path.chdir, &rename, &move, © to avoid limitations of IO::Path.Str and race conditions with `$*CWD` [2483d68][a0ef2ed][ff97083] + [IO] Changed a Capture of remaining args to be passed to the delegate IO::Handle methods, instead of the internal .open call in IO::Path .lines, .words, .comb, .spurt, and .split [099512b][90da80f] + [IO] The following now return Failures instead of throwing: &chdir, `&*chdir`, &spurt, IO::Path.spurt, IO::Handle.spurt, IO::Path.slurp, &symlink, &link, &rename, &move, © [a0ef2ed][2483d68][5464b82][c13480c][da1dea2][ff97083] + Removals: + Removed unused $.pid from Proc [5b8d4c2] + [IO] Removed &mkdir candidate that creates multiple dirs [0d9ecae] + [IO] Removed IO::Path.abspath [cb323d5][a432b3d] + [IO] Made IO::Path.new-from-absolute-path a private method [7f73f92] + [IO] Removed vestigial IO::Path.pipe [a01d679] + [IO] Removed unused Capture in signatures of some .IO coercers [0c7e4a0] + [IO] Removed IO.umask method [87987c2][fd503f8][c95c4a7] + [IO] Removed :bin argument in IO::Handle.Supply; now uses handle's mode instead [184d499] + [IO] IO::Handle and IO::Socket no longer `does` role `IO` [87987c2] + [IO] Removed .chmod, .e, .d, .f, .s, .l, .r, .w, .x, .modifies, .accessed, .changed, .mode, and .watch methods from IO::Handle [36ad92a][50aea2b] + [IO] Removed &tmpdir and &homedir + [IO] :$test param on &chdir and IO::Path.chdir is now deprecated and will be removed in 6.d language [a0ef2ed] + Efficiency: + Made .Set/.SetHash.clone about 250x faster [d673ea7] + Make Baggy (&) Baggy about 80x faster [e9a3075] + Made Mixy (&) Mixy about 60x faster [03ef4be] + Made Str (elem) Map / Map (cont) Str 50x faster [a8c6eca] + Made Setty (&) Setty about 40x faster [89b5d65] + Made Setty (-) Setty about 40x faster [49c0ab6] + Made Baggy (|) Baggy at least 40x faster [4facf10] + Made Mix.BagHash and Mix.Bag coercions about 28x faster [2d8ac1e][af50e06] + Made Setty `(<+)`/`(>+)` Setty at least 25x faster [224e40f] + Made Mix.MixHash coercion about 25x faster [de983bc] + Made Map (|) Map 15x to 20x faster [9470d1c] + Made Setty (|) Setty about 25x faster [49807eb] + Made Object Hash.Set(Hash) coercion 12x faster [fb5d726] + Made .invert about 10x faster [7ea0f66] + Made Baggy coercion to Set|SetHash 10x faster [f947a19] + Made @a.first(Foo) 6x-10x faster (also affects many set operators) [9671ffe] + Made Iterable (|) Iterable about 9x faster [80062b0] + Made Set.WHICH about 8x faster for 50 elem Sets [167a0ed] + Made Set.SetHash coercion 12x faster [2731087] + Made coercion of Map to Set(|Hash) about 8x faster [4683e83] + Made Setty coercion to (Bag|Mix)Hash 7x faster [6686abb] + Made Map (&) Map about 7x faster [605e9e9] + Made Baggy `(<+)`/`(>+)` Baggy at least 6x faster [928a406][0672082] + Made Mixy `(<+)`/`(>+)` Mixy at least 5x faster [38b341a][0672082] + Made (cont)/(elem) 25% to 5x faster for QuantHashes [5b7ef3e] + Made Setty.hash about 4x faster [10fe02a] + Made Setty.pick/SetHash.(grab|grabpairs) 4x faster [6c9f31b] + Made Iterable.Set(|Hash) about 4x faster [f849df3] + Made m:i// regex matching 1.8x-3.3x faster [3e275dd] + Made Enum.ACCEPTS(Enum) 2.9x faster [17d34cd] + Made Iterable (&) Iterable about 2x faster [0fc3751] + Made internal nqp::index 2x faster, affecting many methods that work with strings [f1fc879] + Made case-insensitive regex 2x faster [822566f] + Made Baggy.new-from-pairs 1.5x faster and use less memory [ff52b74] + Made concatenation with control chars at end 30% faster [027aa54] + Made Baggy.new, bag(), and mix() about 25% faster [ae3ff5c] + Made Iterable.flat about 20% faster (also affects `*@foo` slurpy params) [f532f81] + Made Numeric.ACCEPTS(Any) about 15% faster [89457f8][e0e0800] + Made Hash.Bag about 15% faster [e7e97c7] + Made generic handling of `(<+)` and `(>+)` about 15% faster [5ae4549] + Made Set.new(42) about 8% faster and use less memory [fb60621][1471527] + Made Set.new-from-pairs about 4% faster for Pairs [213a72c] + Made Any.unique a few percent faster [6060bd3] + Streamlined tai/epoch conversion / leap-second check [dcebce4] + Added fastpath for `infix:<(|)>` with empty list of args [e24980f] + Made multiple memory use reductions in internals in MoarVM [d0924f1] + Made Grammars pre-compute their NFAs during precompilation [064b585] + Improved FSA which gives better multithreading performance [20af51f] + [IO] Made IO::Spec::Unix.split 36x faster [4fdebc9] + [IO] Made IO::Spec::Unix.catpath 9x faster [55abc6d] + [IO] Made IO::Spec::Unix.join 8.5x faster [55abc6d] + [IO] Made IO::Spec::Unix.is-absolute about 4.4x faster [4eef6db] + [IO] Made IO::Spec::Unix.catdir 3.9x Faster [0111f10] + [IO] Made IO::Pipe.lines 3.2x faster [0c62815] + [IO] Made IO::Spec::Win32!canon-cat 2.3x faster [0e36bb2] + [IO] Made IO::Path.child 2.1x faster on `*nix` [55abc6d] + [IO] Made .IO.slurp about 2x as fast [b4d80c0] + [IO] Made IO::Handle.open 75% faster [4032953] + [IO] Made IO::Spec::Unix.rel2abs 35% faster [dcf1bb2] + [IO] Made IO::Path.slurp 12%-35% faster (for small files) [c13480c] + [IO] Made IO::Path.new 7% faster when creating from Str [ae5e510] + Assorted internal improvements to CPU/memory use [1132b1a][a123eb3][1bacc61][c3c849e] [fa9aa47][666ce35][e7e97c7][213a72c][fab9f87][9671ffe][08a9735][8a4df162][b64f210][1277fb5] [463898a][3f36508][65037c3][e408e47][6ef7b59][a4b30dc][7875eaf][d793e21][bf63719][9a2446c] [0dbe451][1867099][2694f5d] The following people contributed to this release: Zoffix Znet, Elizabeth Mattijsen, Pawel Murias, Larry Wall, Samantha McVey, Timo Paulssen, Jonathan Worthington, Daniel Green, Christian Bartolomäus, Tom Browder, Gabor Szabo, Stefan Seifert, Aleks-Daniel Jakimenko-Aleksejev, Will "Coke" Coleda, Brian S. Julin, Fernando Correa de Oliveira, David Warring, Fernando Correa, Itsuki Toyota, Wenzel P. P. Peppmeyer, Moritz Lenz, Julien Simonet, LLFourn, Harrison Chienjo, Cuong Manh Le, Brad Gilbert, Brian Duggan, dmaestro, Sterling Hanenkamp, Jonathan Stowe, Jan-Olof Hendig, Lloyd Fournier If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#111), is tentatively scheduled for 2017-05-20. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.05.md0000644000175000017500000003202313253717231015520 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #111 (2017.05) On behalf of the Rakudo development team, I’m very happy to announce the May 2017 release of Rakudo Perl 6 #111. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.05: + Fixes: + Made Promise subclass-friendly [a61746fe][a7c23aa2] + Fixed unwanted warnings on Windows with `$*HOME` [4ae7c697] + Fixed handling of `<1` and NaN in Baggy.pick/.roll [40e4e132][e5d2c6f6] + Fixed NaN and empty Baggy handling with Baggy.pick/.(pick|grab)pairs [abc0509c][22ba2317][22ba2317][44c89ed9] + Fixed SetHash.(iterator|values|kv) to have same semantics as (Bag|Mix)Hashes [e5b5d346][e9ae0047] + Fixed off-by-one in `lines` routines when `:close` is given [bf399380] + Fixed `$*CWD` inside IO::Path.dir's :test Callable [b2a64a13] + Fixed regression with IO::Handle.close's value sunked in .slurp [84eb3599] + Made spaces and quotes escaped in MAIN() usage message [22bd2bbd] + Fixed dispatch hang in Str.match: Nil [1c21974d] + Made &slurp/&spurt/&get/&getc/&close `fail` instead of throwing [6fa4bbcb] + Made &lines/&words/&slurp/&spurt/&get/&getc/&close pass all of the given arguments to the methods they use [6fa4bbcb][34b58d1b] + Fixed handling of 8 digit hex literals in 32-bit systems [01dd2138] + Fixed $?BITS on 32-bit systems [d057efdb] + Fixed time stamp check interfering with packaging modules [ff4a034d] + Made perl6 usage message print to STDERR instead of STDOUT when an invalid cmd line option is used [2a6d3d1e] + Made sure Setty (^) Setty always returns a Set [4e37e7c5] + Fixed typed optional Array and Hash parameters [9f5c8e94][6231ecb0] + Made `$*HOME` default to Nil, not Any [7412184f] + Fixed crash on ^D to `$*IN` when reading with IO::ArgFiles [4b8fd4a4] + Fixed REPL crash when `$*HOME` is not set [1b0e41f9] + Fixed Test.pm6's &like crash when a non-Str is passed [ba3cf4e5] + Fixed Seq.perl for cached Seqs [54f50956] + Fixed crash in `eqv`, .iterator, .Slip, .join, .List, .list, .eager, .Array, .is-lazy, and .sink on cached Seqs [400f4ec8][c13d89b3] + Fixed role mixins with native attrs with defaults [6179ab34] + Fixed `andthen`-`orelse` chaining [37316f82][e1994d94][1ed76a90] + Fixed issues when `Empty` passed as arg to `andthen`/`notandthen` or postfix `with`/`without` [3c8822e8][e1994d94][1ed76a90][fdb2b2ab] + Fixed error in Iterable (+) Iterable if the Iterable contained Pairs [3d99321f] + Fixed .perl for IO::Path and subclasses [134efd83] + Fixed .IO on :U of IO::Path subclasses [69320e7f] + Fixed SetHash retaining the containers [551b8a69] + Fixed (Bag|Mix)Hash.values/.iterator/.pairs/.kv failing to check validity of assigned values [c1bd844e][0e0ac2fb][0338ce46][14e09532][c61c7f88] + Fixed 'ambiguous call' error in `eqv` and `cmp` with mixed allomorphs [e5870c11] + Fixed IO::Path.copy/move when source/target are same [08a8075f] + Fixed premature deletion of bin wrappers [c7aef59a] + Fixed ghost elements remaining when popping off an Array [c776c087] + Fixed rotate on empty list [b5c14bd1] + Fixed hang in .join/.gist in certain cases of flat slurpy positional arg [5e6b3878] + Fixed Str.comb(Int, $limit) for `<1` combers [a9959666] + Fixed Str.comb with empty-string comber [aa711c14] + Fixed unwanted split on read-chunk-size boundaries in IO::Handle.comb/.split by making them .slurp the entire file [973338a6] + Fixed crash in BagHash.pickpairs when given negative arguments [08b5c101] + Fixed incorrect results in `+>` for large negative numbers [ef29bb9f][66e8e72c] + Fixed is-deeply for Junction args [1c4d8451][dc5eece9] + Fixed crash in is-deeply when Seq type objects are given [f3f99b3a] + Fixed dispatch infiniloop in (elem) and (cont) [407bce1d] + Fixed issues with combiners on `/` in IO::Spec::Unix.is-absolute [f4309de9] + Fixed issues with combiners on `/` in IO::Spec::Win32.rel2abs [c96727aa] + Fixed crash when setting .nl-in/.encoding on unopened IO::Handle [06d8800e][70038855] + Made IO::Handle.open respect attribute values [95e49dcb] + Made IO::Path.parts a Map instead of Hash [9021a486] + Made IO::Spec::Unix.path consistently return a Seq in all cases [05479793] + Fixed IO::Spec::Win32.path failing to flatten resultant Seq [8992af13][816b2d4b] + Fixed IO::Handle.perl.EVAL round-trip [a282b8c8] + Made IO::Path.resolve set CWD to $!SPEC.dir-sep [a4127884] + Fixed unwanted padding Nils from Str.words($limit) [4bcf84a2] + Various improvements to warnings and error reporting [9962d2b6][9ed89d94][d87de586][6d28d788][8511081f][4f9fa6b0][12cec7a7][d1a81b30] [85c54db8][fc5698bd][1cf7ccba][0bd39de2][12c50b63] + Additions: + Made user grammars work more like real classes [db42d62f] + Loading deps no longer uses file timestamps [ca0a7439] + Changed type constraint on &slurp/&dir from Cool:D to IO() [6fa4bbcb][d0cd1372] + Added IO::Handle candidate for &spurt [6fa4bbcb] + Added Pair.Pair method [bd9e5730] + Added Seq.Capture method (makes it possible to unpack Seqs in signatures) [98e137b1] + Added QuantHash.Capture [5e74017d] + Made `(^)`, `(+)`, `(.)` multis [8b8f66c0][44893e6a][48ce8701] + Added primary and foreign key constraints and renamed some fields in profiler's SQL output [c776c087] + Added WhateverCode candidates to Map.roll and (Bag|Mix)Hash.grabpairs [1e58925c][2bda2703] + Made Baggy.roll/.pick/.grab Int-ify their $count arguments [31be5128] + Added big int support for `+<` and `+>` ops [6409ee58][ef29bb9f][66e8e72c] + Made Date.clone take a formatter [a9a161ae] + Added `$*DISTRO` and `$*KERNEL` information to `perl6 -V` output [94c4e7bf][b6496eda] + Made `perl6 -V` sort its output [85230d06] + Added support for `$*KERNEL.archname` [0c46aff2] + Added `$*PERL.compiler.verbose-config` [85230d06][c3b47280] + Added typed exceptions to IO::Handle.flush [b43ed18f] + Added support for building the dist in install-dist.pl [4298dd5e] + Simplified getting osname from VM.config [7c8f8d3e][18706852] + Added VM.osname as a rough equivalent to Perl 5's `$^O` [e79d7498][505ee33d] + Now show `System::Info` information with -V if module is installed [5feb3906][541597b8] + Made IO::Handle.encoding settable via .new [7e9496dd] + Added Proc::Async.ready [d76206e7] + Implemented $limit arg for IO::Handle.words [84502dc2] + Removals: + Removed IO::Handle.iterator that existed for a couple of releases [eb8d006e] + Removed unspecced Seq.is-ready method [59f6f485] + Removed broken Exception.resumable method [f2af3db1] + Removed argument forwarding from Instant.DateTime coercer [6bb1b5b4] + Removed IO::Path.dir's :absolute and :Str arguments [aa72bdef] + Removed .tell info in IO::Handle.gist [276d4a7e] + Removed `:directory` from Map returned by `IO::Spec::*.split` [6ed14ef6] + Efficiency: + Made Mixy (^) Mixy about 150x faster [9f0b1218][bea8ac68] + Made Baggy (^) Baggy about 150x faster [ee459360] + Made IO::Spec::Win32.is-absolute about 63x faster [c6fd7361] + Made Map (^) Map about 50x faster [13924397] + Made Setty (+) Setty about 45x faster [14568496] + Made Baggy (+) Baggy about 50x faster [ab5cd11b] + Made Mixy (+) Mixy about 45x faster [92df7d5c] + Made Setty (.) Setty about 35x faster [1562da07] + Made Baggy (.) Baggy about 35x faster [3f97831d] + Made Mixy (.) Mixy about 35x faster [226cd8b6] + Made IO::Spec::Win32.path 26x faster [8992af13][816b2d4b] + Made IO::Spec::Cygwin.is-absolute 21x faster [48cf0e67] + Made Setty (^) Setty about 20x faster [d92a2123] + Made Iterable (+) Iterable about 18x faster [6de08933] + Made Map.pick()/roll() about 7x faster [2fb6872b] + Made Baggy.pickpairs about 5x faster [c0270c66] + Made IO::Spec::Unix.path 4.6x faster [05479793] + Made (Bag|Mix)Hash.grabpairs/.grabpairs(N) about 4x faster [911b43de][3670720a] + Made Str.words/.lines with $limit arg lazy and up to 3.6x faster [4bcf84a2] + Made Iterable (^) Iterable about 3.5x faster [b2332816] + Made Map.roll(N) up to 3x faster [c74d37ba] + Made Mixy.roll(N) about 3x faster [b9222061] + Made IO::Spec::Unix.rel2abs 2.9x faster [277b6e5b] + Made Map (+) Map about 2.5x faster [a85b654d] + Made Map (.) Map about 2.5x faster [9c9ebd0b] + Made Iterable (.) Iterable 2.5x faster [3d99321f] + Made Mix.roll() about 2.5x faster [a2602b9c] + Made `notandthen` and postfix `without` 2.5x faster [fdb2b2ab] + Made `andthen` and postfix `with` 2.5x faster [3c8822e8] + Made `orelse` 2.4x faster [37316f82] + Made IO::Path.is-relative about 2.1x faster [ff23416b] + Made Baggy.pickpairs(N) about 2x faster [0f21f511] + Made 1-arg IO::Handle.say up to 2x faster [76af5367] + Made BagHash.roll 1.7x faster [07feca67] + Made MixHash.total 1.4x faster [5e459bce][4c813666] + Made IO::Spec::Win32.split about 82% faster [894ba82d] + Made IO::Path.is-absolute about 80% faster [74680d44] + Made `&say(**@args)` up to 70% faster [204ea59b] + Made `&put(**@args)` up to 70% faster [6d7fc8e6] + Made `+>` about 55% faster [ef29bb9f] + Made `<+` about 12% faster [6409ee58] + Made IO::Spec::Unix.join about 40% faster [d2726676] + Made IO::Handle.put($x) about 5%-35% faster [50429b13] + Made BagHash.grab 30% faster [2df7060c] + Made IO::Path.dir up to 23% faster [aa72bdef] + Made Baggy.roll about 15% faster [9e7d0b36] + Made BagHash.grab(N) about 10% faster [87a95fc1] + Made Baggy.EXISTS-KEY about 8% faster [451a2380] + Made List.AT-POS about 5% faster for common path [736be4d4] + Made IO::Spec::Win32.rel2abs 6% faster [c96727aa] + Made Hash.EXISTS-KEY about 1% faster [eb1ce414] + Micro-optimized reg/init dynamic [1d6a0023] + Speeded up module loading a bit by persisting source checksum [3829488f] + Assorted internal improvements to CPU/memory use [89f2ae4f][3c7cd933][aa23a91f] [7c531835][ccedd6b1][3dc08553][514124e3][146f3a39][9cb26c09][afd24a88][f2fc5674] [6641df83][d6cf518c][f18d0dc0][1a920dcc][bdb5391b][b1fbd133][7404c706][762fd239] [fec547a1][5ec8a464][8088f080][45305eca][e7087f29][f4017c32][3f7d1334][6ea2f12e] [788e6de6][3fb3c27e][09506dc8] The following people contributed to this release: Zoffix Znet, Elizabeth Mattijsen, Pawel Murias, Daniel Green, Samantha McVey, Stefan Seifert, Jan-Olof Hendig, Larry Wall, Tom Browder, Timo Paulssen, Christian Bartolomäus, Jonathan Worthington, Will "Coke" Coleda, eater, Curt Tilmes, Nick Logan, Trey Harris, Brian S. Julin, Lloyd Fournier, Robert Lemmen, Brad Gilbert, Antonio Quinonez, Carl Mäsak, Christopher Bottoms, Moritz Lenz, David Warring If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#112), is tentatively scheduled for 2017-06-17. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.06.md0000644000175000017500000002520713253717231015527 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #112 (2017.06) On behalf of the Rakudo development team, I’m very happy to announce the June 2017 release of Rakudo Perl 6 #112. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.06: + Fixes: + Fixed incorrect auto-boxing to native candidates in multi dispatch [ccfa5e51] + `^Inf .elems` now fails instead of returning Inf [20310d7d] + Made IO::Handle.print/.put signature consistent [613bdcf8] + Made sure that Setty:U is treated like any type object [ad8fa552] + Fixed behaviour of set() `(<)` X.Set [e6506bfd] + Made sure VM.osname always returns lowercase string [122aca1c] + Fixed List.Capture with non-Str-key Pairs [5b25836f] + Fixed inconsistency in .Int on zero-denominator Rats [6dbe85ed] + Fixed crash in smartmatch of non-Numerics with Numeric [43b03fc6] + Fixed occasional Windows file permission issues with installation of modules [8ec4dc5b] + Fixed crash in `X` operator used with empty List [9494cbd3] + Fixed spurious warnings/crash with certain `=para` Pod blocks [5e339345][807d30c2] + Fixed output of `CArray[Pointer].^shortname` [1ed284e2] + Fixed crash in Test.pm6's bail-out when used before tests [cb827606] + Fixed object Hash -> Set coercion failing to consider values [160de7e6] + Fixed Seq.perl for containerized Seqs [b22383fe] + Fixed Proc::Async.new not slurping first positional [92c187d2] + Fixed Proc::Async.kill failing to kill sometimes [99421d4c] + Fixed hang in deepmap with Iterable type objects [252dbf3a] + Fixed crash when Junctioning empty array after .elems'ing it [aa368421] + Fixed crashes/LTA errors in Junction.new w/wrong args [61ecfd51] + Fixed `infix:` calling .defined one too many times [77d3c546] + Made `fail` re-arm handled Failures given as arguments [64e898f9] + Fixed output of IO::Special.perl [7344a3d2] + Made IO::Handle.open with path '-'.IO properly handle non-default `$*OUT`/`$*ERR` [3755c0e7] + Fixed Promise.then to not lose dynamic variables [36bc4102] + Fixed allomorph smartmatching with Str values [8a0b7460] + Fixed IO::Path.extension with Range `:parts` when endpoints were excluded [8efffb1d] + Made coercion of lazy Iterable to Setty fail [211063c7] + Made Mixy/Baggy.new-from-pairs with a lazy Iterable fail [c9dfa840][e5719d6a] + Fixed byte.Range returning an incorrect range [af85d538] + Fixed edge-cases (e.g. Nan/Inf) in Mixy.roll [fb9e1a87] + Made sure that Mixy types only take Real values [7fa85682] + Fixed incorrect results in ignorecase+ignoremark regex matches [1ac7996a] + Fixed issues with `$*CWD` inside &indir when using relative paths [9151ebaa][326faed6] + Fixed crash with Seq:U.List [5c56e9e7] + Fixed various issues with Map `(<=)` Map [e1563a76] + Fixed various issues with Map `(<)` Map [b03d8044] + Fixed 4 cases of crashes with labeled `next` [3b67b4ac] + Made Proc.status/Numeric/Bool/exitcode/sink wait for Proc to be done [e4468c61] + Fixed Pair.perl with type-object components [c6b03c45] + Fixed bad shell quoting in Proc::Async on Windows [e9b30933] + Fixed crash when RAKUDO_MODULE_DEBUG was set to a non-numeric value [96e6b338] + Fixed Kernel.signals on OpenBSD [9435c14e] + Various improvements to warnings and error reporting [1c16bf2e][85bef661][e22508d4] [b6694bd0][ec51e73f][f2fca0c8][f9403b3b][86fe766a][c81b7a4b][7cf01296][fb7dd8a4] [7783fcab][9bf3ea3a][02614f64][e538cbc5][86c3d7aa][c2497234][b0a1b6c3][97298aca] [69b1b6c8][5e037736][e824266f] + Additions: + Implemented IO::CatHandle [5227828a] + Implemented support for merged STDOUT/ERR output Proc and Proc::Async [ac31c5df][05d8b883] + Implemented Complex.cis [a243063c] + Implemented Failure.self [0a100825] + Implemented Any.Seq [5c56e9e7] + Improved consistently to have .Supply on a type object it as Supply [52d39576] + Slightly changed IO::Handle.encoding; Nil now means 'bin' [95b4e5d5][27f09e9d][9c0362cb][51c73ba0] + Gave `(<=)` Baggy and Mixy semantics for Bags/Mixes [b1d83f9d] + Makde `use lib` accept IO::Path objects [3ff29d42] + Added IO::Socket.nl-out attribute [12d31e36] + Added Setty.pickpairs [e3695b16] + Added Str type constraints to IO::Spec::Win32 .join and .catpath [232cf190] + Made it possible to call &prompt with no args [0646d3fa] + Made IO::Socket::INET update localport if it binds on port 0 [bc98e671] + Improved support for Unicode properties `Prepend` and `Regional Indicator` [56e71d59] + Gave IO::Handle.read default value for size arg [b7150ae1][aa9516be] + Added default output for Mu.WHY [23d6d42d][cc4d9091] + Added support for binding to standard handles in Proc::Async [6b2967d7] + [JVM] Implemented Proc::Async [5154b620] + Removals: + Removed TAP.pm6 from core. Available as `TAP::Harness` in the ecosystem [ae891f93] + Removed all methods from IO::ArgFiles and made it a subclass of IO::CatHandle [f539a624] + Removed IO::Socket::INET.ins [75693b0b] + Removed NYI IO::Socket.poll method [cb404c43] + Efficiency: + Made Any (elem) Iterable:D between 1.3x and 110x faster [e65800a8] + Made `(<=)` and `(>=)` about 50x faster [32eb285f] + Made IO::Spec::Win32.catpath 47x faster [7d6fa739] + Made `(<)` and `(>)` about 40x faster [431ed4e3] + Made IO::Spec::Win32.join 26x faster [494659a1] + Made IO::Spec::Win32.splitdir 25x faster [2816ef71] + Made Map `(<=)` Map about 15x faster [0cb4df44] + Made Map `(<)` Map about 15x faster [f6f54dcf] + Made Str.subst(Str) without :g 14x faster [0331fb9d] + Made Setty.roll about 11x faster [e6192ca8] + Made IO::Spec::Unix.splitdir 7.7x faster [6ca702fa] + Made invocation of Proc.spawn and &run 4.6x faster [93524fb9] + Made SetHash.grab(N) about 3.5x faster [67292a1e] + Made SetHash.grabpairs(N) about 3.5x faster [0e9ee0d1] + Made invocation of Blob.decode() 2.7x faster [222b4083] + Made Baggy/Mixy.(hash|Hash) about 2.5x as fast (on a 26 elem Bag/Mix) [06cd0bc3] + Made Setty.roll(N) about 2x faster [18dd0741] + Made Setty.pick about 2x faster [10e9c8ba] + Made Set.new(@a) about 2x faster [b55a0f16] + Made Baggy.new(@a) about 2x faster [11f27a30] + Made SetHash.grab about 1.8x faster [d28540be] + Made Str:D (elem) Map:D 1.3x faster [b43303f2] + Made `$*KERNEL.signal` 64% faster, overall [79b8ab9d][01d948d2] + Made Iterable.Bag about 60% faster [f2876281] + Made Iterable.Mix(|Hash) about 40% faster [bba6de5f] + Made Setty.pick(N) about 30% faster [071c88cb] + Made StrDistance 25% faster [2e041b06][9185fa2c] + Made (Bag|Mix).AT-KEY about 10% faster [b43db636] + Made `infix:<∉>` about 10% faster [abfb52be] + Made Str.starts-with 8% faster [7ecb59dc] + Made .Set, .Bag, and .Mix coercers a few percent faster [8791b447][4139b96e][8c7e4e51] + Fixed lost optimization of for ^N {}; now its 3x faster [46b11f54] + Made &DYNAMIC about 1% faster [74242e55] + Made ^Inf marginally faster [446dc190] + Assorted internal improvements to CPU/memory use [2efd812c][07bff0e5][1369632f][2ac120ce] [539415cf][5ebf307a][ed07b2c3][0104a439][a91a2e4d][bd292225][8ff980e7][7edf9da6][241d2925] [7e8bac9b][3363c7b9][6f932687][e9b30933][51b63bf9][57553386][1171e67e] + Internal: + Refactored handle encoding. Non-binary read methods now throw when used on handles in binary mode [41bb1372][b3cd299e] + Refactored socket encoding [8ee383e3] + Made syncronous IO to not use libuv [05f3e9a0] + Made syncronous sockets to not use libuv [6f202fbe] + Moved encoding and line ending bits to IO::Socket [d6fd2491] + Moved get and lines to IO::Socket role [9cec9408] + IO::Path.Int method removed; handled by Cool.Int now [d13d9c2e] + Re-implemented Proc in terms of Proc::Async [ac31c5df] The following people contributed to this release: Elizabeth Mattijsen, Jonathan Worthington, Pawel Murias, Jan-Olof Hendig, Samantha McVey, Christian Bartolomäus, Daniel Green, Tom Browder, cono, Will "Coke" Coleda, Stefan Seifert, Antonio Quinonez, Nick Logan, Dan Miller, Steve Mynott, JJ Merelo, Lloyd Fournier, Juan Julián Merelo Guervós, Gabor Szabo, Trey Harris, Eckhart Arnold, Julien Simonet, Moritz Lenz, Timo Paulssen, flussence, raiph, Kris Shannon, Aleks-Daniel Jakimenko-Aleksejev, Fyodor Sizov, Zoffix Znet If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#113), is tentatively scheduled for 2017-07-15. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.07.md0000644000175000017500000002333213253717231015525 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #113 (2017.07) On behalf of the Rakudo development team, I’m very happy to announce the July 2017 release of Rakudo Perl 6 #113. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo, but no new features. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.07: + Deprecations: + Deprecate `(<+)` ≼ `(>+)` ≽ in favor of `(<=)` ⊆ `(>=)` ⊇ [35cc7c0e] + Fixes: + Fixed perl6-debug-m debugger [6d4691fb] + Fixed finding proper %?RESOURCES for non-lib CURFS [71ffb164] + Fixed Mixy (-) Mixy behaviour for missing keys [4a37de7b] + Fixed Mixy.Setty coercion [b31b159c] + Fixed .perl of empty Bag and Mix [f72c97cb] + Fixed crash on dotless version literals given to `use` [fe7ea124] + Fixed various coercion related issues with (-) [19a1caa3] + Fixed Baggy/Mixy (-) Any/Iterable [a2133dbc] + Made sure we catch lazy lists on right of (-) and (|) [62d54c75][c16334e5] + Fixed mix() (-) `.Mix` [c727462c] + Fixed multi-dispatch with numeric literals and native types [1c0ed61a] + Fixed enum.Real coercion [ad9ed1cb][c226b71a] + Fixed (:e).Bag|Mix coercion using a Bool as a weight instead of just Int [d765f186] + Fixed outstanding issues with coercions done by (+) [c7922f14] + Fixed a data race in Proc::Async [2a8d1e7c] + Fixed `(&)`'s handling of lazy lists [cb06ebac] + Made set ops properly handle lazy lists [04746490][3058ba0d] + Made sure unhandled failures don't coerce QuantHashy [43fc751b] + Fixed sprintf octal format with precision [d7e10466] + Fixed 'is export' on constants assigned to routines [d067abf4] + Fixed Deprecation.report case where "removed" is set and "from" isn't [1b6d048b][e20817fb] + Fixed crash in coercers used with sigilless vars [c76d9324] + Made sure IO::Socket passes a list to set-line-separators [a2090821] + Prioritized .pm6 extension over .pm when files with both extensions exist [e1e9091f] + Fixed SEGV in Proc::Async.new [f6d4fbd2] + Fixed a few edge cases of (^) wrt QuantHash type permutations [b3916926] + Fixed regression in Map intialized with `<...>` having writable containers [4894a75d] + Fixed overflow in uniprop lookups [4f5a1e20] + Made improvements to segmentation of Emoji w/ GCB=Other [4f5a1e20] + Fixed break after ZWJ for Emoji=True + GCB=Other [4f5a1e20] + Removed faulty Iterable (^) Iterable candidate [4c91b522] + Fixed faulty Map (^) Map candidate [8afbfe6f] + Fixed inconsistent semantics in `.Bag (<) .Bag` [4b8bc617] + Fixed unwanted de-Bool during optimization of some constructs [83e15701] + Fixed handling of actions in .refine_slang [c40a2122] + Fixed baggy semantics of Mix `(<)` Mix [a526d839] + Fixed semantics of `mix() (^) (a=>-42).Mix` [8d5f3324] + Fixed precomp deps left open when up-to-date check failed [37250ed5] + Properly implemented Baggy semantics for `(<=)` and `(<)` [4101581d][c6cc1a7a] + Fixed handling of `[(^)]` with absentee keys and Mixies correctly [0c02f93e] + Fixed faulty dynamic cache invalidation in continuations [d74ebd82] + Fixed issues with calling `infix:<⊖>` with more than 2 params [aee4a46c] + Fixed Proc :merge [c86090e3] + Made sure we call done/quit on all taps [32b72cda] + Ensured empty string PERL6LIB var does not get interpreted as `.` [075ddefa] + Fixed floating point noise in denominator of Rat literals [f6e25b54] + Fixed .getc and .readchars reading too much at EOF [80bbfcdd][49f555a2][f6279c34] + Fixed SEGV and memory leak in MoarVM that impacted parameter destructuring [f6279c34] + Made `exit()` coerce its argument to Int [caa9ef81] + Made IO::Handle.new coerce `:path` to IO [fec90956] + Various improvements to warnings and error reporting [bde28209][06379113][d5d3bd27] [d39f7b9a][1dda8622][d74ebd82][88acdbb7] + Additions: + Added full Unicode 9.0 and Emoji 4.0 text segmentation support [c40a2122] + Implemented tentative API for custom user encoder support [d0995f68][5ab4036e] + Implemented experimental buffering support in IO::Handle [86e7b2bd] + Collation object updated to work with new unicmp_s semantics [4da85879][47678077] + Allow getting native descriptor in Proc::Async [82301128] + Re-worked Proc so :in($p1.out) will plumb file descriptors [6dae179a][abfd7d95] + Added plumbing stdout/stderr to stdin in Proc::Async [11b02d2c] + Allow for "does Rational" and "does Rational[foo]" [41ed2c03] + Added `%*SUB-MAIN-OPTS` [40b0169d][da6c6584] + Implemented baggy semantics of `(<)` and `(<=)` [75797af3] + Added perl6-lldb-m for debugging MoarVM on the LLVM debugger [00dc4947] + Efficiency: + Made Baggy (-) Baggy about 100x faster [2a88c20c] + Made [(^)] Set, Set, Set about 35x times faster [0cdd6c25] + Made Setty (-) Setty at least 20x faster [10f840fc] + Made .BUILD/.TWEAK calls 15x faster when ther are no args to .new [43c1767b] + Made (Bag|Mix).WHICH about 8x faster [b2d2bf59][c585f370][d8c94353] + Made Map (+) Map between 3x and 6x faster [495fb5f8] + Made Baggy eqv Baggy upto 3.5x faster [49b1b03b] + Made Setty.ACCEPTS(Setty) about 3.5x faster [93d81d61][48c18f58][1ab4fd80] + Made Map.(Bag|Mix) 2.5x to 5x faster [72e5d614] + Made Setty eqv Setty between 2x and 3.5x faster [25047984] + Made Setty (-) Map between 2x and 3x faster [9936a3be] + Made Setty (-) Iterable about 3.5x faster [b66d8783] + Made Str.subst(Str,Str) upto 3x faster [327c8409] + Made Setty (+) Map about 2.5x faster [201a0bfb] + Made Any (-) Map|Iterable about 2x faster [e4f3358f] + Made Mix (+) Mix about 1.5x faster [d1838461] + Made Baggy (-) Baggy about 1.5x faster [36823ab1] + Made starting of installed scripts 46% faster [92f8abe0][4693ec86] + Made Baggy.keys about 40% faster [c65652d8] + Made Iterable (+) Iterable about 20% faster [38509227] + Made Setty (-) Setty about 20% faster [bacaa051] + Made internal nqp::index op used by many string operations 16% faster [4f5a1e20] + Made Setty.(Bag|Mix) about 5% faster [ae4c04ce] + Made Str:D (elem) Map 3%-10% faster [099a84b4] + Made Stash.AT-KEY a few percent faster [2ce5b678] + Gave Nil methods a much more efficient "take any args" signature [9a2127f2] + Made Exception messages created only when gisting [1a4d9493] + Made Any.tail() use iterator's .count-only if available [9c04dfc4] + Reduced cases when string concatenation needs renormalization [c40a2122] + Improve the speed of Unicode normalization [c40a2122] + Made all non-Texas set operators aliases where possible [f6025eb9] + Simplified `infix:<(|)>(**@)` candidate [46e009bf] + Fixed various VM errors in CallFrame. [e2ec7bdf] + Improved speed of `try` when exceptions are caught [1a4d9493] + Assorted internal improvements to CPU/memory use [3d2a521c][5a80412c][c4e14731][19be8722] [f03a176c][fff43337][f71cbed4][79ce1a99][640404fc][b4561229][30619e8d][9d14a724][a2a0d5c6] [66aef589][a95c70bd][d7e10466][73c3bcc6][7f109ed7][80b3e89b][05c255c1][2fb109f1][c0eeebde] The following people contributed to this release: Elizabeth Mattijsen, Zoffix Znet, Jonathan Worthington, Jan-Olof Hendig, Will "Coke" Coleda, Pawel Murias, Samantha McVey, Nick Logan, Stefan Seifert, Timo Paulssen, Altai-man, Larry Wall, Daniel Green, karl yerkes, seatek, Moritz Lenz, Brad Gilbert, LLFourn, Tom Browder, Lloyd Fournier, ven, Gabor Szabo, Vynce Montgomery, Greg Donald, Brian Duggan, Steve Mynott, Aleks-Daniel Jakimenko-Aleksejev If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put "Perl 6 Core Development Fund" in the 'Purpose' text field) The next release of Rakudo (#114), is tentatively scheduled for 2017-08-19. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback -- get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.08.md0000644000175000017500000002135713253717231015533 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #114 (2017.08) On behalf of the Rakudo development team, I’m very happy to announce the August 2017 release of Rakudo Perl 6 #114. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] — it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.08: + Security: + Removed '.' and 'blib' from nqp's default module search paths [7e403724] [a331c804][1eeb9434] + Fixes: + Fixed IO::Path.new with 0 allomorph [45cd1a97] + Fixed erroneous closing of standard handles in DESTROY [0e578c4f] + Fixed handling of already existing .moarvm files during install [02667bd8] + Fixed --ll-exception [559c9255] + Fixed native callbacks called from other threads [b81597bd][1d941643] + Fixes concat with combining codepoints and repetitions [1f7fa683] + Fixed TODO test handling inside TODOed subtests [5b77a8aa] + Fixed formatting of X::Numeric::DivideByZero [3f99d1d0] + Fixed potential concat issue [3028466c] + Fixed null handling in List.join [9b5cce0a] + Fixed handling of default values in Array [12d7d5b4][2fb8c725] [0970ba33][ccaa0665] + Fixed error message for postcircumfix [ ] called with a type object [1a74a8c3] + Made .unique|repeated|squish return containers if applicable [51e59eeb] + Fixed string comparison issues [0564891e] + Fixed is-lazy of iterators created with R:I.FromIndexes [4db23064] + Fixed pull-one of iterators created with R:I.MonotonicIndexes [0c19f549] + Fixed compiler explosion with import statement [3e078d4d] + Fixed is default() trait on Attributes [a7d2ad1d][148ba7f2] + Made sure to stop socket reader on close [21359560] + Fixed missing tap closes in `whenever` [59f4123e] + Fixed missing tap closes in Supply [c59b9867] + Fixed potential memory leak of supply/react [5fcce673] + Fixed Mix.roll with fractional weights [a91ad2da] + Fixed reproducibility of RAKUDO_MODULE_DEBUG output [ec7bc25c] + Fixed Pair.WHICH [4f1322d0][c229022c] + Fixed ignoremark issues [7b81f0f9][a3b95749] + Fixed bad assumption about methods being closures [231cb3f5] + Stopped hllizing and sinking the result of .+, .* and .= method calls [2b8115f0] + Fixed native shaped array index to return l-value [61e1f4d5] + Fixed handling of test descriptions with new lines [9303a6e4] + Fixed wrongful escaping of `# SKIP` TAP instruction [eb529f14] + Fixed returned exit code when running a MAIN script with --help [fcf61f7b] + Various improvements to produced messages [9b31d1f5][998535ed] [6d3ba60c][365a1d08][cff51ea1] + Additions: + Added Buf subbuf-rw method [d7af4aeb] + Added ACCEPTS method to Map to compare Maps [45ca084e] + Treat :ver<...> like a version instead of a string [247fc649] + Improved Version smart match with different lengths [01dbd874] + Added new peer/socket host/port values in async sockets [76af17a8] + Added .Complex coercion method to Cool [c9de2184] + Added atomic operations (⚛) [9b1e252a][92707fac][c67d7dd5][ca8aafc1] + Build system: + Added --libdir option to Configure.pl [e4d65ac9] + Fixed quotes for windows [90a0f2e0] + Added 'install' test target on appveyor [9c0d40ab] + Efficiency: + Made `$s (-) $s (-) $s` on a 26 elem set about 1.5x faster [d7fcb314] + Made .Str and .perl 2x faster, .gist 1.4x faster (on a ^100 .Set) [5b6cd406] + Made .Str 30% faster, .perl 2x faster (on a ^100 .Bag) [21b9a720] + Made string concatenation more efficient [1f7fa683] + Made Mixy.roll up to 2x faster [d3f260c9][e2ca1ffa] + Made Baggy.roll up to 1.5 faster [e548b743] + Made Baggy.roll(N) about 1.5x faster [752a3265] + Made List.roll(*) about 1.5x faster [b147217e] + Made .unique(:as) 3% faster [a636fa8f] + Made .unique(:with) about 4x faster [47d9bd9b] + Made .unique(:with(&[===])) about 20% faster [26789cc7] + Made .unique(:as,:with) about 12x faster [acf9f90d] + Made .repeated(:with) about 4x faster [d9056207][c3851aee] + Made .repeated(:as,:with) about 12x faster [a3a3d1a9][32ce4afd] + Made .pairup about 1.5x faster [8f73d77b] + Made .codes 350% faster for short strings [3c6277c7][e051dd2d][4eff4919] + Various improvements made by using `is default` on attributes [08f705b9] [d0419a0f][9f5686ec][c8c5c712][40d5b27d][fb5db592][413b7116][fbdbe6fb] + Made Map eqv Map about 10% faster [15b2596e] + Decreased the cost of Supply block teardown [5d200f1e] + Saved 2 method calls per NativeCall call [aca4b941] + Speeded up NativeCall by replacing the subroutine code in setup [46ef1b5b][9a0afcbc] + Speeded up NativeCall subs by compiling specialized subroutine body [cd7dc4ce] + Internal: + Introduced Mixy!total-positive [f49c49bb][ccf6da9e] + Set debug_names of DefiniteHOW and CoercionHOW types [b22d189e][c040f1a6] + Simplified `infix:<(+)>(**@p)` and `infix:<(.)>(**@p)` [d82db18f][a0775e5e] + Ensured Scalar fetch can never return a NULL [2f5a6cd9] + Changed RAW-KEYS to create iterator early [710fa800] + Made sure Setty at least has a R:I:IterationSet type object [2dd5963c] + Made R:I:Mappy roles also take IterationSets [ab08bd04] + Made Setty.values use R:I.Mappy-values directly [250ae102] + Made R:I:Mappy* roles use a more abstract name for low-level hash [b7953d0d] + Retired R:Q:Quanty in favor of R:I:Mappy [d9055e80] + Introduced R:Q.RAW-VALUES-MAP [923c32e6] + Simplified the .Seq coercer [5d89cef9] + Changed Baggy to no longer use HLL hash internally [fb7ecb60] + Changed Supply implementation to use iteration, not recursion [ed87f998] + Added tests for native int as index to CArray [6cc858a0] + Simplified Hash creation for auto-vivification [84d052a0] + Various spesh, JIT, GC and other improvements [86cb1363][8bed4a67] [9658dd98][c1e41f9f][f590863e][4561c269][947376e2][1455a03b] + Introduced R:I.TwoValues [20e93d89][50f0508f] + Fixed some issues with R:I.OneValue [3ad33469] + Streamlined the standard Seq methods on Pair [30584dac] The following people contributed to this release: Elizabeth Mattijsen, Jonathan Worthington, Zoffix Znet, Samantha McVey, Will "Coke" Coleda, Pawel Murias, Aleks-Daniel Jakimenko-Aleksejev, Stefan Seifert, Jan-Olof Hendig, David Warring, Nick Logan, Larry Wall, Daniel Green, Timo Paulssen, Lucas Buchala, Christopher Bottoms, Brian Duggan, Altai-man, Lloyd Fournier, Will Coleda, Nic Q, M. Faiz Zakwan Zamzuri, Sam Morrison, brian d foy, Vynce Montgomery, Patrick R. Michaud, Oleksii Varianyk, JJ Merelo, Julien Simonet If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put “Perl 6 Core Development Fund” in the ‘Purpose’ text field) The next release of Rakudo (#115), is tentatively scheduled for 2017-09-16. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback – get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.09.md0000644000175000017500000001671113253717231015532 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #115 (2017.09) On behalf of the Rakudo development team, I’m very happy to announce the September 2017 release of Rakudo Perl 6 #115. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] — it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.09: + Fixes: + Fixed NativeCall signature check for unsupported native types [4077842c] + Fixed .made called on a Match on which .make was never called [5db5b1db] + Fixed flattening of a typed hash [6cec6b72] + Fixed iterator on pairs with Mu's [a5014fd0] + Fixed Supply.batch with non-int elems and elems == 1 [98f9fffe][7d1ece80] + Improved error message on nameless postfix `.::` [5969f21e] + Fixed ::("GLOBAL") [1f6a782c] + Refined merging of one() junctions [79604a88] + Fixed error message with leaking variable name in FailGoal [ed4f6cc9] + Implemented missing Instant.Instant [51709e01] + Fixed thread safety issues with signal introspection [1f411693] + Fixed thread safety issues in the `signal` sub [13b6a33c] + Fixed thread safety of "foo{$x}bar" [59454b03] + Made Bool.enums consistent with Enumeration.enums [e7a58806] + Fixed doubled path issue in IO::Notification.watch-path [2362dfd6] + Disabled interactive REPL for non-TTY input [b6a60236] + Fix ignoremark and casechange operations of graphemes which begin with Unicode Prepend characters [7f526c1e] + Suppress line number in X::Package::Stubbed [edac1d68][7ba9b7cd] + Fixed race condition in Channel awaiter [b30ac08a] + Fixed NYI compilation of NativeCall sigs with optional params [1818de98] + Fixed missing deconts in nqp::eqaddr() tests [880b33e2] + Fixed Enumeration:D === Enumeration:D [8d938461] + Fixed non-blocking await when holding locks [f26d1e24] + Fixed non-blocking await-all to respect Slip [a137c0de] + Additions: + Added support for Str operations with Junctions [753c9a5e][7cd153f4] [95a70ca3][0b19baf0][d2f31bb7][e18291e2][8b5d283c] + Added support for Unicode 10 [64dd94c2] + Added complete Unicode Collation Algorithm implementation [9b42484a] [5f335065][ec18efa0] + .collate/coll/unicmp operators are no longer experimental (Note: $*COLLATION dynamic variable is still experimental) [5f335065] + Added Thread.is-initial-thread method [59a2056a] + Added output buffering for non-TTYs [44680029][4b02b8aa] + Made temp and let on a Failure throw it [80a3255b] + Made sure that open files are properly closed on exit [3c9cfdba] [97853564][347da8e5][dd8d0d89] + Implement pred() and succ() for the Enumeration role [2645a1e9] [8d442a52][8df53f34][43e41ec6][55aa7f28][f925c648][69dae1f3][2ad51a0f] + Added isa method to SubsetHOW [0704cd97] + Build system: + Made t/harness* use 6 TEST_JOBS by default [8019c15b] + Added --ignore-errors option to Configure.pl [0bc1c877][1da075f9] + Fixed `make test` without `make install` first [fb0b3eb5] + Made Configure.pl refuse to work without ExtUtils::Command [3f4a9ffa] + Fixed non-installed gdb/valgrind runners [4e3f0fca] + Efficiency: + Knuth-Morris-Pratt string search has been implemented for string indexing operations (needles between 2 and 8192 in length) [593fa5f8] + 1.5-2x speedup of most string operations involving strands [5ebbc5ba] + 2.5x speedup for eq() for comparing two flat strings (1.7-2x for others) + 9x speedup when indexing with a needle one grapheme in length [8a215876] + Made `Any ~ Str` and `Str ~ Any` about 25% faster [815faa35] + Made index and eqat operations 2x faster [5ebbc5ba] + Made all(@a), none(@a), one(@a) about 9x faster [51c3d86c] + Various improvements to BUILDPLAN and BUILDALLPLAN [7da0c215][0ca5ffa4] [760530a5][80e069a4][2574f883][b706b843][963b28d1][532f7092] + Made object creation 25% faster in some cases [62fd5093] + Internal: + Simplified setting up auto-threading [8a0f6ac1] + Streamlined Junction .defined, .Bool, .ACCEPTS [e8137b45] + Added --no-merge option to t/harness5 to pass through STDERR [4af1d95c] [84b40cf5] + Various improvements to INTERPOLATE [215a5fa7][ea57cbec][c6aacafd] [47439e69][4c25df74][fc632cd8] + Some minor cleanup on R:I.FirstNThenSinkAll [9dbc3c50] + Fixed --ll-exception to give full thread backtrace [0877278e] + Various heap analyzer API changes [bfee5a1e] + Streamlined exit / END phaser handling [1adacc72] + Made junction optimizer only look at candidates [4de858a5] + Assortment of low-level improvements [cbce6721][8a215876] [9b42484a][a4ce97ca] The following people contributed to this release: Elizabeth Mattijsen, Aleks-Daniel Jakimenko-Aleksejev, Pawel Murias, Will "Coke" Coleda, Samantha McVey, Jonathan Worthington, Moritz Lenz, Steve Mynott, Wenzel P. P. Peppmeyer, Nick Logan, Daniel Green, Zak B. Elep, Stefan Seifert, Philippe Bruhat (BooK), Timo Paulssen, Altai-man, Christian Bartolomäus, Cuong Manh Le, Brian S. Julin, Claudio Ramirez, Juan Julián Merelo Guervós, Christopher Bottoms, rafaelschipiura, Lance Wicks, Jeremy Studer, Adrian White, David Warring, Leon Timmermans, andreoss, Andrew Ruder, Douglas L. Schrag, Peter Stuifzand, John Harrison, Salve J. Nilsen, Zoffix Znet If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put “Perl 6 Core Development Fund” in the ‘Purpose’ text field) The next release of Rakudo (#116), is tentatively scheduled for 2017-10-21. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback – get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.10.md0000644000175000017500000002377313253717231015530 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #116 (2017.10) On behalf of the Rakudo development team, I’m very happy to announce the October 2017 release of Rakudo Perl 6 #116. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] — it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.10: + SPECIAL NOTES: + This release includes fixes to || alternation in :ratchet mode. Code that was unintentionally relying on buggy behavior (backtracking in :ratchet mode) may now produce unwanted results (namely will fail to match) [963a0f06] + Security: + Restricted dynamic lookup metasyntax in rx EVAL [1d63dfd2][2448195d] + Deprecations: + Deprecated .new on native types [9d9c7f9c][cc6c0558] + Deprecated :buffer `open` arg in favor of :out-buffer [f9c10c21] + Fixes: + Fixed Hash.perl to include Scalar indicators [47d6c66e] + Fixed :delete with lazy Arrays [0385b2aa] + Fixed sanitization of on-demand Supplies [93a66d75] + Fixed duplicate done/quit messages [9e179355] + Fixed non-blocking `react { await blah() }` [29863a0b] + Fixed issues with Int.new [dff7d9b2][0d2ca0d7][0834036d] + Fixed isa method on a subset [cee1be22] + Fixed Supply.zip to eager-shift its values [f9400d9a] + Fixed two utf8-c8 bugs [963a0f06] + Fixed infinite loop in .^roles of a class that does Rational [0961abe8] + Changed uniname to give better strings for non-unique names [9dba498f] + Fixed .push-all/.skip-all on SlippyIterators [41896b7b] + Fixed and improved `**` regex quantifier [681d6be9][4ca1fc3c] + Made cmp-ok to try harder to give useful description [8479a1ba] + Made List.ACCEPTS non-fatal for lazy iterables [1b9638e2] + Fixed some unspace parsing cases [11070e0f] + Fixed &chdir failing to respect :CWD attribute [4906a1de] + Fixed Blob.gist to trim its guts to 100 elements [ac8e5f43] + Improved .perl and .gist methods on Maps and Hashes [aad8991e] [39461368][381c4c3b] + Fixed explosion in IO::CatHandle.nl-out [83008443] + Fixed .pick and .roll on object hashes [12fcece4] + Made cmp-ok take its arguments raw [3684384d] + Fixed `is default(Mu)` on attributes [54507ac9] + Made Array.List fill holes with Nil [e1351219] + Fixed BagHash.grab with large values [975fcf6c] + Fixed .tail with large values [43e7b893] + Improved .gist of nodal methods [b6982e68][bb1df2cb] + Fixed IO::Pipe.close not always returning the Proc [74328278] + Fixed handling of type objects in set operators [8a88d149] + Fixed location of errors coming from Channel [82a38c29] + Fixed lockup when scheduling with degenerate delays [df01ad97][031f8cf7] + Fixed segfault in getlexdyn [4f5fc520][4c370072] + Fixed poor error with some slurpies with defaults [a92950fb] + Fixed Int.new to properly give a new object [e4a5bb17] + Fixed .STORE leaving behind elements on native arrays [a85c8d48] + Various async improvements [633a15b8][ef4d16fe][f53d3963] [26a9c313][9d903408][0d600a0c][54783920][e0e5e6fa][b16aba01] [d8890a82][73aeee6c][2a826238][3deda842][f58ac999][40c2d0cd] [c46de00f][e5c17462][6e42b37e][80f883bc][6af44f8d][e70969e3] [30462d76][97b11edd] + Various fixes and improvements to hyper/race [cc2a0643][2352efe5] [d43b3738][dfa230f7][1fdc84fe][cef4806f][ea51d19b][374ee3e2] [ad0dd8e7][41729e93][d74ba041][83676112][2580a0a6][cf1673d9] [7e9b9633][870eaa31][d37a19ea][da977785][270e7c8a][ee3f0f4f] [a042fd92] + Various improvements to warnings and error reporting [38186fcd] [cf95ce81][66c2d05f][a845ac3d][48a84d6a][bb45791c][279bae08] [6542bb80][5747bc71][c7a82d45][fb7abf06][ac97a401][64b001a1] [1ea3297b][56eef696][25c87d0d][5d3ebc09][de2b9ff7][084078e1] [3acde358][b3bb8c40][e611978f][12774237][33e113a2][9554a97c] + Additions: + Improved .Capture semantics on all core types [4ba12ff1] [bad9fefd][cd5864cf] + Added trim* subroutines taking Cool instance [5a19dffa] [691f8b7b][e01e5bc3] + Added Lock::Async [53dd776c][4a8038c2][85bdd38a][38896402][6170cb9d] + Added atomic reference op support on JVM backend [32e4a1de][59c4117f] + Added $*USAGE [0b15f672] + Added :bin parameter to IO::Handle.slurp [e2ec569b] + Added support for Bufs in &EVAL/&EVALFILE [6c928d61] + Added warning on typical precedence errors with infix:<..> [26bdc95c] + Added --repl-mode command line option [9ce896d8][20518454] [5c7bbea0][93e599db][de0533c4] + Implemented typed pointer increment and array dereference [3ca6554f][bc5fbfcb][2fba0ba0] + Added X::Numeric::CannotConvert exception type [2e726528] [b377de1c][f04bd1d6] + Added IO::Handle.out-buffer for controlling the buffer size [f9c10c21][765dd694] + Added IO::Path.parent(Int) for getting up more than one level [7bea3a2d][78d8d509] + Removals: + Removed $*MAIN-ALLOW-NAMED-ANYWHERE [9cb4b167] + Removed support for ornate parenthesis from quoting constructs [9ce896d8] + Renamed $*INITTIME to $*INIT-INSTANT according to the spec [6bdb2dd3][bd6c6403] + Build system: + Reworked REPL tests [be4d57de][338a0972][7c8a2739][f8edb829][1ce3a36d] + Various changes related to v6.d prep [7d830d5c][6cb810d2][36bc8e2d] [31cbdada][16f64182][50d2013d][f62950dc][dd8a6102] [36122f15][2a512f0c][03b1febc][edce8f53][c6ff787a] + Efficiency: + Made startup time up to 5 ms faster [48406db6][a09f5f21][bb5583ae] + Made chained ops up to 36x faster [a92d0369] + Made ≥, ≤, and ≠ unicode ops as fast as ascii equivalents [6ec21cb4][1af2a745][43c348a8][9ff2f98f][6ad06fad] + Made &infix: with Version:Ds 7.2x faster [1d9553f0] + Made &DEPRECATED 27% faster when vfrom is too large [145e3156] + Made Blob.gist 26x faster [20a99fc3] + Made Hash.gist 24% faster [69af24c4] + Made @a[42..*] 4.2x faster [456358e3] + Various NativeCall speedups [a06ebaf2][269fe7db][80d6b425] + Significantly faster interpolation of variables into regexes [1761540e][0a68a18f][d73d500b][1775259a][e8003c87] [4d3ccd83][04b171bd][317ae16c][dd880cad][2262cc47] + Other small optimizations [9d4a833b][6902c590][fb4eb666] [b9c98531][4fae0711][921db910][c91c4011][98fae3d8] [a462d0a2][16c2a157][5f6896bd][397692ac][476741e7] + Internal: + New JIT [2724a851][ff063e7b] + Better scheduler [d2eb7423][80b49320][340d8ed3][c50d35a9][9af5607d] [683037be][7c18112c][c285b489][b5605c2d][3b98fb9e][596611c8] [6f6e62ea][176a6fae][43b7cfde][59bfa5ab][27590e8b][e95eb42c] [2c4868b8] + Added RAKUDO_SCHEDULER_DEBUG_STATUS env var [de311f46] + Bumped libuv to the latest version [198b8497] + Reworked BUILDALL method autogeneration [9837687d][63cf246f] [5ad2fffe][31a03a41][eb9c3d4d][346dfeff][70ca505a][af2ab751] [5cd9197f][6824e192][7363f898][4959df3f][dd943ede][d3c48185] [371befe8][4d0ead24][92f239b5][7fa707db][d76af6aa][e513b857] [f80a8461][fcbd8adb][21788c89][e2f8a57d][b58bd8fb][0dd6af71] [f946bd35][cef3bf3e][92e51c3d][5144216f][ebd6440c] The following people contributed to this release: Zoffix Znet, Elizabeth Mattijsen, Pawel Murias, Jonathan Worthington, Aleks-Daniel Jakimenko-Aleksejev, Will "Coke" Coleda, Tom Browder, Christian Bartolomäus, Samantha McVey, Daniel Green, Steve Mynott, Patrick Spek, Stefan Seifert, Luca Ferrari, Brian S. Julin, Rafael Schipiura, Timo Paulssen, Alex Chen, David Warring, Cuong Manh Le, Naoum Hankache, Alex Wander, Nick Logan, Wenzel P. P. Peppmeyer, 陈梓立, Jeremy Studer, Brian Duggan, Larry Wall, Jan-Olof Hendig, Jonathan Stowe, Christopher Bottoms, Itsuki Toyota, Dan Zwell, Philippe Bruhat (BooK), gerd, lefth, Viacheslav Lotsmanov, Robert Lemmen, Shlomi Fish, Altai-man, Jarkko Haapalainen If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put “Perl 6 Core Development Fund” in the ‘Purpose’ text field) The next release of Rakudo (#117), is tentatively scheduled for 2017-11-18. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback – get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.11.md0000644000175000017500000001566013253717231015525 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #117 (2017.11) On behalf of the Rakudo development team, I’m very happy to announce the November 2017 release of Rakudo Perl 6 #117. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] — it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.11: + SPECIAL NOTES: + Main development branch changed from “nom” to “master” [f40babb8] + Fixes: + Fixed Lock.protect to no longer leak Proxies [be9e19ef] + Fixed R:I:JSON to handle recursive Exceptions [3cba6204] + Fixed .perl output of an empty Set/SetHash [af3624d4] + Made some attribute defaults throw NYI instead of silently ignoring [9f54bc98][0973b307][6dab5aad] + Fixed quote lang cache regression [ad16c6fb] + Improved stability by always setting up `$*PID` [a1866b7b] + Implemented hypered nodality for all methodcall variations [3c4041ea] + Fixed combinations with * endpoints [bdc73563] + Made Range.sum sensible for -∞/∞ endpoints [5eeb72a9][21efe96f] + Made multi sub(:@c is copy) { } work [be1e2879] + Ensured CLOSE phasers have correct outer chain [96557571] + Fixed segfault on Bag.new.pick(1) [fe1f8632] + Improved handling of %b spacing sprintf [b2fbf893] + Made .head and .tail only take WhateverCode [5a29a0ce] + Moved signal() handling to the timer worker queue [1bc9936a] + Fixed default Encoding::alternative-names [2f0da94c] + Various improvements to warnings and error reporting [142c1d65][fff43fd7] [c9360203][497e0582][ad7c97df][88d67516] + Additions: + Channel can now be closed with sub close() [91543fe3][ef84aafc] + my %h is (Set|SetHash|Bag|BagHash|Mix|MixHash) now DWIM [1949a2bc] [6ac2b15c][aab2b983][b6a4d5b5] + Implemented metamethod shorthand syntax [5c96d554] + Kernel.cpu-cores returning the number of CPU cores available [61af87bc] + Kernel.cpu-usage exposed basic CPU usage information [c4d373c5] + Telemetry module providing an easy interface to system state reporting [cbd4f212][273168d7][3e175c83][7f154fe2][3dfaa2ae][59a59be8][52440486] [b30916f3][b30916f3][f7d21b5d][ae1f0fda][f72ad227][4b4429cc][58249a52] [f51a3efc][8a0eb7fa][bc00894f][e95b02f1][ccbfaaa0][2f963b14][c1867ba1] [8e4d3248][0a809698][824a5dc2][dcf3e28c][0bdda086][a2ae00ed][86d541f4] [474feb09][5e7dfe52][3b4f0c6c][7144dc29][73e1faaa][cf1742dc][91e00e68] [96751ee8][7e00908c][d21c31e1][0dc4a0eb][c2baf95e][e1a1b8d8][b380230d] [fccc7515][1c2c7d84][2f12bea1][4ed91ed6][fea5612c][360eb228][9344d35d] [d5fc6cbb][3e4ef2e0][4d21ad67][0f2f0cd3][22939bc8][77142fdb][ab03b54c] [fc9e7241][948a3fa4][f8e1a5fa][17db03eb][14e2016c][2dcefa1c][345fbf5a] [b80d486c][3e4ccce9][86e9f44a][f87d8ef8][5f4b61b1][e5912337][de961b81] [d6f1077d][ba49b343][1aa83a78][06cbe9c2][246f4101][d6a3a7a1][88a9cb25] [9381ffbc] + Efficiency: + Made .sum on native num arrays 11x faster [b849622e] + Made INITTIME a bit faster [e00f705d] + Made interpolation of variables into regexes a bit faster [6bca84fa] [c93dc9e6][fa8bc549] + Made Buf ~ Blob about 7x faster, Blob ~ Blob 1.8x faster [8b47adad] + OS thread exhaustion is now handled more gracefully [fe799a98][57374490] [14fbb5e7][6d8ed287] + Other more general ThreadPoolScheduler improvements [e513f19d][6ac53e42] [2cd568f9][6bf58921][6de66df7][6aa150db][09e038cd][a7972a0c][260e4a3a] [a9b8854a][09492179][6959349e][697e4ecf][b386963a][5d0ccf73][bfcc43ec] [87e87202][92543962] + Minor IterationBuffer improvements [c15e80de] + Internal: + ThreadPoolScheduler now keeping internal statistics, e.g. for Telemetry [2c84f77e] + Thread now keeping internal statistics, e.g. for Telemetry [68b2891d] [77048b6a][cb4d8b66] + Changed how Int.new gets rid of mixins [6cb7ebfb] + Normalized proto bodies [0edd0cc9][102fbd51] + Set no_inline when the dispatcher is needed [c1df0b1b][0ff32c7f] + Various JIT-related changes [3bd756f5][0a029db6] + Repository cleanup [028b7d22][5baede59][825a8b0d][6ec6f1eb] + Various improvements for the JVM backend [ac738b98][b2725c12][4849c733] [d6cd0d2f][8b24bf5c][38f51db9][581edd58] The following people contributed to this release: Elizabeth Mattijsen, Alex Chen, Pawel Murias, Zoffix Znet, Aleks-Daniel Jakimenko-Aleksejev, Christian Bartolomäus, Will "Coke" Coleda, Jan-Olof Hendig, Samantha McVey, Daniel Green, Tom Browder, Jeremy Studer, Jonathan Worthington, Stefan Seifert, Moritz Lenz, Nick Logan, Jarkko Haapalainen, W4anD0eR96, Patrick Sebastian Zimmermann, Timo Paulssen, Steve Mynott, holli-holzer, ZzZombo, Brian Duggan, Wenzel P. P. Peppmeyer, Curt Tilmes, Ahmad M. Zawawi If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put “Perl 6 Core Development Fund” in the ‘Purpose’ text field) The next release of Rakudo (#118), is tentatively scheduled for 2017-12-16. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback – get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2017.12.md0000644000175000017500000001373013253717231015522 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #118 (2017.12) On behalf of the Rakudo development team, I’m very happy to announce the December 2017 release of Rakudo Perl 6 #118. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo. Upcoming releases in 2017 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] — it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2017.12: + Fixes: + Various POD-related fixes [41514235][11d90cac][061c36d6][2cd266fe] [8ea7a46f][2c951798] + Fixed resolve of IO::Path for Windows [eed733e2] + Fixed ∖ op to do Hash→Mix conversion through Sets [eacf9b27] + Fixed incorrect attribute name in X::AdHoc.new [3166400d] + Fixed Supply.zip() to call `done` when some supply is `done` [1d0dae86] + Fixed Supply.throttle() when the source supply becomes `done` [c8370f21] + Fixed silent failures on invalid `is export` values [1668b4f0] + Fixed many cases of enum creation [d9021cf1][754664ed][65301756] + Fixed crash when using allomorphs as enum values [fc52143b] + Fixed <:Digit> to match digits correctly [0339b0f8] + Fixed some Telemetry.EXISTS-KEY issues [f3b1289f][91798547] + Fixed gut spillage in pseudopackages [cd24b1c5][a82e0e7d][1c7d15d7] + Fixed introspection on Mixins to Code:U objects [e31a414b] + Fixed let/temp to be able to take Mu [75229976] + Fixed autovivification container issues with `no strict` [e5b49ce3] + Fixed shaped array indexing to accept non-Ints [00632edb] + Fixed List.new to not create containers [d80df073] + Fixed incorrect .count-only/.bool-only implementation [af9812fa][0e228fab] + Made sure each Seq.skip gets a new Seq [854c10c2] + Moved attribute settage inside the lock [8df8ce09] + Made print/say/put/note handle junctions correctly [07616eff] [9de4a60e][8155c4b8][3405001d] + Fixed WhateverCode curries losing `use fatal` [31db3acc] + Various improvements to produced messages [d85585ea][9fd5042b] [c9699ab2][1da698ab] + Additions: + Implemented TR/// [f6958624][3d2fa915][8b27166f] + Implemented .toggle [694f534a][78caeb6b][ca7d0483][e7c0a644] + Consistified &[but] and &[does] with non-roles [575d31e2] + Added While/Until iterators [2c1a2860] + Added proper Supply.Seq method [aa3c2c5b] + Efficiency: + Made multi-needle split setup cheaper [5929887c] + Streamlined INDIRECT_NAME_LOOKUP a bit [76158136] + Made &[-]/&[+] with Rationals 30%-50% faster [6c299bf9] + Made DIVIDE-NUMBERS 6%-15% faster [78aeaf46] + Streamlined Hash.AT-KEY [6601da5c] + Streamlined Array.Slip.AT-POS like Hash.AT-KEY [fe8312b7] + Streamlined Array.AT-POS for better inlinability [af29a227] + Streamlined List.AT-POS a bit [9a2f5325] + Made Array.ASSIGN-POS about 1.7x faster [c5afc97e] + Made R:It:ReifiedArray 15% to 30% faster [a974de9b] + Streamlined Array.iterator.push-until-lazy a bit [ae02bc29] + Internal: + Abstracted prefix: logic into R:I [47f23fc6][126d7b55][6fb5c8c8] + Implemented Sequence.Numeric [6061f0bc] + Various improvements for the JVM backend [0a24efc3][f40c3818] [fbf7beca][928ada08][74a13ae1] + Added tests for previously resolved issues [20d67a3d][831dab14] [1b0be0f6][062c27f3][1101fea1][fed56be2][47552282][ced4af66] [d4ad6fa9][eaf609ed][04eb1da6] The following people contributed to this release: Zoffix Znet, Elizabeth Mattijsen, Pawel Murias, Alex Chen, Tom Browder, Christian Bartolomäus, Luca Ferrari, Aleks-Daniel Jakimenko-Aleksejev, Jan-Olof Hendig, Fernando Correa de Oliveira, Jeremy Studer, Will "Coke" Coleda, Samantha McVey, Jonathan Worthington, Tim Smith, Larry Wall, Dmitri Iouchtchenko, Rafael Schipiura, Fernando Correa, Moritz Lenz, Timo Paulssen, Juan Julián Merelo Guervós, lefth, Brad Gilbert, Michael D. Stemle, Jr, Daniel Green, Ronald Schmidt If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put “Perl 6 Core Development Fund” in the ‘Purpose’ text field) The next release of Rakudo (#119), is tentatively scheduled for 2018-01-20. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback – get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2018.01.md0000644000175000017500000002042413253717231015517 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #119 (2018.01) On behalf of the Rakudo development team, I’m very happy to announce the January 2018 release of Rakudo Perl 6 #119. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo. Upcoming releases in 2018 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] — it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2018.01: + Fixes: + Fixed IO::CatHandle.read switching handles too soon [dc800d89] + Ensured &await can handle flattenable Iterables [1a4df4e1] + Made Array.gist limit output to 100 elements [08539c43] + Fixed .[count|bool]-only of combinations/permutations [5eed2b00] [cda4a4d7][2c27eeaa][d4f53ed5][19604c2d] + Made sure subclasses of List create consistent .WHICH [18557da9] + Fixed Range.pick/roll in light of degenerate Ranges [5c228333][55cb8f3d] + Fixed Whatever.ACCEPTS with Mu:U [89d85baa] + Fixed signatures that had Int when Int:D was meant [3e044dc7] + Guarded subbuf against negative ranges [24f4609e] + Fixed some export issues [38897d19] + Fixed Slip wrapping of quoteword with one word [ad684de3] + Fixed ±Inf/NaN Num to Rat conversions [042cb741][c91bcc2a] + Fixed USAGE with subsets/where and variables with quotes [27fbd7ab] + Fixed .gist dumping too much output in some cases [de21da30][53a85080] + Fixed crash in `eqv` with conted Versions [72ee58e2] + Fixed issues with smiley-ed coercers [a177fa99][8dcf9dac][3947a4c1][354a3848] + Made sure Rat calculation does not use type objects [9910b393][9adc58c3] + Fixed handling of type objects in Date.new [1d034df8][dfaa2282][038b1ea7] + Fixed CURFS/CURI .perl output [9cf2f998] + Made sure hashes are not interpolated in regexes [f719a471] + Fixed explosions when hypering over Buf [7ba50d86] + Made &dd more resilient to low-level stuff [99923747][d0be53a1] + Fixed .head/.tail to take any Callable [b4007070] + Fixed .skip with WhateverCode [d034cb58] + Fixed operator chaining with negated operators [ba111cfe][14c2cdb3] + Disallowed binding into a List [eed54cae] + Fixed `--optimize` flag propagation in EVAL code [e509c1a9] + Fixed RatStr .succ/.pred explosion [631875fc] + Fixed silent failure when binding to map keys [6a3db334] + Fixed R::I::Rotor calling .pull-one too many times [4a82b4b6] + Fixed `need` with versions [7537f899][0cdd82a2][0a73f19a][4d5e097a] + Fixed the lookup of many core symbols [efdbfeca] + Made .range consistently a Str in OutOfRange exceptions [90246e65] + Fixed superfluous parsing of ∞ [626991e0] + Fixed many POD issues [14c28cae] + Various fixes for the JVM backend [4945dc40][4909430c][333efa0b] [00b7832a][70c57c3a][1e8c9762] + Various improvements to useless use warnings [d30e5b1e][c6b7012a] [64803b0a][ef2dc1b8][99da4a5a][00188757][e9c9dc46] + Various improvements to other produced messages [a04c6164][548dcf46] [6d65cf4f][51e0aa09][82dbada3][e543c890][0444a2c3][e5b4f37f][900c1b59] [96a3582c][5571d7f7][34160bf0][01ffd0f9][6a6470f9][e91159c5][5f7fdfdd] [f02606ce][cad66b72][79600d69][2dc93ac3][4ec5936c][ad60b947][732a25c3] [f8953ee8][ddbf07e8][fa136be2] + Additions: + Added Str.uniparse as an alias to Str.parse-names [2a8287cf] + Added Cool candidate for .is-prime [f01c50f1][23701966][b2b39bad][893d09ff] + Added compile time error for misplaced whenever in v6.d.PREVIEW [7672e34c] [0ec8e088] + Removals: + Removed deprecation fudge for native type instantiations [e0af68a0] + Removed :$CWD param in IO::Path.dir [b3e73b64] + Removed :$buffer param in IO::Handle.open [f415d61e] + Removed MONKEY BUSINESS env var [ac2e50c8] + Removed UInt64 (not to be confused with uint64) [cf154355] + Build system: + Fetch tags too to avoid potential missing tags [d93f8053] + Efficiency: + Made adding integers to Rats 22% faster [418fc068] + Made Blob.subbuf 1.8x faster [5f48c069] + Made `else`-less `if`/`with` blocks 3.4x faster in some cases [1815c368] + Made DateTime creation about 1.6x faster [36d71a39] + Made Date.new about 1.6x faster [b7170f83] + Made use of faster typechecks (7.5x faster) [4c9b84f8][8f71b0e0][10cd405f] + Made operator chains up to 2.4x faster [b77d8756] + Made `infix:` with bools up to 2x faster [f99943d3] + Made `infix:` with bools up to 16x faster [ca4fcaca] + Made |(1,2,3) xx 42 about 3x faster [014f1712] + Slightly speeded up adding of `whenever`s [7230b765] + Slightly optimized Array.ASSIGN-POS [6e13bfa2][86d91f2d] + Made `$a ~= "b"` 70% faster [5dd9ed10] + Made constraint checks Num/Int/Str literals 1.1x-10x faster [65d4876d] + Micro-opted exit_handler [0415bb5f][b5b6e23b][421504bd][21bc5916] + Performatized MetaAssign with MetaReverse [858b659f] + Made .sum on 2-element Lists about 30% faster [0af3f4d1] + Optimized `supply emit ` [81fe7b82] + Optimized Supply internals [32fbefab][9086f4c4][2548c2c5] + Improved first touch of Array/Hash variables [eeb3cc72] + Optimized more cases of private method calls [b6a236b9] + Tuned Lock::Async code stucture [f36a1f4e] + Special-cased one top-level whenever supply/react [e5f412d6][2192ddd1] [2dbc2bcb][e072474e] + Made Promise construction slightly faster [2ac1ceaa] + Assorted internal improvements to CPU/memory use [00797d07][2130c097] [7a3d9ce6][9c0db1cd][fbf432f9][4804003a][229b03fd][163f275b] [83a619ec][64de571b][773d2b9e][0dc4f731][cdb53afa] + Internal: + Introduced ValueObjAt, the .WHICH for value types [202459ce][4790587f] + Introduced Proc!set-status [7a4743be] The following people contributed to this release: Zoffix Znet, Luca Ferrari, Elizabeth Mattijsen, Tom Browder, Christian Bartolomäus, Aleks-Daniel Jakimenko-Aleksejev, Jonathan Worthington, Pawel Murias, Will "Coke" Coleda, Itsuki Toyota, Jeremy Studer, Alex Chen, JJ Merelo, Moritz Lenz, Jan-Olof Hendig, Timo Paulssen, Samantha McVey, Wenzel P. P. Peppmeyer, Daniel Green, David M. Cawthon, David Warring, Marcel Timmerman, Juan Julián Merelo Guervós, Nick Logan, Brad Gilbert, Dan Zwell, Ben Davies If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put “Perl 6 Core Development Fund” in the ‘Purpose’ text field) The next release of Rakudo (#120), is tentatively scheduled for 2018-02-17. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback – get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2018.02.1.md0000644000175000017500000000473013253717231015661 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release 2018.02.1 On behalf of the Rakudo development team, I'm announcing an out-of-schedule release of the Rakudo Perl 6 compiler. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release is a point release in addition to the regular, monthly releases. Rakudo 2018.02 (note: no .1) was discovered to contain a bug which caused segfaults when using Whatever curries in topics of for/given statement modifiers. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] — it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2018.02.1: + Fixes: + Fixed Whatever curry QAST::Block migration in stmt mods [5270471c] The following people contributed to this release: Zoffix Znet, Aleks-Daniel Jakimenko-Aleksejev If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put “Perl 6 Core Development Fund” in the ‘Purpose’ text field) The next release of Rakudo (#121), is tentatively scheduled for 2018-03-17. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback – get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2018.02.md0000644000175000017500000001752113253717231015524 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #120 (2018.02) On behalf of the Rakudo development team, I’m very happy to announce the February 2018 release of Rakudo Perl 6 #120. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo. Upcoming releases in 2018 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] — it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2018.02: + Fixes: + Fixed `no worries` pragma [f5b4d89f] + Fixed IO::Socket::Async losing :$scheduler in .print-to [7c451514] + Fixed postconstraints in `my (...)` being ignored [3745eff1] + Fixed optimizer crashes in `map` with certain args [f3efe5e6] + Fixed IO::Handle.get on TTYs blocking after EOF [359efef7][af4dfe82] + Fixed crash with colonpaired variable declaration [a35cd4e6] + Fixed crashes in degenerate .tail(Callable) [ba675971] + Fixed crash in `temp`/`let` with parameterized hashes [0a32e51b] + Fixed Hash.clone and Array.clone losing descriptor [0d7c4fe8][45560ac9] + Fixed `let`/`temp` on hashes losing Nils [8c4c979e] + Fixed crash in Any.skip(Callable) [8efba3a8] + Fixed crashes with native types in conditionals [d1a48efc] + Fixed many issues with block migration in thunk gen [1ee89b54][31ab8683] + Fixed "No such method 'prefix'" when there's no HOME directory [b6a7d7f6] + Fixed buf8 punning happening at INIT time instead of BEGIN [c6cc673d] + Fixed type constraint in Str.split's Seq [8afd791c] + Fixed Iterator.Rotor when cycle contains Whatever or Inf [ba7b4571] + Fixed crash with ENTER nested inside LEAVE [58de239c] + Fixed wrong error in REPL with none Junctions [2c36ab2e] + Fixed semantics of :b quoter tweak [deffe54b] + Fixed error when throwing error during setting compilation [c820e4be] + Fixed crashes with compile time evaluation of Whatever curry [7c1f0b41] + Fixed crash in Proxy.perl [902f45f5] + Fixed encoding of ›˜œžŸ™š with windows-1252 (Latin) encoding [4507a565] + Fixed state vars in `do`-ed loops [299e8526] + Fixed whatever curry with regexes [d80fc376] + Fixed crashes with compile time evaluation of `where` thunks [95f23a56] + Fixed broken 2-arity sort of 2-el list [2e65de29] + Fixed postfix whatever curry with another curry inside [e8c6c259] + Fixed empty compiler version when the git repo has no tags [382024e6] + Fixed migration of in-regex blocks [c0c7756f] + Fixed missing decont in `cmp` [114e3735][25c5c488] + Fixed drift when reusing lazy iterables for indexing [f330d7fc] + Fixed crash in parameterized constraints on attrs with .= [562edfc5] + Fixed REPL adding empty lines to the history file [24fab707] + Fixed Parameter.usage-name to omit leading * and ! [3c73099c] + Fixed Any.tail(Callable) violating Iterator protocol [2cc7b631] + Fixed .perl of handled Failures [b2a21fa9] + Unified List.roll/pick invocant specification [311ef07f] + Fixed multi-threaded precompilation [ac87ea2a] + Fixed issues in constant type declarations [f559c6d8] + Fixed `if` with slurpies on its block [ef1d22f4][dfb6d951][59556c70] [4b7113fa][00af9ce2] + Improved SprintfHandler [d419afe4][4ac67e73][684b99ea][13406517] + Fixed unwanted curries with HyperWhatever type object [57a1aa7a] + Made Backtrace.gist more helpful [555db42a] + Fixed ($ = 42) vs ($ = "42").subst-mutate [e7af9a6a] + Fixed Cool.subst-mutate to only mutate if there's a match [61015526] + Made Str.subst-mutate always return a List on :g [77794a28] + Made Str.match(:x) consistently return a non-Slip List [829ea8e3] + Fixed return of multi-match options of Str.subst-mutate [e0d39321] + Fixed .Numeric/.Real on :U numerics and .Real on :D allomorphs [1dc1f038] + Various fixes for the JVM backend [a2499c90][1f223190][f2188e45] + Various improvements to produced messages [8ffbc43b][7f07f68f][34b3356f] [de2d8296][1c894e41][d419afe4] + Additions: + Added windows-1251 (Cyrillic) encoding to the list of possible encodings [c73cb78f][4507a565] + Added support for .= to init sigilless vars [8ba3c86e] + Added compile time LiteralType error for native vars [e930e253] [63a1d25a][30b82b98] + Efficiency: + Made `$ where Type1|Type2|Type…` typecheck ~8x faster [43b9c829][264a1a27] + Many compunit speedups [5bd33669][6fa1e78f][c268f55c][5be174bb] [b188cc82][838beab9][a9a9e1c9][00cde175][ed9b287c] + Made certain conditionals with natives 2.1x faster [d1a48efc] + Improved dynamic optimization of nativecast [3ed2fbd5] + Reduced startup overhead of file I/O and module loading [db1e067e] + Made `dispatch:` call up to 43x faster [ff31f0a3] + Shaved off 10ms when loading a native library [86e926c7] + Made compilation up to 6% faster (for 3000-line files) [f4732164] + Made Whatever currier up to 2.2x faster [752bb8b3] + Made list assignment with roll up to 20% faster [65d6fe48] + Moved `$*PERL` initialization to BEGIN time to save runtime [bdb4d34d] + Made Version.new 82x faster [02d2e2ca] + Added native `num` post-inc/dec to pre- optimization [4a5cc2c2][13e6ed8c] [888328ef][971d17c4] + Made `.=` up to 63x faster [abea3242][01237782][2ba7634c] The following people contributed to this release: Zoffix Znet, JJ Merelo, Pawel Murias, Aleks-Daniel Jakimenko-Aleksejev, Stefan Seifert, Luca Ferrari, Will "Coke" Coleda, Tom Browder, Samantha McVey, Elizabeth Mattijsen, Christian Bartolomäus, Jeremy Studer, Curt Tilmes, Jan-Olof Hendig, Timo Paulssen, Itsuki Toyota, Pepe Schwarz, Jonathan Worthington, Moritz Lenz, Tobias Boege, Wenzel P. P. Peppmeyer, Fernando Correa de Oliveira, Nick Logan, Andrew Shitov, Jonas Kramer, Alberto Luaces, Ben Davies, 0racle If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put “Perl 6 Core Development Fund” in the ‘Purpose’ text field) The next release of Rakudo (#121), is tentatively scheduled for 2018-03-17. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback – get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/announce/2018.03.md0000644000175000017500000001677313253717231015535 0ustar alexalex# Announce: Rakudo Perl 6 compiler, Release #121 (2018.03) On behalf of the Rakudo development team, I’m very happy to announce the March 2018 release of Rakudo Perl 6 #121. Rakudo is an implementation of Perl 6 on the Moar Virtual Machine[^1]. This release implements the 6.c version of the Perl 6 specifications. It includes bugfixes and optimizations on top of the 2015.12 release of Rakudo. Upcoming releases in 2018 will include new functionality that is not part of the 6.c specification, available with a lexically scoped pragma. Our goal is to ensure that anything that is tested as part of the 6.c specification will continue to work unchanged. There may be incremental spec releases this year as well. The tarball for this release is available from . Please note: This announcement is not for the Rakudo Star distribution[^2] — it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see . The changes in this release are outlined below: New in 2018.03: + SPECIAL NOTES: + Str.comb(Regex) was fixed to return a Seq instead of a List, making Str.comb always return a Seq. Code relying on the specifics of the previous behavior might require some tweaks. + Fixes: + Fixed various sleep() issues [e3c4db73] + Fixed <0/0> to be False [748d1a57] + Improved Test.pm6's like/unlike [7c1a6cac] + Fixed failure to sink last statements of `for` loops [4c5b81fe] + Removed unneeded candidates in &say and ¬e [3a0d53ce] + Made Str.comb(Regex) return a Seq [1da07530] + Fixed &say and ¬e to not auto-thread [b62e0eb7][355b2eb5] + Differentiated precomp NC sub setup markers [b27c548f][ec5edcae] + Moved chrs() logic to List.chrs and made chrs() the gateway [1894eace] + Moved ords() logic to Str.ords [61176475] + Fixed bug on ops with subclasses of Range [440fceac] + Fixed wrong assumption of Junction execution order [207313be] [89f33bbe][e9cff795] + Fixed cases of mis-scoped QAST::Block of regexes [fb882d49] + Fixed .grep(Regex) on Hyper/Race Seqs [5e462e12] + Fixed &dd to not mark Failures as handled [7773c3d5][65874b15] + Enabled native-int candidates in bitshift operators [29fdb75a][3d735975] + Made Int:D (elem) Range:D be independent of size of Range [de30c162] + Straightened up `$/` handling in Str.subst[-mutate] [874fcdda] + Fixed Metamodel shortname assignments [ce08683f] + Fixed Pair.clone [5031dab3] + Improved Pod::To::Text to indent tables [57af8b84][dffbd68a] + Fixed precomp files of NativeCall users having absolute paths [51c4d4d8] + Made sure `samewith`-using routines aren't inlined [e12e305a] + Made sure MERGESORT-* don't leak low-level types [511bec0a] + Fixed code generation bug affecting private methods calls in roles where the target private method used a role parameter [21997b62] + Various improvements to produced messages [a4f9090e][235d3f1c] [3b350739][5ae1bbe1][52176c3c] + Additions: + Implemented IO::CatHandle.handles [d5baa036][eb064922][639c6da0] + Made signal handlers cancellable [db010b84][a31579c7] + “datagram”-oriented API for UDP sockets [67f36e36][b406b320][dd2c9019] + Added support for replacement and strict setting in Buf.decode [0d796fb0] + Added support to Encoding::Decoder to use replacements [ea92f550] + Removals: + Removed no longer used DELETEKEY helper sub [6f2cbcf7] + Removed Range.clone-with-op [440fceac] + Efficiency: + Optimized Uni.list to reify 15x faster (on 10000-char str) [8b7385d8] + Made Str.perl 43x faster for some chars [ba6b84bd] + Optimized Str.perl by making uniprop(Int, Str) 2.7x faster [6ac56cc0] + Made Rational.Str 28% faster [008b9279] + Made internal RETURN-LIST sub faster for common case [3a4056bf] + Made Num.Bool 9x faster [2a42cdbb] + Nano-optimized supervisor thread sleep [4617976d][85ad0eba] + Added special cases for 2-tuple infix:<,> that are 10% faster [b6e5d7fc] [48c46fa7][90079357][ddf00078][d5a148c0] + Made Channel.receive/receive-nil-on-close 2.5% faster [4054ca68] + Reduced the number of DYNAMIC calls when hypering [598832cc] + Made Channel.poll 2x fast [eff92f94] + Made HyperIteratorBatcher.produce-batch 3.6x faster [8026cef8] + Many HyperToIterator speedups [0194ef46][6232d29e][34889beb] + Internal: + Turned many subs into multis [16b57af5][55bc053c][182b7ea5][63775474] [c2d0d3ac][cdb45fa5][4f473867][bf5e3357][5210d702][b704a175][4c67498f] [7d72387b][838782b7][abfbd1ab][6d6a69fd][c1d2a5bc][4da2418a][62fc3118] [d3f50dba][b9f40fea][dfef8283][9a0a7bdd][32b08035][51fccdfe][474c512c] [4f04698f][423e7cc0][ae4204c5][8cba0846][1b94ff6f][5490bacd][e1b711ae] [a23684f3][804c009a][f5b23a55][4513c279] + Marked many subs as “only” [1be26afb][25bedf88] + Marked set ops as “pure” on their proto only [af353894] + Made Unicode operators aliases of corresponding ASCII subs [254f477e] [aadd3c12][bc52fefa][a2100ec7][2e7a0e59] + Added nqp::getppid [fed92e3b] + Many profiler improvements, it now supports multi-threaded programs [fed92e3b][a5a6c778][dd2c9019] + Made substr() just a front for Str.substr [7835652d][b688a6f3][15ccfd33] + Made substr-rw() just a front for Str.substr-rw [038837f8] + Moved substr/substr-rw catcher methods from Any to Cool [aad79f8a] + Remote debug support on MoarVM [ffeff74e][e32bda21] The following people contributed to this release: Zoffix Znet, Elizabeth Mattijsen, JJ Merelo, Will "Coke" Coleda, Paweł Murias, Christian Bartolomäus, Tom Browder, Aleks-Daniel Jakimenko-Aleksejev, Luca Ferrari, Timo Paulssen, cfa, Jonathan Worthington, Itsuki Toyota, Samantha McVey, Daniel Green, Jan-Olof Hendig, Ronald Schmidt, Nick Logan, Stefan Seifert, Richard Hainsworth, Steve Mynott, Ben Davies, Jeremy Studer, Juan Julián Merelo Guervós, Patrick Spek, Alex Chen, Antonio Quinonez, Brad Gilbert, Wenzel P. P. Peppmeyer, Brian S. Julin, LLFourn, Larry Wall If you would like to contribute or find out more information, visit , , ask on the mailing list, or ask on IRC #perl6 on freenode. Additionally, we invite you to make a donation to The Perl Foundation to sponsor Perl 6 development: (put “Perl 6 Core Development Fund” in the ‘Purpose’ text field) The next release of Rakudo (#122), is tentatively scheduled for 2018-04-21. A list of the other planned release dates 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 discoveries, incredible hacks, or any other feedback – get in touch with us through (the above-mentioned) mailing list or IRC channel. Enjoy! Please note that recent releases have known issues running on the JVM. We are working to get the JVM backend working again but do not yet have an estimated delivery date. [^1]: See [^2]: What’s the difference between the Rakudo compiler and the Rakudo Star distribution? The Rakudo compiler is a compiler for the Perl 6 language. Not much more. The Rakudo Star distribution is the Rakudo compiler plus a selection of useful Perl 6 modules, a module installer, Perl 6 introductory documentation, and other software that can be used with the Rakudo compiler to enhance its utility. rakudo-2018.03/docs/architecture.html0000644000175000017500000001223513253717231016127 0ustar alexalex How Rakudo compiles a Perl 6 program

How Rakudo compiles a Perl 6 program

Parser and Action Methods

The Perl 6 source code is transformed in various stages, of which the first two are the Parser and Action Method stages. The Parser creates a parse tree out of the Perl 6 source code and then gives control to appropriate action methods that annotate the parse tree, incrementally turning it into an Abstract Syntax Tree (AST). When an action method is done annotating, control is handed back to the parser, which then continues parsing the Perl 6 code and "fire off" new action methods as it goes.

The result of these two stages interacting is an "improved PAST" (Perl 6 Abstract Syntax Tree) called QAST. This tree is then passed on to the QAST compiler.

The parser and action methods are implemented in "Not Quite Perl 6" (NQP) and are part of Rakudo and hosted in the Rakudo repository at src/Perl6/Grammar.pm and src/Perl6/Actions.pm.

The World

The World is where the parser and the action methods store any declarations they encounter during their runs, including Classes, Types, Signatures, Constants, Subs and Methods.

QAST compiler

The QAST compiler transforms the abstract syntax tree into a PIRT (Parrot Intermediate Representation Tree). To do this, the QAST compiler does a series of translations on the AST, creating PIRT nodes that implement the operations specified by the QAST nodes.

In addition, the QAST compiler is responsible for serializing The World in such a way that later stages can get access to the declarations stored there during the parser and action methods stages.

There's also opportunity to apply some VM-specific optimizations at this point. When this is done, the resulting PIRT is passed to the PIRT serializer.

This stage is described in the different files in the nqp/src/QAST/ directory.

PIRT serializer

The PIRT serializer "squashes" the PIR Tree into a format that can be passed to Parrot itself and it's IMCC (InterMediate Code Compiler) stage.

You can read more about this at nqp/src/QAST/PIRT.nqp.

IMCC and Parrot runtime

The IMCC (InterMediate Code Compiler) receives the PIR code from the PIRT serializer and then transforms it into Parrot Byte Code (PBC). IMCC is parrot's PIR compiler, written in C and statically linked into parrot. The byte code can then be stored to disk or executed in memory by one of the run cores available as part of the Parrot runtime. This is in some sense the heart of Parrot - or one of the hearts; There are several different cores available, including one for just-in-time compilation (JIT), one for debugging and others.

You can find out more about the IMCC in the parrot/docs/imcc/ directory, and about the different run cores in the parrot/docs/running.pod

PMCs and dynops

There are also some supporting custom types and operations in Rakudo called dynamic PMCs and dynamic ops (dynops) which are written in C, and helper functions written in NQP and PIR. These supporting libraries exist for adding features to Parrot that are needed to handle special features in Perl 6.

Core setting library

The core settings library is the library containing the methods, classes and almost all other features that make up the Rakudo Perl 6 implementation. This library is tightly coupled with the perl6 binary, and loaded by default every time perl6 is run.

Glossary

NQP
Not Quite Perl 6, a small subset of Perl 6 that is used for tree transformations in compilers.
PIR
Parrot Intermediate Representation, the most commonly used for of parrot assembly (which is still high-level enough to be written by humans).
IMCC
InterMediate Code Compiler, the part of parrot that compiles PIR into byte code.
PBC
Parrot Byte Code, the binary form to which all parrot programs are compiled in the end.
Core setting
The core setting is the Perl 6 standard library. It is part of the perl6 executable, and contains all the standard features available in Perl 6.
QAST
The "improved" Abstract Syntax Tree used in Rakudo Perl 6. It contains information about how the program is structured, and what it is supposed to do.
PIRT
Parrot Intermediate Representation Tree.
rakudo-2018.03/docs/architecture.svg0000644000175000017500000006344013253717231015766 0ustar alexalex Rakudo Perl 6 Architecture image/svg+xml Rakudo Perl 6 Architecture rakudo architecture Mortiz Lentz The Perl Foundation https://raw.github.com/rakudo/rakudo/master/docs/architecture.svg https://raw.github.com/rakudo/rakudo/master/docs/architecture.html en-US Core setting(Perl 6) The Perl 6 source code is transformed in various stages. The first one is the parser stage, which creates a parse tree out of the Perl 6 source code. The parser stage is implemented in "Not Quite Perl 6" (NQP) and is part of Rakudo and hosted in the Rakudo repository. Parser (NQP) Parser (NQP) The action methods are applied to the parse tree at the same time as the parser builds it. The result of this process is the Abstract Syntax Tree that is sent to the QAST compiler. Action methods (NQP) Action methods (NQP) Perl 6source QAST PIRT serializer (NQP) QAST compiler (NQP) IMCC (C) PIRT PIR The POST compiler emits PIR, which IMCC transforms into byte code. IMCC is parrot's PIR compiler, written in C and statically linked into parrot. The byte code (PBC) can then be stored to disk, or executed in memory by a so-called run core or run loop, which is in some sense the heart of parrot - or one of the hearts, because there are several different ones available (one for just-in-time compilation (JIT), one for debugging etc.). There are also some supporting custom types and operations in Rakudo called dynamic PMCs and dynamic ops which are written in C, and helper functions written in other languages (namely NQP and PIR). Those do not show up in the flow chart. Parrot runtime (C) Parrot runtime (C) PBC PMC &dynops (C) JAST serializer (NQP) QAST compiler (NQP) Java Virtual Machine JAST JVM Perl6::World(NQP) MAST serializer (NQP) QAST compiler (NQP) MoarVM MAST moar rakudo-2018.03/docs/archive/2017-IO-Grant--Action-Plan.md0000644000175000017500000013451213253717231020654 0ustar alexalex# ⚠️⚠️⚠️ IMPORTANT ⚠️⚠️⚠️ **This document is kept for archival purposes only and does not necessarily describe implemented reality. Do NOT assume the behaviour described here is how things are meant to work. Use the [Perl 6 Specification](https://github.com/perl6/roast) or [consult with core developers](https://webchat.freenode.net/?channels=#perl6) for that purpose.** # Summary of the changes to the original IO Action Plan 1. Instead of using mutually-exclusive named arguments to `.seek`, split it into three methods instead: `.seek-from-start`, `.seek-from-current`, `.seek-from-end`. [Discussion](https://github.com/zoffixznet/IOwesomeness/issues/1) 2. Add `:joiner` argument to `.exension` that defaults to empty string if `$replacement` is an empty string or to a `.` if `$replacement` is not an empty string. Also allow `Range` `:parts` parameter. [Usage examples and discussion](https://github.com/zoffixznet/IOwesomeness/issues/5#issuecomment-290079205) 3. Deprecate IO::Path.chdir in 6.d; remove it in 6.e. [Discussion](https://github.com/zoffixznet/IOwesomeness/issues/26) 4. Deprecate `$*SPEC` in 6.d; remove it in 6.e. This depends on how successful the plan is when implemented in a module first. [Details](https://github.com/zoffixznet/IOwesomeness/issues/27) 5. Do not mix anything in for handle's closed status and instead try to make MoarVM give better errors [Discussion](https://github.com/zoffixznet/IOwesomeness/issues/2) 6. Name nqp multi stat op `nqp::statmulti` [Discussion](https://github.com/zoffixznet/IOwesomeness/issues/4) 7. Leave IO::Handle.seek as is, without any changes. [Discussion](https://github.com/zoffixznet/IOwesomeness/issues/1) 8. [Behaviour of `:close`](https://github.com/rakudo/rakudo/blob/nom/docs/2017-IO-Grant--Action-Plan.md#make-close-behaviour-the-default-in-iohandle-and-its-subclasses-issue-for-discussion) per [Discussion](https://github.com/zoffixznet/IOwesomeness/issues/15): - do NOT auto-close in IO::Handle's methods - Leave `:close` as is - Make IO::Path's methods close handle when `$limit` is reached or iterator is exhausted 9. Make IO::Handle.lock default to blocking, exclusive lock, with `(:shared, :non-blocking)` named arguments allowing for change of the default. [Discussion](https://github.com/zoffixznet/IOwesomeness/issues/18) 10. Leave IO::Path.Str as is, without any changes. [Discussion](https://github.com/zoffixznet/IOwesomeness/issues/20) 11. The change to [`IO::Handle.Supply(:bin)` arg handling](https://github.com/rakudo/rakudo/blob/nom/docs/2017-IO-Grant--Action-Plan.md#changes-to-supply-issue-for-discussion), change to `IO::Handle.lock` argument handling, and making `IO::Path.new-from-absolute-path` private is to be done in 6.c and not 6.d; the change were miscategorized. 12. Make all IO routines that throw fail instead. [Discussion](https://irclog.perlgeek.de/perl6-dev/2016-12-28#i_13814044) 13. The behaviour of [.is-absolute on Windows](https://github.com/rakudo/rakudo/blob/nom/docs/2017-IO-Grant--Action-Plan.md#make-iopathis-absolute-give-false-for--path-on-windows-issue-for-discussion) was decided to be left as is. 14. .child was left as is [the proposed secure version](https://github.com/rakudo/rakudo/blob/nom/docs/2017-IO-Grant--Action-Plan.md#make-iopathchild-fail-for-non-child-paths--add-iopathconcat-with-issue-for-discussion) is implemented and is commented out in Rakudo's source. It was decided to switch to it in 6.d. The `.concat-with` routine was eventually named `.add` 15. `IO::Cat` was eventually named `IO::CatHandle` --------------------------- # Original IO Action Plan # Table of Contents - [IO Action Plan](#io-action-plan) - [Terms and Conventions](#terms-and-conventions) - [Legend](#legend) - [Non-Conflicting Improvements](#non-conflicting-improvements) - [`IO::Handle`'s Closed status](#iohandles-closed-status-issue-for-discussion) - [Restructure `spurt`](#restructure-spurt-issue-for-discussion) - [`IO::Path` routines that involve a stat call](#iopath-routines-that-involve-a-stat-call-issue-for-discussion) - [Expand Features of `IO::Path.extension`](#expand-features-of-iopathextension-issue-for-discussion) - [Use typed exceptions instead of `X::AdHoc`](#use-typed-exceptions-instead-of-xadhoc-issue-for-discussion) - [Make `IO::Path.resolve` fail if it can't resolve path](#make-iopathresolve-fail-if-it-cant-resolve-path-issue-for-discussion) - [Make `&words` default to `$*ARGFILES`](#make-words-default-to-argfiles-issue-for-discussion) - [Changes with Backwards-Compatible Support](#changes-with-backwards-compatible-support) - [`IO::Handle.seek` seek reference](#iohandleseek-seek-reference-issue-for-discussion) - [Rename `IO::Handle.slurp-rest` to just `.slurp`](#rename-iohandleslurp-rest-to-just-slurp-issue-for-discussion) - [`:$test` parameter on multiple routines](#test-parameter-on-multiple-routines-issue-for-discussion) - [Changes with No Backwards-Compatible Support](#changes-with-no-backwards-compatible-support) - [Generalize `IO::ArgFiles` into `IO::Cat`](#generalize-ioargfiles-into-iocat-issue-for-discussion) - [Changes to `.Supply`](#changes-to-supply-issue-for-discussion) - [Make `IO::Path.abspath` a private method](#make-iopathabspath-a-private-method-issue-for-discussion) - [Make `IO::Path.child` fail for non-child paths / Add `IO::Path.concat-with`](#make-iopathchild-fail-for-non-child-paths--add-iopathconcat-with-issue-for-discussion) - [Make `:close` behaviour the default in `IO::Handle` and Its Subclasses](#make-close-behaviour-the-default-in-iohandle-and-its-subclasses-issue-for-discussion) - [Changes to behaviour of `.lines`, `.words`, `.split`, `.comb`](#changes-to-behaviour-of-lines-words-split-comb-issue-for-discussion) - [Change order of arguments in `&link`/`&symlink`](#change-order-of-arguments-in-linksymlink-issue-for-discussion) - [Improve `IO::Handle.lock` Arguments](#improve-iohandlelock-arguments-issue-for-discussion) - [Make `IO::Path.new-from-absolute-path` a private method](#make-iopathnew-from-absolute-path-a-private-method-issue-for-discussion) - [Controversial Changes](#controversial-changes) - [Make `IO::Path.Str` Return `$.abspath`](#make-iopathstr-return-abspath-issue-for-discussion) - [Make `IO::Path.is-absolute` Give False for `/` path on Windows](#make-iopathis-absolute-give-false-for--path-on-windows-issue-for-discussion) - [Removals](#removals) - [Remove `role IO {}` Along With Its Only `IO.umask` Method](#remove-role-io--along-with-its-only-ioumask-method-issue-for-discussion) - [Remove `IO::Path` Methods from `IO::Handle`](#remove-iopath-methods-from-iohandle-issue-for-discussion) - [Remove `&homedir`](#remove-homedir-issue-for-discussion) - [Remove `&tmpdir`](#remove-tmpdir-issue-for-discussion) - [Bug Fixes](#bug-fixes) - [RT Tickets](#rt-tickets) - [GitHub Issues](#github-issues) - [Other Issues](#other-issues) # IO Action Plan This document is a deliverable of [TPF Standardization, Test Coverage, and Documentation of Perl 6 I/O Routines grant](http://news.perlfoundation.org/2017/01/grant-proposal-standardization.html) and describes the proposed changes to the implementations of Rakudo's IO routines. **Each topic has an `[Issue for discussion]` link in the title that points to a GitHub Issue where the topic can be discussed.** --------------- ## Terms and Conventions - `routines` — means both subroutines and methods (as both are `Routine` types) - `IO::Handle.seek` / `.seek` — all method names are referenced with a `.` before their name, which is optionally preceded by the type. - `&seek` — all subroutine names are referenced with a `&` before their name. - `seek` — if neither a `.` nor `&` preceeds the name, the reference is to both subroutines and methods with that name - `$*SPEC` — functionality common to `IO::Spec::*` types, is referred to using `$*SPEC` variable and means all `IO::Spec::*` types that implement a method or feature proposed for change. ## Legend Some sections are marked as: - [✔️] docs - [✔️] master roast - [✘] 6.c-errata roast This indicates whether the **proposed change** affects something that *is* (`[✔️]`) or *isn't* (`[✘]`) documented on [docs.perl6.org](https://docs.perl6.org), tested in [master branch of roast](https://github.com/perl6/roast), or tested in [6.c-errata branch of roast](https://github.com/perl6/roast/tree/6.c-errata). Just `[✘] roast` means both `master` and `6.c-errata` branches. To re-iterate: the indicators are only for the *proposed changes* (e.g. removed argument); not *entire* routines. ------------------------------ # Non-Conflicting Improvements The changes proposed in this section do not change current behaviour and merely enhance it or add new, non-conflicting features to. ------------------------------ ## `IO::Handle`'s Closed status [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/2) **Current Behaviour:** - When a IO::Handle is closed, its $!PIO atribute is set to nqp::null. This causes calls to many methods on a closed file handle to return LTA error, such as `foo requires an object with REPR MVMOSHandle`. **Proposed Change:** - On handle's closing, mixin a role that overrides all the relevant methods to throw/fail with an error. This will give the same behaviour as adding `if nqp::isnull($!PIO) { ... throw ... }` to all the methods, without a performance impact to open handles (it was ~5% when such check was added to `.lines` iterator) ------------------------------ ## Restructure `spurt` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/3) - [✔️] docs (with several inaccuracies) - [✘] roast **Current Behaviour:** - `IO::Path` implements `.spurt` which is the only writing method that's present in `IO::Path` but is not present in `IO::Handle` - `:bin` parameter on `&spurt` / `IO::Path.spurt` is taken and documented, but is ignored. The binary mode is enabled based on whether or not the spurted `$content` is a `Blob`. - The docs lie about `&spurt` being able to take an `IO::Handle` **Proposed Change:** - Move `IO::Path.spurt` implementation to `IO::Handle`. Remove all of its parameters, except for a single positional `Cool:D` parameter. - the bin/non-bin mode is selected based on whether the handle is in bin/non-bin mode - Make `IO::Path.spurt` delegate to `IO::Handle` - Remove `:bin` argument and ascertain the spurt mode based on the type of the content to be spurted - The rest of the arguments are to be used in the `IO::Handle.open` call, with the `:createonly` argument being an alias for `:x` open mode. ------------------------------ ## `IO::Path` routines that involve a stat call [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/4) **Affected Routines:** - `.d` - `.f` - `.l` - `.r` - `.s` - `.w` - `.x` - `.z` - `.rw` - `.rwx` - `.modified` - `.accessed` - `.changed` - `.mode` **Current Behaviour:** Each test goes out to VM to perform several `stat` calls (other than `.e` that performs just one). For example, a single `.rwx` call performs 4 `stat` calls. Based on IRC conversation, `stat` call is expensive and caching its results can be beneficial. **Proposed Change:** Change `nqp::const::STAT*` constants to be powers of 2. Add `nqp::stat_multi` op that will take bitwise-ORed `nqp::const::STAT*` constants representing the pieces of stat information to be returned as a hash. This will let us perform a single stat call to fetch all of the required information. (related discussion: https://irclog.perlgeek.de/perl6-dev/2017-03-06#i_14213924) ------------------------------ ## Expand Features of `IO::Path.extension` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/5) **Current Behaviour:** It's not uncommon to see users asking on IRC how to obtain or modify an extension of a path. Depending on what is needed, the answer is usually a gnarly-looking `.subst` or `.split`+`.join` invocation. In addition, often the desired extension for files like `foo.tar.gz` would be `tar.gz`, yet the current `.extension` does not offer a means to obtain it. **Proposed Change:** - Add `uint :$parts = 1` named parameter that specifies how many parts (the `.whatever` segments, counting from end) to consider as the extension. That is `'foo.tar.gz'.IO.extension` returns `'gz'`, `'foo.tar.gz'.IO.extension: :2parts` returns `'tar.gz'`, and `'foo.tar.gz'.IO.extension: :3parts` returns `''` (signaling there is no (3-part) extension on the file). In the future we can extend this to take a `Range` or `Junction` of values, but for now, just a single `UInt` should be sufficient. The default value of `1` preserves the current behaviour of the routine. Value of `0` always makes routine return an empty string. - Add a candidate that accepts a positional `$replacement` argument. This candidate will return a new `IO::Path` object, with the extension changed to the the `$replacement`. The user can set the `:parts` argument to `0` if they want to *append* an extra extension. The operation is equivalent to: ```perl6 my $new-ext = 'txt'; say (.substr(0, .chars - .extension.chars) ~ $new-ext).IO with 'foo.tar.gz'.IO # OUTPUT: «"foo.tar.txt".IO␤» ``` Note: since `.extension` returns the extension without the leading dot, the replacement string does not have it either. However, since the users may be inclined to include it, we should warn if it is included. ------------------------------ ## Use typed exceptions instead of `X::AdHoc` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/6) **Current Behaviour:** - Some IO exceptions are generic, `X::AdHoc` type of exceptions. **Proposed Change:** - Use existing and create new, if needed, exceptions, all living in `X::IO::*` namespace. ------------------------------ ## Make `IO::Path.resolve` fail if it can't resolve path [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/7) **Current behaviour:** `.resolve` will attempt to access the filesystem and resolve all the links, but will stop resolving as soon as it hits a non-existent path; all further parts will be merely cleaned up (e.g. `foo///../` will have duplicated slashes removed, but the `../` part will remain). **Proposed behaviour:** Add `Bool :$completely` parameter that, when specified as `True`, will cause `.resolve` to `fail` if cannot fully resolve the path. ------------------------------ ## Make `&words` default to `$*ARGFILES` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/8) **Current behaviour:** `&slurp`, `&lines`, `&get`, and `&getc` (or, semantically, "whole thing", "all lines", "one line", and "one char") default to using `$*ARGFILES`. `&words` (or "all words") exceptionally doesn't and throws instead. **Proposed behaviour:** Make `&words` default to `$*ARGFILES`, just like the rest of the routines in this family. ------------------------------ # Changes with Backwards-Compatible Support The changes proposed in this section allow for retention of old behaviour. It is proposed the old behaviour to be removed entirely in 6.d language. Note: since our current infrastructure for 6.d language is **additive,** the behaviour proposed for removal in 6.d might not end up actually being removed from the code, but instead marked as deprecated with warnings/exceptions issued on use (and appropriately documented as being obsolete). ------------------------------ ## `IO::Handle.seek` seek reference [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/1) - [✔️] docs - [✔️] master roast - [✘] 6.c-errata roast **Current behaviour**: - The seek reference is taken as an enum which is globally available and is somewhat long to type: `SeekFromBeginning`, `SeekFromCurrent`, `SeekFromEnd`. Such type of arguments is rare in the rest of the language and the enums prevent parenthesis-less subroutine calls of the same name. **Proposed change**: - Use mutually exclusive named arguments instead: `:from-start`, `:from-current`, and `:from-end`. The old enums will be kept in 6.c language and will be removed in 6.d. ------------------------------ ## Rename `IO::Handle.slurp-rest` to just `.slurp` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/9) - [✔️] docs - [✔️] roast **Current behaviour**: There are thematically related routines: `comb` (all the characters), `words` (all the words), `lines` (all the lines), and `slurp` (all the stuff). All but the last are present as subroutines and as methods on `IO::Path`, `IO::ArgFiles`, `IO::Path`, and `IO::Pipe`. With respect to `&slurp`, there is sub `&slurp` and method `.slurp` on `IO::Path` and `IO::ArgFiles`. The `IO::Handle` and `IO::Pipe` name it `.slurp-rest` instead. Since `IO::ArgFiles is IO::Handle`, it also has a `.slurp-rest`, but it's broken and unusable. **Proposed change**: Rename `.slurp-rest` to just `.slurp` in 6.d language and make use of `.slurp-rest` issue a deprecation warning. I can surmise the alternate name in `IO::Handle` and its subclasses was meant to be indicative that `.slurp-rest` only slurps **from the current file position**. However, this caveat applies to every single read method in `IO::Handle`: `.slurp`, `.lines`, `.words`, `.comb`, `.get`, `.getc`, `.getchars`. Yet, all but `.slurp` do not have `-rest` in their name, as the behaviour is implied. In fact, `Seq`-returning methods even interact with each other when called on the same handle, as the file position being advanced by one iterator affects what the next item in another `Seq` will be. Thus, knowledge about the effect of file position on all of these methods is *essential,* and so requiring all users to use a longer name as a reminder lest they forget about this behaviour in slurps is antisocial. The longer name is even more bizarre in `IO::Pipe`, on which `.seek` cannot be used. ------------------------------ ## `:$test` parameter on multiple routines [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/10) **Affected routines:** - `IO::Path.chdir` / `&chdir` - `&indir` - `&homedir` *(proposed for removal)* - `&tmpdir` *(proposed for removal)* **Current behaviour:** The affected routines take `:$test` parameter as a string (or `Positional` that's later stringified) of tests to perform on a directory. It's difficult to remember the correct order and currently it's very easy to give an argument that will incorrectly report the directory as failing the test: `chdir "/tmp/", :test` succeeds, while `:test` or `:test fail. **Proposed behaviour:** It is proposed the `:$test` parameter to be replaced with 4 boolean named parameters `:$r, :$w, :$x, :$d`, with `:$d` (is it directory) test to be enabled by default. Usage then becomes: ```perl6 # BEFORE: indir :test, '/tmp/foo', { dir.say } # Good indir :test, '/tmp/foo', { dir.say } # Bad. Wrong order # AFTER: indir :r:w:x, '/tmp/foo', { dir.say } # Good indir :w:r:x, '/tmp/foo', { dir.say } # Still good indir :x:r:w, '/tmp/foo', { dir.say } # Still good ``` Note that as part of this change, it is proposed all of the aforementioned *Affected Routines* default to only using the `:d` test. Doing so will also resolve [RT#130460](https://rt.perl.org/Ticket/Display.html?id=130460). To preserve backwards compatibility, the `:$test` parameter will remain for 6.c language and will be removed in 6.d language. ------------------------------ # Changes with No Backwards-Compatible Support The changes in this section propose for a change of behaviour without providing any backwards compatible support. Unless noted otherwise, the proposal is for the change to be done in 6.c language. ------------------------------ ## Generalize `IO::ArgFiles` into `IO::Cat` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/11) **Current Behaviour:** - `IO::CatPath` and `IO::CatHandle` [have been removed pre-Christmas](https://github.com/rakudo/rakudo/commit/a28270f009e15baa04ce76e) and `IO::ArgFiles` handles the `$*ARGFILES` stuff. Users wishing to read from multipe files are left to their own devices. **Proposed Change:** All of the changes are proposed for 6.d. We implement `IO::Cat`—a generalized version of what `IO::ArgFiles` currently does: an ability to seamlessly treat multiple filehandles as one, in read-only mode. The current `IO::ArgFiles` is obsoleted by `IO::Cat`, but since 6.d language is additive and to be a bit friedlier with existing code, it is proposed for `IO::ArgFiles` to remain as simply `IO::ArgFiles is IO::Cat {}` and for `$*ARGFILES` to contain an `IO::ArgFiles` instance. An `IO::Cat` `is IO::Handle` and is created via a `.new` method, that takes a list of `Str`, `IO::Path`, and `IO::Handle` (and by extension its subclass, `IO::Pipe`) objects. Mixing of types is allowed. `Str`s get turned into `IO::Path` at `IO::Cat`'s instantiation time. Any attempt to use any of the write methods or attempting to call `.open` in write, append, or exclusive modes throws. `.open` in read mode just returns `self`. `.seek` throws just as on `IO::Pipe`. All of the read methods operate the same as on a regular `IO::Handle`, going through the handles the object was instantiated with, opening any `IO::Path`s when their turn arrives. These are the broad strokes and since this is to be in 6.d, the implementation can be refined once first draft of it is done. ------------------------------ ## Changes to `.Supply` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/12) - [✘] docs - [✔️] roast ([1 test](https://github.com/perl6/roast/blob/4dcbbb9097a728b7e46feb582acbaff19b81014d/S16-io/supply.t#L30-L31)) **Current behaviour:** - Among the IO routines, the method is implemented only in `IO::Handle` (and is inherited by `IO::Pipe`). - `.Supply` takes `:bin` parameter that specifies whether it'll read in binary mode. Note that `open("foo", :bin).Supply` will **NOT** read in binary mode! **Proposed behaviour:** - Remove `.Supply(:bin)` parameter. Instead, Use `IO::Handle`'s `$!encoding` attribute's value to decide whether to use binary mode. Currently, there's [one roast test](https://github.com/perl6/roast/blob/4dcbbb9097a728b7e46feb582acbaff19b81014d/S16-io/supply.t#L30-L31) that would be impacted, however its opening in non-binary mode and then reading in binary feels like a thinko. ------------------------------ ## Make `IO::Path.abspath` a private method [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/13) - [✔️] docs - [✘] roast **Current behaviour:** `.abspath` is a public method that simply caches `$*SPEC.rel2abs` into the private `$!abspath` attribute. Also exists, `IO::Path.absolute`. That has exact same functionality, except it also takes an optional `$CWD` parameter. **Proposed behaviour:** Make `.abspath` a private method, to avoid duplicate functionality and confusion about which version takes the `$CWD` argument. ------------------------------ ## Make `IO::Path.child` fail for non-child paths / Add `IO::Path.concat-with` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/14) - [✔️] docs (but no description of ability to use nested paths or parent paths) - [✔️] roast (but no tests of ability to use nested paths or parent paths) **Current behaviour:** `.child` can accept any path part, so `"/tmp/files/".IO.child("../../my/secrets")` is a valid operation and based on the argument given to `.child`, the resulting path may be something that is **not** a child of the original path. **Proposed behaviour:** The proposed change is two-part: rename current method and add another behaviour under the name `.child`: 1) Make the current behaviour of `.child` available via `.concat-with` method. The goal of the name change is to make it indicative that the user can provide any type of path fragment—not necessarily a child one or singular— and that giving what looks like an absolute path as the argument will merely concatenate it to the original path: ```perl6 # non-child path is OK "/tmp/files/".IO.concat-with("../../my/secrets").say; # OUTPUT: "/tmp/files/../../my/secrets".IO # "absolute" path gets tacked on to original "/tmp/files/".IO.concat-with("/my/secrets").say; # OUTPUT: "/tmp/files//my/secrets".IO # child file is OK "/tmp/files/".IO.concat-with("foo.txt").say; # OUTPUT: "/tmp/files/foo.txt".IO ``` 2) Make `.child` fully resolve the resultant path and `fail` if it's not the child of the original path. The last part of the path does not have to actually exist in order to pass the check. The idea behind the new behaviour is to make it possible to *securely* use code like the example below and not worry that `$user-input` would contain any path that would be able to read from or write to outside the original path (in the example, that is `/tmp/files/`): ```perl6 my $stuff = "/tmp/files/".IO; if $stuff.child($user-input) -> $_ { when :!e { .spurt: "Stuff started on {DateTime.now}"; say "Started new file for your stuff!"; } say "The content of your stuff is:\n{.slurp}"; } else -> $file { die "Cannot use $file as a valid file to read/write from"; } ``` ------------------------------ ## Make `:close` behaviour the default in `IO::Handle` and Its Subclasses [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/15) - [✘] docs (`:close` is mentioned only for `.comb` and only in signature and a example's comment, not prose) - [✘] roast (`:close` is *used* in tests for `.words` and `.comb` but its functionality is not tested) **Current behaviour:** The routines `&slurp`, `IO::Path.slurp`, `&lines`, `IO::Path.lines`, `&comb`, `IO::Path.comb`, `IO::Path.words`, `IO::Path.split`, and the corresponding `IO::ArgFiles` routines **close the filehandle at the end.** Contrary to that pattern, `IO::Handle` and `IO::Pipe` routines `.slurp-rest`, `.lines`, `.words`, `.comb`, and `.split` do *NOT* close the handle by default (I would assume some sort of closage is done for pipes, but preliminary tests showed omitting `:close` on `IO::Pipe.slurp-rest` in a 3000-iteration loop causes a coredump on circa 2017.02 Rakudo) **Proposed behaviour:** - Remove `:close` parameter - Add `:leave-open` `Bool` parameter that defaults to `False`. Close the handle when the iterator is exhausted, unless `:leave-open` parameter is set to `True` A March 22, 2017 ecosystem grep showed 1125 potential calls to the methods, yet only one match came up for the `close` parameter on the same line: the `perl6/doc` repository. Thus, no one seems to be using the `:close` parameter. My guess would be this is due to ignorance of its existence and that the programs are leaking filehandles, rather than the users explicitly closing the filehandle elsewhere in the program in a way that my grep did not pick it up. ```bash $ grep -FR -e '.comb' -e '.lines' -e '.words' -e '.slurp-rest' | wc -l 1125 $ grep -FR -e '.comb' -e '.lines' -e '.words' -e '.slurp-rest' | grep close | wc -l 1 ``` Also, it's likely much more common to wish to close the filehandle at the end in these methods than not to. The operations provide the file as basically a stream of chunks: whole (`.slurp-rest`), line-sized (`.lines`), word-sized (`.words`), pattern- or character-sized (`.comb`), letting the user perform most possible operations without needing to `.seek` to another file position after exhausting the iterator (which would require the handle to be kept open). ------------------------------ ## Changes to behaviour of `.lines`, `.words`, `.split`, `.comb` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/16) - [✘] docs - [✘] roast **Affected Routines** - `&lines`, `IO::Path.lines`, `IO::Handle.lines` - `&words`, `IO::Path.words`, `IO::Handle.words` - `&split`, `IO::Path.split`, `IO::Handle.split` - `&comb`, `IO::Path.comb`, `IO::Handle.comb` **Current behaviour:** - The subroutine forms delegate work to `IO::Path` methods - `IO::Path` methods delegate to `IO::Handle`'s methods; they do so by picking out a few args to forward, but the rest they `Capture` and give to `IO::Path.open` - `IO::Handle` methods do the work and take an optional `:close` parameter, which will cause the handle to be closed when the iterator is exhausted. **Problems:** *`#1` Argument handling* - `IO::Handle`'s methods differ in functionality with their `Str.` counter-parts (e.g. `.split` does not offer `:skip-empty`). - Several of the arguments accepted and forwarded to `open` aren't needed for *reading* mode these routines use *`#2` Possibility of filehandle leak* - If the user does not exhaust the `Seq` returned by the methods, the filehandle won't get closed until it gets GCed: ```perl6 $ perl6 -e 'for ^3000 { $ = "lines".IO.lines[1] }' Failed to open file /tmp/tmp.XRqP7tH5zR/lines: too many open files… ``` **Discussion:** lizmat++ identified the issue and proposed and partially (`.lines` only) implemented a solution for file handle leak by **`(a)`** making `IO::Path` slurp the files (so the file handle gets closed right at the call) and **`(b)`** removing `:close` argument from `IO::Handle` methods, since we can't guarantee the handle's closing. While **`(a)`** does address the handle leak problem, I think it creates a much bigger problem in its wake. [The measurements](https://twitter.com/zoffix/status/843600777457340416) show a slurped file needs about 4.8x its size of RAM. So slurping files, especially ones with no pre-defined (by programmer) format, can very easily nom all the available RAM that on many servers is limited as it is. So by introducing this behaviour, I believe we'll be unwittingly instating a "best practice" to never use `IO::Path` methods due to their slurping behaviour, programmer's lack of full control over the environment and the files the program will work in and operate on. In addition, since the subroutine forms of these routines simply forward to `IO::Path`, this means Perl 6 one liners will be commonly afflicted with both high RAM usage and performance issues (e.g. "print first line of a 4GB file" will require 19GB of RAM and a lot of processing time, rather than being nearly instant). I think situation **`(b)`** (can't guarantee close of handle) is a caveat that simply needs to be documented. Forcing the user to keep the filehandle around in a variable, just to be able to close it is a bit antisocial, and the problem becomes worse if the user wants to both lazily read a file and pass, say, the `.lines` `Seq` around the program, as along with the `Seq` the filehandle will need to be passed as well. Thus, combined with critique of **`(a)`**, the recommended way to get the first 5 lines from a file becomes rather involved: ```perl6 my @stuff = with open "foo" { LEAVE .close; .lines[^5]; } ``` And despite the removal of convenience `:close` parameter, it's quite easy for user to erroneously make a mistake and might even make it more likely the users will make it more often (we [had a user who did just that](https://irclog.perlgeek.de/perl6/2017-03-11#i_14243167)): ```perl6 my $fh = open "foo"; my $lines = $fh.lines; $fh.close; say $lines[0]; # Dies with "Reading from filehandle failed" ``` **Proposed behaviour:** *`#1` Argument handling* - Do not take args to pass to `.open` call as a `Capture`, take them as normal args and `Capture` the args for the routines we're delegating to instead. For the `.open` call, take only these parameters: `:$chomp`, `:$enc`, `$nl-in`, and `:$nl-out`. The rest of `open`'s arguments aren't applicable. This will also make it easier to ensure we're not missing any of the routines' args when forwarding them. - Make the routines take the same args and behave the same as their `Str` counterparts. *`#2` Possibility of filehandle leak* - *SIDE NOTE: another section in this IO Plan proposes to reword the functionality of the `:$close` parameter in terms of `:$leave-open`. The prose that follows reflects that change* - Keep the `:$leave-open` parameter present for all 4 routines in `IO::Handle` - Add `$limit` parameter to all 4 routines in `IO::Handle` (`.lines` already has it, although it's not implemented in a way that avoids the leak) - When `$limit` is given, close the filehandle when it's reached or when the iterator has been exhausted, unless `:leave-open` is set to `True` - Unless `:leave-open` parameter is `True`, close the filehandle when the iterator has been exhausted (even if `$limit` isn't given) - `+Inf` and `Whatever` `$limit` is permitted, to maintain consistency with `Str.lines($limit)` parameter. When set to such a value, the effect is the same as setting no limit - Clearly document the filehandle leak issue along with plentiful examples of using `$limit` instead of `[^whatever]` on the returned `Seq`, or to exhaust the partially-consumed Seq by sinking it, when you're done with it. With these proposals, the example mentioned earlier remains simple, and does not have the filehandle leak issue: ```perl6 my @stuff = "foo".IO.lines: 5; ``` ------------------------------ ## Change order of arguments in `&link`/`&symlink` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/17) *For `&link`:* - [✘] docs - [✘] roast *For `&symlink`:* - [✔️] docs (but confuses terminology for `"target"`) - [✔️] roast (but confuses terminology for `"target"`) **Current behaviour:** Routines `&rename`, `&move`, `©`, as well as `*nix` command line untilities `mv`, `cp`, **and `ln`** follow the format of `command $existing-thing, $thing-we're-creating` with respect to their arguments. The `&link` and `&symlink` routines are an exception to this rule. And while `&symlink` is documented and tested, both the docs and the tests incorrectly use the term `"target"` to refer to the link, rather to the actual target it points to. **Proposed behaviour:** As there's [already some confusion](https://www.google.ca/#q=I+can+never+remember+the+argument+order+to+ln&*) with the order of arguments to `ln` tool, it would be beneficial to maintain consistency both within `&rename`, `&move`, `©`, `&link`, and `&symlink` routines and with `ln <-> &link/&symlink`. It is proposed the order of the arguments for `&link` and `&symlink` to be reversed (right now; in 6.c language). There appears to be no modules in the ecosystem that use these routines and the failure mode when someone were to use the old convention is a failure due to non-existent target. - `link $existing-thing, $thing-we're-creating` (`link $target, $name`) - `symlink $existing-thing, $thing-we're-creating` (`symlink $target, $name`) ------------------------------ ## Improve `IO::Handle.lock` Arguments [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/18) - [✘] docs - [✘] roast **Current behaviour:** `IO::Handle.lock` takes a single `Int:D` that specifies the type of lock to acquire. **Proposed behaviour:** - Remove the `Int:D` argument - Use named arguments to specify mode I'd like to make the arguments more user-friendly, without creating a new enum, if possible, as those interfere with parenthesis-less subroutine calls. From [the sourcecode](https://github.com/MoarVM/MoarVM/blob/a8448142d8b49a742a6b167907736d0ebbae9779/src/io/syncfile.c#L303-L358), I gather the `Int:D` argument represents whether: (a) a lock is *exclusive* or *shared*; (b) the method will block until a lock is acquired or it'll throw if it cannot be acquired. I can count on my fingers how many times I've used locks in my life, so I'm unsure which mode is more frequently used and whether one type of mode is way more frequent for it to be used as a reasonable default. Unless an alternative is suggested, I'd like to change the method to take the possible modes via `.lock(:exclusive, :wait)` arguments and default to a shared, non-blocking lock. ------------------------------ ## Make `IO::Path.new-from-absolute-path` a private method [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/19) - [✘] docs - [✘] roast **Current behaviour:** `.new-from-absolute-path` is a public method that, for optimization purposes, assumes the given path is most definitely an absolute path, and so it by-passes calls to `.absolute` and `.is-absolute` methods and fills up their cache directly with what was given to it. **Proposed behaviour:** Make this method a private method. Since no checks are performed on the path, use of this method is dangerous as it gives wildly inaccurate **and exploitable** results when the path is not infact absolute: `.is-absolute` always returns `True`; `.absolute` always returns the string the method was called with; `.perl` does not include `CWD`, so round-tripped value is **no longer an absolute path** and points to a relative resource, depending on the `CWD` set at the time of the `EVAL`; and while `.resolve` resolves to an absolute path, `.cleanup` ends up returning a path *relative to the `CWD` used at the time of path's creation*: ```bash $ perl6 -e 'dd IO::Path.new-from-absolute-path("foo").is-absolute' Bool::True $ perl6 -e 'dd IO::Path.new-from-absolute-path("foo").absolute' Str $path = "foo" $ perl6 -e 'dd IO::Path.new-from-absolute-path("foo")' "foo".IO(:SPEC(IO::Spec::Unix)) $ perl6 -e 'dd IO::Path.new-from-absolute-path("foo").resolve' "/foo".IO(:SPEC(IO::Spec::Unix)) $ perl6 -e 'my $p = IO::Path.new-from-absolute-path("foo"); chdir "/tmp"; dd $p.cleanup' "foo".IO(:SPEC(IO::Spec::Unix),:CWD("/home/zoffix")) ``` ------------------------------ # Controversial Changes I'm not 100% sure whether the changes in this section actually need to be made, as they aim to change what appears to be deliberately introduced behaviours; I'm just unsure of the reasoning behind them. I'm also unsure which language version to make the changes in, were it decided the're needed. ------------------------------ ## Make `IO::Path.Str` Return `$.abspath` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/20) **Current behaviour:** - `.Str` method uses the value of `$!path` attribute and does NOT take the object's `$!CWD` into consideration. Thus, creating a relative `IO::Path` object, then `chdir`-ing somewhere, and then `.Str`-ing it will give an incorrect path. **Proposed behaviour:** Use `$.abspath` instead. The `.Str`-ingified path will be always absolute. The user still has `$.path` attribute along with `.relative` method to stringify a path as a relative path, making it sensitive to `$*CWD`, if they so require. ------------------------------ ## Make `IO::Path.is-absolute` Give False for `/` path on Windows [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/21) - [✔️] docs (but not the information that `/` is absolute on Windows) - [✔️] roast **Current behaviour:** - On Windows, `'/'.IO.is-absolute.say` returns `True`, despite the path lacking a drive. - Currently, this behaviour is explicitly tested by 6.c-errata roast. **Proposed behaviour:** Make `IO::Path.is-absolute` return `False` for `/` (and `\\`) on Windows, as the path is still dependent on the CWD associated with the path. Moreover, calling `.absolute` on such a path prepends the drive letter, which is an odd thing to do for a path that was already claimed to be absolute by the `.is-absolute` method. ------------------------------ # Removals The changes in this section propose the immediate removal of routines, with no deprecation period. ------------------------------ ## Remove `role IO {}` Along With Its Only `IO.umask` Method [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/22) - [✘] docs (partial and inaccurate) - [✘] roast ([1 indirect test](https://github.com/perl6/roast/blob/4dcbbb9097a728b7e46feb582acbaff19b81014d/S06-multi/type-based.t#L43) that tests multi-dispatch by dispatching `$*ERR` to `IO` type candidate) **Documentation:** While the documentation website does mention `role IO`, it's mainly to list the IO subroutines. The role itself is described as *"Input/output related object"*, which isn't entirely true, as `IO::Path` does not do `IO`, despite being related. The role is also described as providing no functionality, despite it currently containing the `.umask` method. The 5-to-6 documentation does reference the `IO.umask` as the replacement for Perl 5's `&umask` subroutine. **Current Behaviour:** - `role IO` is done by `IO::Handle` and `IO::Socket` - `.umask` is implemented by shelling out to `umask` command (not available on Windows). **Proposed Change:** Remove the role, together with its `.umask` method. While `.umask` could be re-implemented with C and adding another nqp op, functionally the method is a bit of an outlier, compared to all the other methods currently available on the `IO::*` types. So while we might expand the core offerings in this area in the future, I believe the current implementation should be removed. With the `.umask` method gone, the `role IO` becomes empty, serving no purpose, and so it should be removed as well. The object that `does IO` are vastly different objects, with different interfaces, so there's no inherent benefit in unifying them with a role. ------------------------------ ## Remove `IO::Path` Methods from `IO::Handle` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/23) - [✘] roast - [✘] docs (partial and inaccurate: only `.e`, `.d`, `.f`, `.s`, `.l`, `.r`, `.w`, `.x` are present and they all refer to "the invocant" rather than `IO::Handle.path`, suggesting they're a verbatim copy-paste of `IO::Path` docs) **Affected Routines:** - `.watch` - `.chmod` - `.IO` - `.e` - `.d` - `.f` - `.s` - `.l` - `.r` - `.w` - `.x` - `.modified` - `.accessed` - `.changed` - `.mode` **Current behaviour:** The methods delegate to `IO::Handle`'s `$!path` attribute. **Proposed behaviour:** Remove all of these methods from `IO::Handle`. Reasoning: 1) Most of these don't make any sense on subclasses of `IO::Handle` (`IO::Pipe` and `IO::ArgFiles` or the proposed `IO::Cat`); `.d` doesn't make sense even on an `IO::Handle` itself, as directories can't be `.open`ed; `.chmod` affects whether an object is `.open`-able in the first place, so, amusingly, it's possible to open a file for reading, then `.chmod` it to be unreadable, and then continue reading from it. 2) The methods are unlikely to be oft-used and so the 5 characters of typing that they save (see point `(3)` below) isn't a useful saving. The usual progression goes from `Str` (a filename) to `IO::Path` (`Str.IO` call) to `IO::Handle` (`IO::Path.open` call). The point at which the information is gathered or actions are performed by the affected routines is generally at the `IO::Path` level, not `IO::Handle` level. 3) All of these *and more* (`IO::Handle` does not provide `.rw`, `.rwx`, or `.z` methods) are still available via `IO::Handle.path` attribute that, for `IO::Handle`, contains the path of the object the handle is opened on. Subclasses of `IO::Handle` that don't deal with paths can simply override *that* method instead of having to override the 15 affected routines. The removal also cleans up the interface of the proposed `IO::Cat` type, in which these method do not produce anything useful. ------------------------------ ## Remove `&homedir` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/24) - [✘] docs - [✘] roast Saves typing half a single line of code and is rarely needed. The user will set `$*HOME` variable directly, using `my ...` to localize the effects, and using `.= chdir` if any directory tests need to be done. ------------------------------ ## Remove `&tmpdir` [[Issue for discussion]](https://github.com/zoffixznet/IOwesomeness/issues/25) - [✘] docs - [✘] roast - [✘] routine is broken and never worked since Christmas Saves typing half a single line of code and is rarely needed. The user will set `$*TMPDIR` variable directly, using `my ...` to localize the effects, and using `.= chdir` if any directory tests need to be done. ------------------------------ # Bug Fixes Along with implementation of API changes in this proposal, an attempt to resolve the following tickets will be made under the [IO grant](http://news.perlfoundation.org/2017/01/grant-proposal-standardization.html). ## RT Tickets - [RT#128047: Rakudo may crash if you use get() when -n is used (perl6 -ne 'say get' <<< 'hello')](https://rt.perl.org/Ticket/Display.html?id=128047) - [RT#125757: shell().exitcode is always 0 when :out is used](https://rt.perl.org/Ticket/Display.html?id=125757) - [RT#128214: Decide if `.resolve` should work like POSIX `realname`](https://rt.perl.org/Ticket/Display.html?id=128214) - [RT#130715: IO::Handle::close shouldn't decide what's a failure](https://rt.perl.org/Ticket/Display.html?id=130715) - [RT#127407: (1) add method IO::Path.stemname; (2) expand method IO::Path.parts](https://rt.perl.org/Ticket/Display.html?id=127407) - [RT#127682: (OSX) writing more than 8192 bytes to IO::Handle causes it to hang forever](https://rt.perl.org/Ticket/Display.html?id=127682) - [RT#130900: nul in pathname](https://rt.perl.org/Ticket/Display.html?id=130900) - [RT#125463: $non-existent-file.IO.unlink returns True](https://rt.perl.org/Ticket/Display.html?id=125463) - [RT#129845: `.dir` returns corrupted `IO::Path`s under concurrent load](https://rt.perl.org/Ticket/Display.html?id=129845) - [RT#128062: (MoarVM) chdir does not respect group reading privilege](https://rt.perl.org/Ticket/Display.html?id=128062) - [RT#130781: Using both :out and :err in run() reports the wrong exit code](https://rt.perl.org/Ticket/Display.html?id=130781) - [RT#127566: run hangs on slurp-rest with :out and :err if command runs background process](https://rt.perl.org/Ticket/Display.html?id=127566) - [RT#130898: IO::Spec confused by diacritics](https://rt.perl.org/Ticket/Display.html?id=130898) - [RT#127772: mkdir($file) succeeds if $file exists and is a regular file](https://rt.perl.org/Ticket/Display.html?id=127772) - [RT#123838: IO::Handle::tell return 0, no matter what](https://rt.perl.org/Ticket/Display.html?id=123838) ## GitHub Issues - [roast/Add tests to make sure that file names roundtrip correctly when they should](https://github.com/perl6/roast/issues/221) - [doc/IO::Handle "replace" deprecated method ins with kv](https://github.com/perl6/doc/issues/401) ## Other Issues - `IO::Path.resolve` is not portable and produces wrong results on Windows. rakudo-2018.03/docs/archive/2018-03-04--Polishing-Rationals.md0000644000175000017500000003651713253717231021527 0ustar alexalex# Polishing Rationals Mar. 4, 2018 proposal by Zoffix ## Revision #3 Previous revisions: [rev. 2](https://github.com/rakudo/rakudo/blob/5feb6bbec3582831b3daef39b027597040ff5a92/docs/archive/2018-03-04--Polishing-Rationals.md) [rev. 1](https://github.com/rakudo/rakudo/blob/a918028e058fd39646a5f24e1734d69821d67469/docs/archive/2018-03-04--Polishing-Rationals.md) ## Executive Summary 1. Implement `MidRat` and `MidRatStr` types. A `MidRat` is a `Rat`/`FatRat` allomorph. It has the precision of a `FatRat`, but is has infectiousness of a `Rat`. `MidRatStr` is the `MidRat`/`Str` allomorph. 2. `Rat` literals with denominators over 64-bit to be returned as a `MidRat` 3. If `Rat.new` is called with denominator that is (after reduction) over 64-bit, construct a `MidRat` instead 4. Cases that currently create a `RatStr` with denominators over 64-bit will return `MidRatStr` instead. 5. Remove the optimization that requires the use of `.REDUCE-ME` method, as the optimization has bugs, race conditions, and is detrimental in many cases. Preliminary testing (with some new optimizations) showed an 8% improvement in performance, so we're still getting a win here. 6. Always normalize zero-denominator Rationals to `<1/0>`, `<-1/0>`, and `<0/0>` - Try mixing in `ZeroDenominatorRational` role into these to get performance boost in operators (in dispatch). If improvement is low, don't implement this part (the role mixing). ## Crude Trial Implementation A trial implementation that partially implements `MidRat`/`MidRatStr` is available in [`ratlab-fattish-rat` branch](https://github.com/rakudo/rakudo/tree/ratlab-fattish-rat) # TABLE OF CONTENTS - [Problems Being Addressed](#problems-being-addressed) - [1) Eliminate edge-cases that produce `Rat`s with denominators above 64-bit](#1-eliminate-edge-cases-that-produce-rats-with-denominators-above-64-bit) - [I propose:](#i-propose) - [Reasoning](#reasoning) - [Discarded Ideas](#discarded-ideas) - [2) Make `Rational`s fully-immutable to avoid data-races](#2-make-rationals-fully-immutable-to-avoid-data-races) - [1) Data Race](#1-data-race) - [2) Inconsistent Object Identity](#2-inconsistent-object-identity) - [3) Limited Usefulness of the Optimization](#3-limited-usefulness-of-the-optimization) - [I propose:](#i-propose-1) - [3) Fix bugs with operations on zero-denominator `Rational`s](#3-fix-bugs-with-operations-on-zero-denominator-rationals) - [I propose:](#i-propose-2) ## Problems Being Addressed 1) Eliminate edge-cases that produce `Rat`s with denominators above 64-bit ([RT#132313](https://rt.perl.org/Public/Bug/Display.html?id=132313#ticket-history)) 2) Make `Rational`s fully-immutable to avoid data-races ([RT#130774](https://rt.perl.org/Ticket/Display.html?id=130774#ticket-history)) 3) Fix bugs with operations on zero-denominator `Rational`s ([R#1354](https://github.com/rakudo/rakudo/issues/1354)) ## 1) Eliminate edge-cases that produce `Rat`s with denominators above 64-bit Under normal conditions, and if `FatRat`s are not involved, if a `Rat`-producing operation were to make a `Rat` with a denominator larger than 64-bit, the result is a `Num` instead: ```perl-6 say 1/48112959837082048697; # OUTPUT: «2.07844207337515e-20» ``` However, currently it's possible to create a `Rat` with denominators over 64-bit using `val`, quote words, `Rat` literal syntax, or `Rat.new` method call: ```perl-6 say [.^name, $_, .nude, .denominator.log: 2] with (val "1/48112959837082048697").Numeric; # [Rat 0.000000000000000000021 (1 48112959837082048697) 65.3830593574438] say [.^name, $_, .nude, .denominator.log: 2] with <1/48112959837082048697>; # [Rat 0.000000000000000000021 (1 48112959837082048697) 65.3830593574438] say [.^name, $_, .nude, .denominator.log: 2] with Rat.new: 1, 48112959837082048697; # [Rat 0.000000000000000000021 (1 48112959837082048697) 65.3830593574438] say [.^name, $_, .nude, .denominator.log: 2] with 1.111111111111111111111 # [Rat 1.11111111111111111604544 (1111111111111111111111 1000000000000000000000) 69.7604899926346] ``` As can be seen from the last example above, there is loss of precision involved in some routines when working with such `Rats`. ### **I propose:** 1. Implement `MidRat` and `MidRatStr` types. A `MidRat` is a `Rat`/`FatRat` allomorph. It has the precision of a `FatRat`, but is has infectiousness of a `Rat`. `MidRatStr` is the `MidRat`/`Str` allomorph. 2. `Rat` literals with denominators over 64-bit are returned as a `MidRat` 3. If `Rat.new` is called with denominator that is (after reduction) over 64-bit, construct a `MidRat` instead 4. Cases that currently create a `RatStr` with denominators over 64-bit will return `MidRatStr` instead. ### Reasoning 1. The new system makes the `Rat` literals be `Rational` literals, with precision handling based on how much precision the user provided. 3. While it may be somewhat unusual for `Rat.new` to create a type that isn't a `Rat`, I believe creating a `MidRat` instead of throwing is more user-friendly, as it can be hard to discern whether the denominator would fit, especially because the fit-test is done **after** reduction. For example, try guessing which of this would fit into a Rat: ```perl-6 Rat.new: 48112959837032048697, 48112959837082048697 Rat.new: 680564733841876926926749214863536422912, 1361129467683753853853498429727072845824 ``` The first one would end up as a `MidRat` with it's 66-bit denominator, while the second one becomes a `Rat` with value `0.5` after reduction. ### Discarded Ideas These are the alternatives I (and others) have considered and found inadequate. - *Discarded Idea #-1:* Make `RatStr` a non-infectious `FatRat` able to handle the extra precision. This is the idea in [rev. 2](https://github.com/rakudo/rakudo/blob/5feb6bbec3582831b3daef39b027597040ff5a92/docs/archive/2018-03-04--Polishing-Rationals.md), however: it feels a lot like abuse of a type for things it wasn't meant to be: - This idea means typing `my Str $x = 1.1111111111111111111` is a typecheck error, but typing `my Str $x = 1.11111111111111111111` is all OK. It feels very weird to me that we switch to producing `Str` subclasses from numeric literals. - This idea means we either have to lug around an additional `Int` denominator in all `RatStr` types and somehow make it available whenever the object is used as a `Rational` or make their performance a lot slower, as we'd be re-parsing the `Str` portion to extract high-precision denominator - This idea means when presented with a `RatStr`, we've no real idea whether it actually contains high-precision data. - *Discarded Idea #0:* Create a `FatRat` instead of a `Rat` in cases where we currently create a broken `Rat` This is the idea in [rev. 1](https://github.com/rakudo/rakudo/blob/a918028e058fd39646a5f24e1734d69821d67469/docs/archive/2018-03-04--Polishing-Rationals.md) of this proposal, but [further discussion](https://irclog.perlgeek.de/perl6-dev/2018-03-05#i_15887340) showed it would be more useful to have an equivalent of a non-infectious `FatRat` to, for example, facilitate extra precision in `π` and `e` constants without forcing the use of the infectious `FatRat` type for them. - *Discarded Idea #1:* All of problematic cases to produce a `Num` (or `NumStr`) While this avoids creating a new type it creates a problem that the user might get a type that isn't `Rational` by just adding a single digit: And that also means that when the user **explicitly gives us more precision** in their literals, we discard it and give a type that's less precise than even a plain `Rat`: ```perl-6 my Rat $x = 4.9999999999999999999; # OK my Rat $x = 4.99999999999999999999; # Typecheck failure: Got Num say 4.999999999999999999999999999999999999999999999999999999999999999999 ~~ ^5; # (would produce "False") ``` - *Discarded Idea #2:* Make literals produce `FatRat` and val/quotewords produce `RatStr` that can be either `FatRat` or `Rat` in the numeric portion. *(N.B.: unlike current version of the proposal, in this scenario a fatty `RatStr` behaves like an* **infectious** *`FatRat`)* This creates a problem with infectiousness in that, say `Num` + `RatStr` produce a `Num`. In a scenario where `RatStr` could contain a `FatRat` as a numeric, the operation would be expected to produce a `FatRat` as a result. Even if this is made to work, it would be unpredictable behaviour, as you can't tell by type alone what result you'd receive. - *Discarded Idea #3:* Introduce non-infectious FatRat type This would also require an allomorphic counterpart and I'm a bit worried about the increase in operators to handle such a type. And if you're making this type lose precision with operations with other types, may as well not have it have that precision available in the first place. ## 2) Make `Rational`s fully-immutable to avoid data-races Current implementation of `Rational` contains an optimization used by certain operators, e.g. `infix:<+>`: if we can perform the operation without needing to change the denominator, then we save time by avoiding reduction and merely produce an **un-reduced Rational** with a tweaked numerator. Thus, for example, instead of `<1/1>`, `½ + ½` gives `<2/2>`: say [.numerator, .denominator] with ½ + ½; # [2 2] A private `.REDUCE-ME` method is then used to cheat around that optimization and methods that need a reduced rational call it: say .nude with ½ + ½; # (1 1) This approach has three problems: ### 1) **Data Race** The worst issue is a rare data race. Since `.REDUCE-ME` **mutates** the `Rational` object and some operations read the numerator/denominator without reduction, it's possible for an operation in one thread (say `infix:<+>`) to read off the numerator, then for another thread to mutate numerator and denominator, and then for the first thread to read the denominator that no longer corresponds to the numerator that was read. The following code reproduces the race, and once in a while dies with `Died with the exception: Not right [2] (denominator 2 numerator 2)`: indicating that mathematical operation `½ + ½ + ½` resulted in answer `1`. Imagine the look on CFO's face when they find out a $1.5M profit somehow ended up being just $1M. ```perl-6 use v6.d.PREVIEW; for ^20000 { await ^10 .map: { start { my $r := ½ + rand.ceiling/2; my $at := now + .003; await Promise.at($at).then({ $r.nude; $r.numerator == $r.denominator == 1 or die "Not right [1] ($r.Capture())"; }), Promise.at($at).then({ my $r2 := $r + ½; $r2.numerator == 3 and $r2.denominator == 2 or die "Not right [2] ($r2.Capture())"; }) }} } ``` ### 2) **Inconsistent Object Identity** Since `Rational`s are a value type, the following answer makes sense: ```perl-6 say ½+½ === 1/1; # True ``` The two resultant `Rational`s are of the same type and have the same value, and thus are the same object. Object identity is used by `Set`s and related types, so we'd expect the two objects above, when placed into a `Set`, to be counted as one item, however they don't: ```perl-6 say set(½+½, 1/1).perl; # Set.new(1.0,<1/1>) ``` The aforementioned `.REDUCE-ME` must be called by everything that has to operate on a reduced rational. We already fixed several bugs where methods did not do so, and the above example is just one more in that bunch. Even the output of `.perl`—which doesn't need to use `.REDUCE-ME`—is affected by the presence of this optimization. ### 3) **Limited Usefulness of the Optimization** The aforementioned optimization that produces unreduced rationals is only beneficial if those operations are vastly more common than any other operation that has to use `.REDUCE-ME` as a result. I believe that assumption is too narrow in scope and in many cases is actually detrimental. First, if we remove this optimization, reduction would have to be done precisely once and only when it's needed. With the optimization, however, we have to go through `.REDUCE-ME` routine multiple times, even if we no reduction needs to be done. Thus, code like this… my $r := ½ + ½; my $ = $r.narrow for ^5000_000; …is 4.65x **SLOWER** when the optimization is in place than when it isn't. The impact is felt even in routines that don't have to call `.REDUCE-ME`, such as `.floor`: my $r := ½ + ½; my $ = $r.floor for ^5000_000; The above construct becomes 10% faster if we reduce the rational *before* going into the `for` loop, thanks to the fast-path on `$!denominator == 1` in the `.floor` routine. While that may seem trivial, `.floor` is actually used *multiple times* by each `.Str` call, and so this… my $r := ½ + ½; my $ = $r.Str for ^500_000; …becomes 15% faster if reduction is performed during addition. ------ As can be seen, even if all of the bugs and race conditions were addressed, the detrimental impact of this optimization is far-reaching, while the beneficial aspect is rather narrow. Certainly, an accounting software that sums up the totals of last month's thousands of purchases can benefit from `infix:<+>` not performing reduction, but is that that common case? Or would faster `.Str`, `.narrow`, and dozens of other methods be of more benefit to a multitude of programs in other domains. ### **I propose:** I propose we address the issues above by simply removing this optimization altogether. I've performed preliminary testing using a bench that calls all Rational methods enough times for each method's bench to run for 1 second. When running all the benches together (thus, having some GC runs), with **removed** `REDUCE_ME` optimization and a couple of new optimizations applied, I was able to get the bench to run **8% faster**. So, I think after this proposal is fully-implemented, we'll see some performance wins, not losses. ## 3) Fix bugs with operations on zero-denominator `Rational`s The bugs are largely due to numerators being arbitrary numbers, yet being computed as if they were normal Rationals. So `<3/0> - <5/0>` (`Inf - Inf`) ends up being `<-2/0>` (`-Inf`), but it must become a `<0/0>` (`NaN`). ### **I propose:** My primary proposal is for zero-denominator `Rational`s to be normalized to `<1/0>`, `<-1/0>`, and `<0/0>`. I think doing that alone will fix all the bugs in all the routines (tests that'll be written will show that). If it won't, the still-broken cases will be tweaked in specific routines on a case-by-case basis. My secondary proposal is to implement an essentially empty role `ZeroDenominatorRational` that will be used to tag zero-denominator `Rationals` and the ops that have special-handling for zero-denominator `Rationals` would move that handling into a separate multi candidate dispatched on that role. The hope here is to get a sizeable performance improvement by not having to do extra checks for zero-denominator Rationals in common operators. If it'll turn out the performance improvement this idea brings is insignificant, this proposal will not be implemented. rakudo-2018.03/docs/archive/constants-type-constraints-proposal-2018-02-10.md0000644000175000017500000001457213253717231024752 0ustar alexalex# Type Constraints on Constants *Feb. 10, 2018 proposal by Zoffix* # TABLE OF CONTENTS - [Type Constraints on Constants](#type-constraints-on-constants) - [General Spec of Behaviour](#general-spec-of-behaviour) - [Examples of behaviour](#examples-of-behaviour) - [Sigilless/`$`-sigiled constants](#sigilless-sigiled-constants) - [Behaviour with `@`-, `%`-, and `&`-sigiled constants](#behaviour-with-----and--sigiled-constants) - [`@`-sigiled constants](#-sigiled-constants) - [`%`-sigiled constants](#-sigiled-constants-1) - [`&`-sigiled constants](#-sigiled-constants-2) - [Deviations from Current Behaviour](#deviations-from-current-behaviour) ## General Spec of Behaviour * Constants bind initializer to them * Constants with `@` sigil * Typecheck initializer for `Positional` * When `.=` op is used, method is called on `List` type object * If initializer isn't positional, call `.cache` on it * Constants with `%` sigil * Typecheck initializer for `Associative` * When `.=` op is used, method is called on `Map` type object * If initializer isn't associative, call `.Map` on it * Constants with `&` sigil * Typecheck initializer for `Callable` * When `.=` op is used, method is called on `Callable` type object * If it isn't callable, throw * Default type of constants is `Mu` * Only `is export` trait is supported * `where` constraints are not supported ## Examples of behaviour *Note: the `.new()` calls shown in comments simply describe what the resultant object will be, NOT that any `.new()` calls will actually be made.* ## Sigilless/`$`-sigiled constants `foo` and `\foo` are equivalent. `$foo` is equivalent in behaviour, except that it defines a symbol with a `$` sigil. ```perl6 constant foo .= new; # Mu.new constant foo = 42; # Int.new(42) my Int constant foo = 42; # Int.new(42) my Int constant foo .=new: 42; # Int.new(42) ``` ```perl6 my Array[Numeric] constant foo .= new: 1, 2, 3; # Array[Numeric].new(1, 2, 3) foo.push: 42; # it's an Array, so this works ``` ## Behaviour with `@`-, `%`-, and `&`-sigiled constants Some cases don't have a clear and obvious meaning, as `constant @foo .=new: 1, 2, 3` makes a `List`, yet `my Numeric constant @foo .=new: 1, 2, 3` would have to make an `Array`, because `List` cannot be parametarized. So for them, I propose throwing a `X::ParametricConstant` exception, defined something like: ```perl6 my class X::ParametricConstant is Exception { has $.sigil; method message() { "Parametarization of {$!sigil}-sigiled constants is not supported.\n" # ~ "some helpful explanation of the alternative declarations" } } ``` ### `@`-sigiled constants ```perl6 constant @foo = 1, 2, 3; # List.new(1, 2, 3) constant @foo .=new: 1, 2, 3; # List.new(1, 2, 3) constant @foo = [1, 2, 3]; # Array.new(1, 2, 3) constant @foo .=new: [1, 2, 3]; # List.new(1, 2, 3) constant @foo = Array[Numeric].new: 1, 2, 3; # Array[Numeric].new(1, 2, 3) my Numeric constant @foo = 1, 2, 3; # throw X::ParametricConstant my Numeric constant @foo .=new: 1, 2, 3; # throw X::ParametricConstant my $foo := class Foo {}.new; constant @foo = $foo; # List.new(Foo.new) constant @foo = $foo,; # List.new(Foo.new) constant @foo = $foo, $foo; # List.new(Foo.new, Foo.new) class Bar does Positional {}.new; BEGIN my $bar-scalar = Bar.new; constant @foo = Bar.new; # Bar.new constant @foo = $bar-scalar; # Bar.new constant @foo = Bar.new,; # List.new(Bar.new) constant @foo = Bar.new, Bar.new; # List.new(Bar.new, Bar.new) ``` ### `%`-sigiled constants ```perl6 constant %foo = 1, 2, 3; # throw X::Hash::Store::OddNumber constant %foo = 1, 2, 3, 4; # Map.new((1 => 2, 3 => 4)) constant %foo = [1, 2, 3, 4]; # Map.new((1 => 2, 3 => 4)) constant %foo .=new: 1, 2, 3, 4; # Map.new((1 => 2, 3 => 4)) constant %foo = :42foo; # Pair.new(:key, :value(42)) constant %foo = :42foo, :70bar; # Map.new((:42foo, :70bar)) constant %foo = %(:42foo, :70bar); # Hash.new((:42foo, :70bar)) constant %foo .=new: :42foo; # Map.new((:42foo)) constant %foo .=new: :42foo, :70bar; # Map.new((:42foo, :70bar)) constant %foo .=new: %(:42foo, :70bar); # Map.new((:42foo, :70bar)) constant %foo = Hash[Numeric].new: 1, 2; # Hash[Numeric].new(1, 2) my Numeric constant %foo = 1, 2; # throw X::ParametricConstant my Numeric constant %foo .=new: 1, 2; # throw X::ParametricConstant class Foo {}.new; constant %foo = Foo.new; # throw X::Hash::Store::OddNumber constant %foo = Foo.new,; # throw X::Hash::Store::OddNumber constant %foo = Foo.new, Foo.new; # Map.new(Foo.new, Foo.new) class Bar does Associative {}.new; BEGIN my $bar-scalar = Bar.new; constant %foo = $bar; # Bar.new constant %foo = $bar-scalar; # Bar.new constant %foo = $bar,; # throw X::Hash::Store::OddNumber constant %foo = $bar, $bar; # Map.new(Bar.new, Bar.new) ``` ### `&`-sigiled constants Throwing `X::ParametricConstant` on these sigils makes less sense, but I propose we throw it anyway for consistency. ```perl6 my Numeric constant &foo = -> --> Numeric {}; # throw X::ParametricConstant my Numeric constant &foo .=new; # throw X::ParametricConstant constant &foo = &say; # binds &say to &foo ``` ## Deviations from Current Behaviour I'm dubious there are any spec tests actually covering it, but if there are, then the proposal is to implement the behaviour in 6.d language, instead. ```perl6 # (no spectests for this and it's already changed on master) constant foo .= new; # OLD: Any.new # NEW: Mu.new ``` ```perl6 constant %foo = :42foo, :70bar; # CURRENT: throws typecheck failure # PROPOSED: Map.new((:42foo, :70bar)) ``` That's all the deviation I can see. The rest of it either crashes: ``` m: constant @foo .=new: 1, 2, 3 rakudo-moar f559c6d8b: OUTPUT: «===SORRY!=== Error while compiling ␤An exception occurred while evaluating a constant␤at :1␤Exception details:␤ Cannot resolve caller new(Int: Int, Int); none of these signatures match:␤ (Int $: \value, *%_)␤ (In…» ``` Or silently fails: ``` m: my Int constant foo = 'not an Int'; say foo; rakudo-moar f559c6d8b: OUTPUT: «not an Int␤» ``` rakudo-2018.03/docs/ChangeLog0000644000175000017500000072460413253717231014343 0ustar alexalexNew in 2018.03: + SPECIAL NOTES: + Str.comb(Regex) was fixed to return a Seq instead of a List, making Str.comb always return a Seq. Code relying on the specifics of the previous behavior might require some tweaks. + Fixes: + Fixed various sleep() issues [e3c4db73] + Fixed <0/0> to be False [748d1a57] + Improved Test.pm6's like/unlike [7c1a6cac] + Fixed failure to sink last statements of `for` loops [4c5b81fe] + Removed unneeded candidates in &say and ¬e [3a0d53ce] + Made Str.comb(Regex) return a Seq [1da07530] + Fixed &say and ¬e to not auto-thread [b62e0eb7][355b2eb5] + Differentiated precomp NC sub setup markers [b27c548f][ec5edcae] + Moved chrs() logic to List.chrs and made chrs() the gateway [1894eace] + Moved ords() logic to Str.ords [61176475] + Fixed bug on ops with subclasses of Range [440fceac] + Fixed wrong assumption of Junction execution order [207313be] [89f33bbe][e9cff795] + Fixed cases of mis-scoped QAST::Block of regexes [fb882d49] + Fixed .grep(Regex) on Hyper/Race Seqs [5e462e12] + Fixed &dd to not mark Failures as handled [7773c3d5][65874b15] + Enabled native-int candidates in bitshift operators [29fdb75a][3d735975] + Made Int:D (elem) Range:D be independent of size of Range [de30c162] + Straightened up `$/` handling in Str.subst[-mutate] [874fcdda] + Fixed Metamodel shortname assignments [ce08683f] + Fixed Pair.clone [5031dab3] + Improved Pod::To::Text to indent tables [57af8b84][dffbd68a] + Fixed precomp files of NativeCall users having absolute paths [51c4d4d8] + Made sure `samewith`-using routines aren't inlined [e12e305a] + Made sure MERGESORT-* don't leak low-level types [511bec0a] + Fixed code generation bug affecting private methods calls in roles where the target private method used a role parameter [21997b62] + Various improvements to produced messages [a4f9090e][235d3f1c] [3b350739][5ae1bbe1][52176c3c] + Additions: + Implemented IO::CatHandle.handles [d5baa036][eb064922][639c6da0] + Made signal handlers cancellable [db010b84][a31579c7] + “datagram”-oriented API for UDP sockets [67f36e36][b406b320][dd2c9019] + Added support for replacement and strict setting in Buf.decode [0d796fb0] + Added support to Encoding::Decoder to use replacements [ea92f550] + Removals: + Removed no longer used DELETEKEY helper sub [6f2cbcf7] + Removed Range.clone-with-op [440fceac] + Efficiency: + Optimized Uni.list to reify 15x faster (on 10000-char str) [8b7385d8] + Made Str.perl 43x faster for some chars [ba6b84bd] + Optimized Str.perl by making uniprop(Int, Str) 2.7x faster [6ac56cc0] + Made Rational.Str 28% faster [008b9279] + Made internal RETURN-LIST sub faster for common case [3a4056bf] + Made Num.Bool 9x faster [2a42cdbb] + Nano-optimized supervisor thread sleep [4617976d][85ad0eba] + Added special cases for 2-tuple infix:<,> that are 10% faster [b6e5d7fc] [48c46fa7][90079357][ddf00078][d5a148c0] + Made Channel.receive/receive-nil-on-close 2.5% faster [4054ca68] + Reduced the number of DYNAMIC calls when hypering [598832cc] + Made Channel.poll 2x fast [eff92f94] + Made HyperIteratorBatcher.produce-batch 3.6x faster [8026cef8] + Many HyperToIterator speedups [0194ef46][6232d29e][34889beb] + Internal: + Turned many subs into multis [16b57af5][55bc053c][182b7ea5][63775474] [c2d0d3ac][cdb45fa5][4f473867][bf5e3357][5210d702][b704a175][4c67498f] [7d72387b][838782b7][abfbd1ab][6d6a69fd][c1d2a5bc][4da2418a][62fc3118] [d3f50dba][b9f40fea][dfef8283][9a0a7bdd][32b08035][51fccdfe][474c512c] [4f04698f][423e7cc0][ae4204c5][8cba0846][1b94ff6f][5490bacd][e1b711ae] [a23684f3][804c009a][f5b23a55][4513c279] + Marked many subs as “only” [1be26afb][25bedf88] + Marked set ops as “pure” on their proto only [af353894] + Made Unicode operators aliases of corresponding ASCII subs [254f477e] [aadd3c12][bc52fefa][a2100ec7][2e7a0e59] + Added nqp::getppid [fed92e3b] + Many profiler improvements, it now supports multi-threaded programs [fed92e3b][a5a6c778][dd2c9019] + Made substr() just a front for Str.substr [7835652d][b688a6f3][15ccfd33] + Made substr-rw() just a front for Str.substr-rw [038837f8] + Moved substr/substr-rw catcher methods from Any to Cool [aad79f8a] + Remote debug support on MoarVM [ffeff74e][e32bda21] New in 2018.02.1: + Fixes: + Fixed Whatever curry QAST::Block migration in stmt mods [5270471c] New in 2018.02: + Fixes: + Fixed `no worries` pragma [f5b4d89f] + Fixed IO::Socket::Async losing :$scheduler in .print-to [7c451514] + Fixed postconstraints in `my (...)` being ignored [3745eff1] + Fixed optimizer crashes in `map` with certain args [f3efe5e6] + Fixed IO::Handle.get on TTYs blocking after EOF [359efef7][af4dfe82] + Fixed crash with colonpaired variable declaration [a35cd4e6] + Fixed crashes in degenerate .tail(Callable) [ba675971] + Fixed crash in `temp`/`let` with parameterized hashes [0a32e51b] + Fixed Hash.clone and Array.clone losing descriptor [0d7c4fe8][45560ac9] + Fixed `let`/`temp` on hashes losing Nils [8c4c979e] + Fixed crash in Any.skip(Callable) [8efba3a8] + Fixed crashes with native types in conditionals [d1a48efc] + Fixed many issues with block migration in thunk gen [1ee89b54][31ab8683] + Fixed "No such method 'prefix'" when there's no HOME directory [b6a7d7f6] + Fixed buf8 punning happening at INIT time instead of BEGIN [c6cc673d] + Fixed type constraint in Str.split's Seq [8afd791c] + Fixed Iterator.Rotor when cycle contains Whatever or Inf [ba7b4571] + Fixed crash with ENTER nested inside LEAVE [58de239c] + Fixed wrong error in REPL with none Junctions [2c36ab2e] + Fixed semantics of :b quoter tweak [deffe54b] + Fixed error when throwing error during setting compilation [c820e4be] + Fixed crashes with compile time evaluation of Whatever curry [7c1f0b41] + Fixed crash in Proxy.perl [902f45f5] + Fixed encoding of ›˜œžŸ™š with windows-1252 (Latin) encoding [4507a565] + Fixed state vars in `do`-ed loops [299e8526] + Fixed whatever curry with regexes [d80fc376] + Fixed crashes with compile time evaluation of `where` thunks [95f23a56] + Fixed broken 2-arity sort of 2-el list [2e65de29] + Fixed postfix whatever curry with another curry inside [e8c6c259] + Fixed empty compiler version when the git repo has no tags [382024e6] + Fixed migration of in-regex blocks [c0c7756f] + Fixed missing decont in `cmp` [114e3735][25c5c488] + Fixed drift when reusing lazy iterables for indexing [f330d7fc] + Fixed crash in parameterized constraints on attrs with .= [562edfc5] + Fixed REPL adding empty lines to the history file [24fab707] + Fixed Parameter.usage-name to omit leading * and ! [3c73099c] + Fixed Any.tail(Callable) violating Iterator protocol [2cc7b631] + Fixed .perl of handled Failures [b2a21fa9] + Unified List.roll/pick invocant specification [311ef07f] + Fixed multi-threaded precompilation [ac87ea2a] + Fixed issues in constant type declarations [f559c6d8] + Fixed `if` with slurpies on its block [ef1d22f4][dfb6d951][59556c70] [4b7113fa][00af9ce2] + Improved SprintfHandler [d419afe4][4ac67e73][684b99ea][13406517] + Fixed unwanted curries with HyperWhatever type object [57a1aa7a] + Made Backtrace.gist more helpful [555db42a] + Fixed ($ = 42) vs ($ = "42").subst-mutate [e7af9a6a] + Fixed Cool.subst-mutate to only mutate if there's a match [61015526] + Made Str.subst-mutate always return a List on :g [77794a28] + Made Str.match(:x) consistently return a non-Slip List [829ea8e3] + Fixed return of multi-match options of Str.subst-mutate [e0d39321] + Fixed .Numeric/.Real on :U numerics and .Real on :D allomorphs [1dc1f038] + Various fixes for the JVM backend [a2499c90][1f223190][f2188e45] + Various improvements to produced messages [8ffbc43b][7f07f68f][34b3356f] [de2d8296][1c894e41][d419afe4] + Additions: + Added windows-1251 (Cyrillic) encoding to the list of possible encodings [c73cb78f][4507a565] + Added support for .= to init sigilless vars [8ba3c86e] + Added compile time LiteralType error for native vars [e930e253] [63a1d25a][30b82b98] + Efficiency: + Made `$ where Type1|Type2|Type…` typecheck ~8x faster [43b9c829][264a1a27] + Many compunit speedups [5bd33669][6fa1e78f][c268f55c][5be174bb] [b188cc82][838beab9][a9a9e1c9][00cde175][ed9b287c] + Made certain conditionals with natives 2.1x faster [d1a48efc] + Improved dynamic optimization of nativecast [3ed2fbd5] + Reduced startup overhead of file I/O and module loading [db1e067e] + Made `dispatch:` call up to 43x faster [ff31f0a3] + Shaved off 10ms when loading a native library [86e926c7] + Made compilation up to 6% faster (for 3000-line files) [f4732164] + Made Whatever currier up to 2.2x faster [752bb8b3] + Made list assignment with roll up to 20% faster [65d6fe48] + Moved `$*PERL` initialization to BEGIN time to save runtime [bdb4d34d] + Made Version.new 82x faster [02d2e2ca] + Added native `num` post-inc/dec to pre- optimization [4a5cc2c2][13e6ed8c] [888328ef][971d17c4] + Made `.=` up to 63x faster [abea3242][01237782][2ba7634c] New in 2018.01: + Fixes: + Fixed IO::CatHandle.read switching handles too soon [dc800d89] + Ensured &await can handle flattenable Iterables [1a4df4e1] + Made Array.gist limit output to 100 elements [08539c43] + Fixed .[count|bool]-only of combinations/permutations [5eed2b00] [cda4a4d7][2c27eeaa][d4f53ed5][19604c2d] + Made sure subclasses of List create consistent .WHICH [18557da9] + Fixed Range.pick/roll in light of degenerate Ranges [5c228333][55cb8f3d] + Fixed Whatever.ACCEPTS with Mu:U [89d85baa] + Fixed signatures that had Int when Int:D was meant [3e044dc7] + Guarded subbuf against negative ranges [24f4609e] + Fixed some export issues [38897d19] + Fixed Slip wrapping of quoteword with one word [ad684de3] + Fixed ±Inf/NaN Num to Rat conversions [042cb741][c91bcc2a] + Fixed USAGE with subsets/where and variables with quotes [27fbd7ab] + Fixed .gist dumping too much output in some cases [de21da30][53a85080] + Fixed crash in `eqv` with conted Versions [72ee58e2] + Fixed issues with smiley-ed coercers [a177fa99][8dcf9dac][3947a4c1][354a3848] + Made sure Rat calculation does not use type objects [9910b393][9adc58c3] + Fixed handling of type objects in Date.new [1d034df8][dfaa2282][038b1ea7] + Fixed CURFS/CURI .perl output [9cf2f998] + Made sure hashes are not interpolated in regexes [f719a471] + Fixed explosions when hypering over Buf [7ba50d86] + Made &dd more resilient to low-level stuff [99923747][d0be53a1] + Fixed .head/.tail to take any Callable [b4007070] + Fixed .skip with WhateverCode [d034cb58] + Fixed operator chaining with negated operators [ba111cfe][14c2cdb3] + Disallowed binding into a List [eed54cae] + Fixed `--optimize` flag propagation in EVAL code [e509c1a9] + Fixed RatStr .succ/.pred explosion [631875fc] + Fixed silent failure when binding to map keys [6a3db334] + Fixed R::I::Rotor calling .pull-one too many times [4a82b4b6] + Fixed `need` with versions [7537f899][0cdd82a2][0a73f19a][4d5e097a] + Fixed the lookup of many core symbols [efdbfeca] + Made .range consistently a Str in OutOfRange exceptions [90246e65] + Fixed superfluous parsing of ∞ [626991e0] + Fixed cf, sc, STerm, Upper, space and White_Space properties [49dce163] + Fixed many POD issues [14c28cae] + Various fixes for the JVM backend [4945dc40][4909430c][333efa0b] [00b7832a][70c57c3a][1e8c9762] + Various improvements to useless use warnings [d30e5b1e][c6b7012a] [64803b0a][ef2dc1b8][99da4a5a][00188757][e9c9dc46] + Various improvements to other produced messages [a04c6164][548dcf46] [6d65cf4f][51e0aa09][82dbada3][e543c890][0444a2c3][e5b4f37f][900c1b59] [96a3582c][5571d7f7][34160bf0][01ffd0f9][6a6470f9][e91159c5][5f7fdfdd] [f02606ce][cad66b72][79600d69][2dc93ac3][4ec5936c][ad60b947][732a25c3] [f8953ee8][ddbf07e8][fa136be2] + Additions: + Added Str.uniparse as an alias to Str.parse-names [2a8287cf] + Added Cool candidate for .is-prime [f01c50f1][23701966][b2b39bad][893d09ff] + Added compile time error for misplaced whenever in v6.d.PREVIEW [7672e34c] [0ec8e088] + Removals: + Removed deprecation fudge for native type instantiations [e0af68a0] + Removed :$CWD param in IO::Path.dir [b3e73b64] + Removed :$buffer param in IO::Handle.open [f415d61e] + Removed MONKEY BUSINESS env var [ac2e50c8] + Removed UInt64 (not to be confused with uint64) [cf154355] + Build system: + Fetch tags too to avoid potential missing tags [d93f8053] + Efficiency: + Made adding integers to Rats 22% faster [418fc068] + Made Blob.subbuf 1.8x faster [5f48c069] + Made `else`-less `if`/`with` blocks 3.4x faster in some cases [1815c368] + Made DateTime creation about 1.6x faster [36d71a39] + Made Date.new about 1.6x faster [b7170f83] + Made use of faster typechecks (7.5x faster) [4c9b84f8][8f71b0e0][10cd405f] + Made operator chains up to 2.4x faster [b77d8756] + Made `infix:` with bools up to 2x faster [f99943d3] + Made `infix:` with bools up to 16x faster [ca4fcaca] + Made |(1,2,3) xx 42 about 3x faster [014f1712] + Slightly speeded up adding of `whenever`s [7230b765] + Slightly optimized Array.ASSIGN-POS [6e13bfa2][86d91f2d] + Made `$a ~= "b"` 70% faster [5dd9ed10] + Made constraint checks Num/Int/Str literals 1.1x-10x faster [65d4876d] + Micro-opted exit_handler [0415bb5f][b5b6e23b][421504bd][21bc5916] + Performatized MetaAssign with MetaReverse [858b659f] + Made .sum on 2-element Lists about 30% faster [0af3f4d1] + Optimized `supply emit ` [81fe7b82] + Optimized Supply internals [32fbefab][9086f4c4][2548c2c5] + Improved first touch of Array/Hash variables [eeb3cc72] + Optimized more cases of private method calls [b6a236b9] + Tuned Lock::Async code stucture [f36a1f4e] + Special-cased one top-level whenever supply/react [e5f412d6][2192ddd1] [2dbc2bcb][e072474e] + Made Promise construction slightly faster [2ac1ceaa] + Assorted internal improvements to CPU/memory use [00797d07][2130c097] [7a3d9ce6][9c0db1cd][fbf432f9][4804003a][229b03fd][163f275b] [83a619ec][64de571b][773d2b9e][0dc4f731][cdb53afa] + Internal: + Introduced ValueObjAt, the .WHICH for value types [202459ce][4790587f] + Introduced Proc!set-status [7a4743be] New in 2017.12: + Fixes: + Various POD-related fixes [41514235][11d90cac][061c36d6][2cd266fe] [8ea7a46f][2c951798] + Fixed resolve of IO::Path for Windows [eed733e2] + Fixed ∖ op to do Hash→Mix conversion through Sets [eacf9b27] + Fixed incorrect attribute name in X::AdHoc.new [3166400d] + Fixed Supply.zip() to call `done` when some supply is `done` [1d0dae86] + Fixed Supply.throttle() when the source supply becomes `done` [c8370f21] + Fixed silent failures on invalid `is export` values [1668b4f0] + Fixed many cases of enum creation [d9021cf1][754664ed][65301756] + Fixed crash when using allomorphs as enum values [fc52143b] + Fixed <:Digit> to match digits correctly [0339b0f8] + Fixed some Telemetry.EXISTS-KEY issues [f3b1289f][91798547] + Fixed gut spillage in pseudopackages [cd24b1c5][a82e0e7d][1c7d15d7] + Fixed introspection on Mixins to Code:U objects [e31a414b] + Fixed let/temp to be able to take Mu [75229976] + Fixed autovivification container issues with `no strict` [e5b49ce3] + Fixed shaped array indexing to accept non-Ints [00632edb] + Fixed List.new to not create containers [d80df073] + Fixed incorrect .count-only/.bool-only implementation [af9812fa][0e228fab] + Made sure each Seq.skip gets a new Seq [854c10c2] + Moved attribute settage inside the lock [8df8ce09] + Made print/say/put/note handle junctions correctly [07616eff] [9de4a60e][8155c4b8][3405001d] + Fixed WhateverCode curries losing `use fatal` [31db3acc] + Various improvements to produced messages [d85585ea][9fd5042b] [c9699ab2][1da698ab] + Additions: + Implemented TR/// [f6958624][3d2fa915][8b27166f] + Implemented .toggle [694f534a][78caeb6b][ca7d0483][e7c0a644] + Consistified &[but] and &[does] with non-roles [575d31e2] + Added While/Until iterators [2c1a2860] + Added proper Supply.Seq method [aa3c2c5b] + Efficiency: + Made multi-needle split setup cheaper [5929887c] + Streamlined INDIRECT_NAME_LOOKUP a bit [76158136] + Made &[-]/&[+] with Rationals 30%-50% faster [6c299bf9] + Made DIVIDE-NUMBERS 6%-15% faster [78aeaf46] + Streamlined Hash.AT-KEY [6601da5c] + Streamlined Array.Slip.AT-POS like Hash.AT-KEY [fe8312b7] + Streamlined Array.AT-POS for better inlinability [af29a227] + Streamlined List.AT-POS a bit [9a2f5325] + Made Array.ASSIGN-POS about 1.7x faster [c5afc97e] + Made R:It:ReifiedArray 15% to 30% faster [a974de9b] + Streamlined Array.iterator.push-until-lazy a bit [ae02bc29] + Internal: + Abstracted prefix: logic into R:I [47f23fc6][126d7b55][6fb5c8c8] + Implemented Sequence.Numeric [6061f0bc] + Various improvements for the JVM backend [0a24efc3][f40c3818] [fbf7beca][928ada08][74a13ae1] + Added tests for previously resolved issues [20d67a3d][831dab14] [1b0be0f6][062c27f3][1101fea1][fed56be2][47552282][ced4af66] [d4ad6fa9][eaf609ed][04eb1da6] New in 2017.11: + SPECIAL NOTES: + Main development branch changed from “nom” to “master” [f40babb8] + Fixes: + Fixed Lock.protect to no longer leak Proxies [be9e19ef] + Fixed R:I:JSON to handle recursive Exceptions [3cba6204] + Fixed .perl output of an empty Set/SetHash [af3624d4] + Made some attribute defaults throw NYI instead of silently ignoring [9f54bc98][0973b307][6dab5aad] + Fixed quote lang cache regression [ad16c6fb] + Improved stability by always setting up `$*PID` [a1866b7b] + Implemented hypered nodality for all methodcall variations [3c4041ea] + Fixed combinations with * endpoints [bdc73563] + Made Range.sum sensible for -∞/∞ endpoints [5eeb72a9][21efe96f] + Made multi sub(:@c is copy) { } work [be1e2879] + Ensured CLOSE phasers have correct outer chain [96557571] + Fixed segfault on Bag.new.pick(1) [fe1f8632] + Improved handling of %b spacing sprintf [b2fbf893] + Made .head and .tail only take WhateverCode [5a29a0ce] + Moved signal() handling to the timer worker queue [1bc9936a] + Fixed default Encoding::alternative-names [2f0da94c] + Various improvements to warnings and error reporting [142c1d65][fff43fd7] [c9360203][497e0582][ad7c97df][88d67516] + Additions: + Channel can now be closed with sub close() [91543fe3][ef84aafc] + my %h is (Set|SetHash|Bag|BagHash|Mix|MixHash) now DWIM [1949a2bc] [6ac2b15c][aab2b983][b6a4d5b5] + Implemented metamethod shorthand syntax [5c96d554] + Kernel.cpu-cores returning the number of CPU cores available [61af87bc] + Kernel.cpu-usage exposed basic CPU usage information [c4d373c5] + Telemetry module providing an easy interface to system state reporting [cbd4f212][273168d7][3e175c83][7f154fe2][3dfaa2ae][59a59be8][52440486] [b30916f3][b30916f3][f7d21b5d][ae1f0fda][f72ad227][4b4429cc][58249a52] [f51a3efc][8a0eb7fa][bc00894f][e95b02f1][ccbfaaa0][2f963b14][c1867ba1] [8e4d3248][0a809698][824a5dc2][dcf3e28c][0bdda086][a2ae00ed][86d541f4] [474feb09][5e7dfe52][3b4f0c6c][7144dc29][73e1faaa][cf1742dc][91e00e68] [96751ee8][7e00908c][d21c31e1][0dc4a0eb][c2baf95e][e1a1b8d8][b380230d] [fccc7515][1c2c7d84][2f12bea1][4ed91ed6][fea5612c][360eb228][9344d35d] [d5fc6cbb][3e4ef2e0][4d21ad67][0f2f0cd3][22939bc8][77142fdb][ab03b54c] [fc9e7241][948a3fa4][f8e1a5fa][17db03eb][14e2016c][2dcefa1c][345fbf5a] [b80d486c][3e4ccce9][86e9f44a][f87d8ef8][5f4b61b1][e5912337][de961b81] [d6f1077d][ba49b343][1aa83a78][06cbe9c2][246f4101][d6a3a7a1][88a9cb25] [9381ffbc] + Efficiency: + Made .sum on native num arrays 11x faster [b849622e] + Made INITTIME a bit faster [e00f705d] + Made interpolation of variables into regexes a bit faster [6bca84fa] [c93dc9e6][fa8bc549] + Made Buf ~ Blob about 7x faster, Blob ~ Blob 1.8x faster [8b47adad] + OS thread exhaustion is now handled more gracefully [fe799a98][57374490] [14fbb5e7][6d8ed287] + Other more general ThreadPoolScheduler improvements [e513f19d][6ac53e42] [2cd568f9][6bf58921][6de66df7][6aa150db][09e038cd][a7972a0c][260e4a3a] [a9b8854a][09492179][6959349e][697e4ecf][b386963a][5d0ccf73][bfcc43ec] [87e87202][92543962] + Minor IterationBuffer improvements [c15e80de] + Internal: + ThreadPoolScheduler now keeping internal statistics, e.g. for Telemetry [2c84f77e] + Thread now keeping internal statistics, e.g. for Telemetry [68b2891d] [77048b6a][cb4d8b66] + Changed how Int.new gets rid of mixins [6cb7ebfb] + Normalized proto bodies [0edd0cc9][102fbd51] + Set no_inline when the dispatcher is needed [c1df0b1b][0ff32c7f] + Various JIT-related changes [3bd756f5][0a029db6] + Repository cleanup [028b7d22][5baede59][825a8b0d][6ec6f1eb] + Various improvements for the JVM backend [ac738b98][b2725c12][4849c733] [d6cd0d2f][8b24bf5c][38f51db9][581edd58] New in 2017.10: + SPECIAL NOTES: + This release includes fixes to || alternation in :ratchet mode. Code that was unintentionally relying on buggy behavior (backtracking in :ratchet mode) may now produce unwanted results (namely will fail to match) [963a0f06] + Security: + Restricted dynamic lookup metasyntax in rx EVAL [1d63dfd2][2448195d] + Deprecations: + Deprecated .new on native types [9d9c7f9c][cc6c0558] + Deprecated :buffer `open` arg in favor of :out-buffer [f9c10c21] + Fixes: + Fixed Hash.perl to include Scalar indicators [47d6c66e] + Fixed :delete with lazy Arrays [0385b2aa] + Fixed sanitization of on-demand Supplies [93a66d75] + Fixed duplicate done/quit messages [9e179355] + Fixed non-blocking `react { await blah() }` [29863a0b] + Fixed issues with Int.new [dff7d9b2][0d2ca0d7][0834036d] + Fixed isa method on a subset [cee1be22] + Fixed Supply.zip to eager-shift its values [f9400d9a] + Fixed two utf8-c8 bugs [963a0f06] + Fixed infinite loop in .^roles of a class that does Rational [0961abe8] + Changed uniname to give better strings for non-unique names [9dba498f] + Fixed .push-all/.skip-all on SlippyIterators [41896b7b] + Fixed and improved `**` regex quantifier [681d6be9][4ca1fc3c] + Made cmp-ok to try harder to give useful description [8479a1ba] + Made List.ACCEPTS non-fatal for lazy iterables [1b9638e2] + Fixed some unspace parsing cases [11070e0f] + Fixed &chdir failing to respect :CWD attribute [4906a1de] + Fixed Blob.gist to trim its guts to 100 elements [ac8e5f43] + Improved .perl and .gist methods on Maps and Hashes [aad8991e] [39461368][381c4c3b] + Fixed explosion in IO::CatHandle.nl-out [83008443] + Fixed .pick and .roll on object hashes [12fcece4] + Made cmp-ok take its arguments raw [3684384d] + Fixed `is default(Mu)` on attributes [54507ac9] + Made Array.List fill holes with Nil [e1351219] + Fixed BagHash.grab with large values [975fcf6c] + Fixed .tail with large values [43e7b893] + Improved .gist of nodal methods [b6982e68][bb1df2cb] + Fixed IO::Pipe.close not always returning the Proc [74328278] + Fixed handling of type objects in set operators [8a88d149] + Fixed location of errors coming from Channel [82a38c29] + Fixed lockup when scheduling with degenerate delays [df01ad97][031f8cf7] + Fixed segfault in getlexdyn [4f5fc520][4c370072] + Fixed poor error with some slurpies with defaults [a92950fb] + Fixed Int.new to properly give a new object [e4a5bb17] + Fixed .STORE leaving behind elements on native arrays [a85c8d48] + Various async improvements [633a15b8][ef4d16fe][f53d3963] [26a9c313][9d903408][0d600a0c][54783920][e0e5e6fa][b16aba01] [d8890a82][73aeee6c][2a826238][3deda842][f58ac999][40c2d0cd] [c46de00f][e5c17462][6e42b37e][80f883bc][6af44f8d][e70969e3] [30462d76][97b11edd] + Various fixes and improvements to hyper/race [cc2a0643][2352efe5] [d43b3738][dfa230f7][1fdc84fe][cef4806f][ea51d19b][374ee3e2] [ad0dd8e7][41729e93][d74ba041][83676112][2580a0a6][cf1673d9] [7e9b9633][870eaa31][d37a19ea][da977785][270e7c8a][ee3f0f4f] [a042fd92] + Various improvements to warnings and error reporting [38186fcd] [cf95ce81][66c2d05f][a845ac3d][48a84d6a][bb45791c][279bae08] [6542bb80][5747bc71][c7a82d45][fb7abf06][ac97a401][64b001a1] [1ea3297b][56eef696][25c87d0d][5d3ebc09][de2b9ff7][084078e1] [3acde358][b3bb8c40][e611978f][12774237][33e113a2][9554a97c] + Additions: + Improved .Capture semantics on all core types [4ba12ff1] [bad9fefd][cd5864cf] + Added trim* subroutines taking Cool instance [5a19dffa] [691f8b7b][e01e5bc3] + Added Lock::Async [53dd776c][4a8038c2][85bdd38a][38896402][6170cb9d] + Added atomic reference op support on JVM backend [32e4a1de][59c4117f] + Added $*USAGE [0b15f672] + Added :bin parameter to IO::Handle.slurp [e2ec569b] + Added support for Bufs in &EVAL/&EVALFILE [6c928d61] + Added warning on typical precedence errors with infix:<..> [26bdc95c] + Added --repl-mode command line option [9ce896d8][20518454] [5c7bbea0][93e599db][de0533c4] + Implemented typed pointer increment and array dereference [3ca6554f][bc5fbfcb][2fba0ba0] + Added X::Numeric::CannotConvert exception type [2e726528] [b377de1c][f04bd1d6] + Added IO::Handle.out-buffer for controlling the buffer size [f9c10c21][765dd694] + Added IO::Path.parent(Int) for getting up more than one level [7bea3a2d][78d8d509] + Removals: + Removed $*MAIN-ALLOW-NAMED-ANYWHERE [9cb4b167] + Removed support for ornate parenthesis from quoting constructs [9ce896d8] + Renamed $*INITTIME to $*INIT-INSTANT according to the spec [6bdb2dd3][bd6c6403] + Build system: + Reworked REPL tests [be4d57de][338a0972][7c8a2739][f8edb829][1ce3a36d] + Various changes related to v6.d prep [7d830d5c][6cb810d2][36bc8e2d] [31cbdada][16f64182][50d2013d][f62950dc][dd8a6102] [36122f15][2a512f0c][03b1febc][edce8f53][c6ff787a] + Efficiency: + Made startup time up to 5 ms faster [48406db6][a09f5f21][bb5583ae] + Made chained ops up to 36x faster [a92d0369] + Made ≥, ≤, and ≠ unicode ops as fast as ascii equivalents [6ec21cb4][1af2a745][43c348a8][9ff2f98f][6ad06fad] + Made &infix: with Version:Ds 7.2x faster [1d9553f0] + Made &DEPRECATED 27% faster when vfrom is too large [145e3156] + Made Blob.gist 26x faster [20a99fc3] + Made Hash.gist 24% faster [69af24c4] + Made @a[42..*] 4.2x faster [456358e3] + Various NativeCall speedups [a06ebaf2][269fe7db][80d6b425] + Significantly faster interpolation of variables into regexes [1761540e][0a68a18f][d73d500b][1775259a][e8003c87] [4d3ccd83][04b171bd][317ae16c][dd880cad][2262cc47] + Other small optimizations [9d4a833b][6902c590][fb4eb666] [b9c98531][4fae0711][921db910][c91c4011][98fae3d8] [a462d0a2][16c2a157][5f6896bd][397692ac][476741e7] + Internal: + New JIT [2724a851][ff063e7b] + Better scheduler [d2eb7423][80b49320][340d8ed3][c50d35a9][9af5607d] [683037be][7c18112c][c285b489][b5605c2d][3b98fb9e][596611c8] [6f6e62ea][176a6fae][43b7cfde][59bfa5ab][27590e8b][e95eb42c] [2c4868b8] + Added RAKUDO_SCHEDULER_DEBUG_STATUS env var [de311f46] + Bumped libuv to the latest version [198b8497] + Reworked BUILDALL method autogeneration [9837687d][63cf246f] [5ad2fffe][31a03a41][eb9c3d4d][346dfeff][70ca505a][af2ab751] [5cd9197f][6824e192][7363f898][4959df3f][dd943ede][d3c48185] [371befe8][4d0ead24][92f239b5][7fa707db][d76af6aa][e513b857] [f80a8461][fcbd8adb][21788c89][e2f8a57d][b58bd8fb][0dd6af71] [f946bd35][cef3bf3e][92e51c3d][5144216f][ebd6440c] New in 2017.09: + Fixes: + Fixed NativeCall signature check for unsupported native types [4077842c] + Fixed .made called on a Match on which .make was never called [5db5b1db] + Fixed flattening of a typed hash [6cec6b72] + Fixed iterator on pairs with Mu's [a5014fd0] + Fixed Supply.batch with non-int elems and elems == 1 [98f9fffe][7d1ece80] + Improved error message on nameless postfix `.::` [5969f21e] + Fixed ::("GLOBAL") [1f6a782c] + Refined merging of one() junctions [79604a88] + Fixed error message with leaking variable name in FailGoal [ed4f6cc9] + Implemented missing Instant.Instant [51709e01] + Fixed thread safety issues with signal introspection [1f411693] + Fixed thread safety issues in the `signal` sub [13b6a33c] + Fixed thread safety of "foo{$x}bar" [59454b03] + Made Bool.enums consistent with Enumeration.enums [e7a58806] + Fixed doubled path issue in IO::Notification.watch-path [2362dfd6] + Disabled interactive REPL for non-TTY input [b6a60236] + Fix ignoremark and casechange operations of graphemes which begin with Unicode Prepend characters [7f526c1e] + Suppress line number in X::Package::Stubbed [edac1d68][7ba9b7cd] + Fixed race condition in Channel awaiter [b30ac08a] + Fixed NYI compilation of NativeCall sigs with optional params [1818de98] + Fixed missing deconts in nqp::eqaddr() tests [880b33e2] + Fixed Enumeration:D === Enumeration:D [8d938461] + Fixed non-blocking await when holding locks [f26d1e24] + Fixed non-blocking await-all to respect Slip [a137c0de] + Additions: + Added support for Str operations with Junctions [753c9a5e][7cd153f4] [95a70ca3][0b19baf0][d2f31bb7][e18291e2][8b5d283c] + Added support for Unicode 10 [64dd94c2] + Added complete Unicode Collation Algorithm implementation [9b42484a] [5f335065][ec18efa0] + .collate/coll/unicmp operators are no longer experimental (Note: $*COLLATION dynamic variable is still experimental) [5f335065] + Added Thread.is-initial-thread method [59a2056a] + Added output buffering for non-TTYs [44680029][4b02b8aa] + Made temp and let on a Failure throw it [80a3255b] + Made sure that open files are properly closed on exit [3c9cfdba] [97853564][347da8e5][dd8d0d89] + Implement pred() and succ() for the Enumeration role [2645a1e9] [8d442a52][8df53f34][43e41ec6][55aa7f28][f925c648][69dae1f3][2ad51a0f] + Added isa method to SubsetHOW [0704cd97] + Build system: + Made t/harness* use 6 TEST_JOBS by default [8019c15b] + Added --ignore-errors option to Configure.pl [0bc1c877][1da075f9] + Fixed `make test` without `make install` first [fb0b3eb5] + Made Configure.pl refuse to work without ExtUtils::Command [3f4a9ffa] + Fixed non-installed gdb/valgrind runners [4e3f0fca] + Efficiency: + Knuth-Morris-Pratt string search has been implemented for string indexing operations (needles between 2 and 8192 in length) [593fa5f8] + 1.5-2x speedup of most string operations involving strands [5ebbc5ba] + 2.5x speedup for eq() for comparing two flat strings (1.7-2x for others) + 9x speedup when indexing with a needle one grapheme in length [8a215876] + Made `Any ~ Str` and `Str ~ Any` about 25% faster [815faa35] + Made index and eqat operations 2x faster [5ebbc5ba] + Made all(@a), none(@a), one(@a) about 9x faster [51c3d86c] + Various improvements to BUILDPLAN and BUILDALLPLAN [7da0c215][0ca5ffa4] [760530a5][80e069a4][2574f883][b706b843][963b28d1][532f7092] + Made object creation 25% faster in some cases [62fd5093] + Internal: + Simplified setting up auto-threading [8a0f6ac1] + Streamlined Junction .defined, .Bool, .ACCEPTS [e8137b45] + Added --no-merge option to t/harness5 to pass through STDERR [4af1d95c] [84b40cf5] + Various improvements to INTERPOLATE [215a5fa7][ea57cbec][c6aacafd] [47439e69][4c25df74][fc632cd8] + Some minor cleanup on R:I.FirstNThenSinkAll [9dbc3c50] + Fixed --ll-exception to give full thread backtrace [0877278e] + Various heap analyzer API changes [bfee5a1e] + Streamlined exit / END phaser handling [1adacc72] + Made junction optimizer only look at candidates [4de858a5] + Assortment of low-level improvements [cbce6721][8a215876] [9b42484a][a4ce97ca] New in 2017.08: + Security: + Removed '.' and 'blib' from nqp's default module search paths [7e403724] [a331c804][1eeb9434] + Fixes: + Fixed IO::Path.new with 0 allomorph [45cd1a97] + Fixed erroneous closing of standard handles in DESTROY [0e578c4f] + Fixed handling of already existing .moarvm files during install [02667bd8] + Fixed --ll-exception [559c9255] + Fixed native callbacks called from other threads [b81597bd][1d941643] + Fixes concat with combining codepoints and repetitions [1f7fa683] + Fixed TODO test handling inside TODOed subtests [5b77a8aa] + Fixed formatting of X::Numeric::DivideByZero [3f99d1d0] + Fixed potential concat issue [3028466c] + Fixed null handling in List.join [9b5cce0a] + Fixed handling of default values in Array [12d7d5b4][2fb8c725] [0970ba33][ccaa0665] + Fixed error message for postcircumfix [ ] called with a type object [1a74a8c3] + Made .unique|repeated|squish return containers if applicable [51e59eeb] + Fixed string comparison issues [0564891e] + Fixed is-lazy of iterators created with R:I.FromIndexes [4db23064] + Fixed pull-one of iterators created with R:I.MonotonicIndexes [0c19f549] + Fixed compiler explosion with import statement [3e078d4d] + Fixed is default() trait on Attributes [a7d2ad1d][148ba7f2] + Made sure to stop socket reader on close [21359560] + Fixed missing tap closes in `whenever` [59f4123e] + Fixed missing tap closes in Supply [c59b9867] + Fixed potential memory leak of supply/react [5fcce673] + Fixed Mix.roll with fractional weights [a91ad2da] + Fixed reproducibility of RAKUDO_MODULE_DEBUG output [ec7bc25c] + Fixed Pair.WHICH [4f1322d0][c229022c] + Fixed ignoremark issues [7b81f0f9][a3b95749] + Fixed bad assumption about methods being closures [231cb3f5] + Stopped hllizing and sinking the result of .+, .* and .= method calls [2b8115f0] + Fixed native shaped array index to return l-value [61e1f4d5] + Fixed handling of test descriptions with new lines [9303a6e4] + Fixed wrongful escaping of `# SKIP` TAP instruction [eb529f14] + Fixed returned exit code when running a MAIN script with --help [fcf61f7b] + Various improvements to produced messages [9b31d1f5][998535ed] [6d3ba60c][365a1d08][cff51ea1] + Additions: + Added Buf subbuf-rw method [d7af4aeb] + Added ACCEPTS method to Map to compare Maps [45ca084e] + Treat :ver<...> like a version instead of a string [247fc649] + Improved Version smart match with different lengths [01dbd874] + Added new peer/socket host/port values in async sockets [76af17a8] + Added .Complex coercion method to Cool [c9de2184] + Added atomic operations (⚛) [9b1e252a][92707fac][c67d7dd5][ca8aafc1] + Build system: + Added --libdir option to Configure.pl [e4d65ac9] + Fixed quotes for windows [90a0f2e0] + Added 'install' test target on appveyor [9c0d40ab] + Efficiency: + Made `$s (-) $s (-) $s` on a 26 elem set about 1.5x faster [d7fcb314] + Made .Str and .perl 2x faster, .gist 1.4x faster (on a ^100 .Set) [5b6cd406] + Made .Str 30% faster, .perl 2x faster (on a ^100 .Bag) [21b9a720] + Made string concatenation more efficient [1f7fa683] + Made Mixy.roll up to 2x faster [d3f260c9][e2ca1ffa] + Made Baggy.roll up to 1.5 faster [e548b743] + Made Baggy.roll(N) about 1.5x faster [752a3265] + Made List.roll(*) about 1.5x faster [b147217e] + Made .unique(:as) 3% faster [a636fa8f] + Made .unique(:with) about 4x faster [47d9bd9b] + Made .unique(:with(&[===])) about 20% faster [26789cc7] + Made .unique(:as,:with) about 12x faster [acf9f90d] + Made .repeated(:with) about 4x faster [d9056207][c3851aee] + Made .repeated(:as,:with) about 12x faster [a3a3d1a9][32ce4afd] + Made .pairup about 1.5x faster [8f73d77b] + Made .codes 350% faster for short strings [3c6277c7][e051dd2d][4eff4919] + Various improvements made by using `is default` on attributes [08f705b9] [d0419a0f][9f5686ec][c8c5c712][40d5b27d][fb5db592][413b7116][fbdbe6fb] + Made Map eqv Map about 10% faster [15b2596e] + Decreased the cost of Supply block teardown [5d200f1e] + Saved 2 method calls per NativeCall call [aca4b941] + Speeded up NativeCall by replacing the subroutine code in setup [46ef1b5b][9a0afcbc] + Speeded up NativeCall subs by compiling specialized subroutine body [cd7dc4ce] + Internal: + Introduced Mixy!total-positive [f49c49bb][ccf6da9e] + Set debug_names of DefiniteHOW and CoercionHOW types [b22d189e][c040f1a6] + Simplified `infix:<(+)>(**@p)` and `infix:<(.)>(**@p)` [d82db18f][a0775e5e] + Ensured Scalar fetch can never return a NULL [2f5a6cd9] + Changed RAW-KEYS to create iterator early [710fa800] + Made sure Setty at least has a R:I:IterationSet type object [2dd5963c] + Made R:I:Mappy roles also take IterationSets [ab08bd04] + Made Setty.values use R:I.Mappy-values directly [250ae102] + Made R:I:Mappy* roles use a more abstract name for low-level hash [b7953d0d] + Retired R:Q:Quanty in favor of R:I:Mappy [d9055e80] + Introduced R:Q.RAW-VALUES-MAP [923c32e6] + Simplified the .Seq coercer [5d89cef9] + Changed Baggy to no longer use HLL hash internally [fb7ecb60] + Changed Supply implementation to use iteration, not recursion [ed87f998] + Added tests for native int as index to CArray [6cc858a0] + Simplified Hash creation for auto-vivification [84d052a0] + Various spesh, JIT, GC and other improvements [86cb1363][8bed4a67] [9658dd98][c1e41f9f][f590863e][4561c269][947376e2][1455a03b] + Introduced R:I.TwoValues [20e93d89][50f0508f] + Fixed some issues with R:I.OneValue [3ad33469] + Streamlined the standard Seq methods on Pair [30584dac] New in 2017.07: + Deprecations: + Deprecate `(<+)` ≼ `(>+)` ≽ in favor of `(<=)` ⊆ `(>=)` ⊇ [35cc7c0e] + Fixes: + Fixed perl6-debug-m debugger [6d4691fb] + Fixed finding proper %?RESOURCES for non-lib CURFS [71ffb164] + Fixed Mixy (-) Mixy behaviour for missing keys [4a37de7b] + Fixed Mixy.Setty coercion [b31b159c] + Fixed .perl of empty Bag and Mix [f72c97cb] + Fixed crash on dotless version literals given to `use` [fe7ea124] + Fixed various coercion related issues with (-) [19a1caa3] + Fixed Baggy/Mixy (-) Any/Iterable [a2133dbc] + Made sure we catch lazy lists on right of (-) and (|) [62d54c75][c16334e5] + Fixed mix() (-) `.Mix` [c727462c] + Fixed multi-dispatch with numeric literals and native types [1c0ed61a] + Fixed enum.Real coercion [ad9ed1cb][c226b71a] + Fixed (:e).Bag|Mix coercion using a Bool as a weight instead of just Int [d765f186] + Fixed outstanding issues with coercions done by (+) [c7922f14] + Fixed a data race in Proc::Async [2a8d1e7c] + Fixed `(&)`'s handling of lazy lists [cb06ebac] + Made set ops properly handle lazy lists [04746490][3058ba0d] + Made sure unhandled failures don't coerce QuantHashy [43fc751b] + Fixed sprintf octal format with precision [d7e10466] + Fixed 'is export' on constants assigned to routines [d067abf4] + Fixed Deprecation.report case where "removed" is set and "from" isn't [1b6d048b][e20817fb] + Fixed crash in coercers used with sigilless vars [c76d9324] + Made sure IO::Socket passes a list to set-line-separators [a2090821] + Prioritized .pm6 extension over .pm when files with both extensions exist [e1e9091f] + Fixed SEGV in Proc::Async.new [f6d4fbd2] + Fixed a few edge cases of (^) wrt QuantHash type permutations [b3916926] + Fixed regression in Map intialized with `<...>` having writable containers [4894a75d] + Fixed overflow in uniprop lookups [4f5a1e20] + Made improvements to segmentation of Emoji w/ GCB=Other [4f5a1e20] + Fixed break after ZWJ for Emoji=True + GCB=Other [4f5a1e20] + Removed faulty Iterable (^) Iterable candidate [4c91b522] + Fixed faulty Map (^) Map candidate [8afbfe6f] + Fixed inconsistent semantics in `.Bag (<) .Bag` [4b8bc617] + Fixed unwanted de-Bool during optimization of some constructs [83e15701] + Fixed handling of actions in .refine_slang [c40a2122] + Fixed baggy semantics of Mix `(<)` Mix [a526d839] + Fixed semantics of `mix() (^) (a=>-42).Mix` [8d5f3324] + Fixed precomp deps left open when up-to-date check failed [37250ed5] + Properly implemented Baggy semantics for `(<=)` and `(<)` [4101581d][c6cc1a7a] + Fixed handling of `[(^)]` with absentee keys and Mixies correctly [0c02f93e] + Fixed faulty dynamic cache invalidation in continuations [d74ebd82] + Fixed issues with calling `infix:<⊖>` with more than 2 params [aee4a46c] + Fixed Proc :merge [c86090e3] + Made sure we call done/quit on all taps [32b72cda] + Ensured empty string PERL6LIB var does not get interpreted as `.` [075ddefa] + Fixed floating point noise in denominator of Rat literals [f6e25b54] + Fixed .getc and .readchars reading too much at EOF [80bbfcdd][49f555a2][f6279c34] + Fixed SEGV and memory leak in MoarVM that impacted parameter destructuring [f6279c34] + Made `exit()` coerce its argument to Int [caa9ef81] + Made IO::Handle.new coerce `:path` to IO [fec90956] + Various improvements to warnings and error reporting [bde28209][06379113][d5d3bd27] [d39f7b9a][1dda8622][d74ebd82][88acdbb7] + Additions: + Added full Unicode 9.0 and Emoji 4.0 text segmentation support [c40a2122] + Implemented tentative API for custom user encoder support [d0995f68][5ab4036e] + Implemented experimental buffering support in IO::Handle [86e7b2bd] + Collation object updated to work with new unicmp_s semantics [4da85879][47678077] + Allow getting native descriptor in Proc::Async [82301128] + Re-worked Proc so :in($p1.out) will plumb file descriptors [6dae179a][abfd7d95] + Added plumbing stdout/stderr to stdin in Proc::Async [11b02d2c] + Allow for "does Rational" and "does Rational[foo]" [41ed2c03] + Added `%*SUB-MAIN-OPTS` [40b0169d][da6c6584] + Implemented baggy semantics of `(<)` and `(<=)` [75797af3] + Added perl6-lldb-m for debugging MoarVM on the LLVM debugger [00dc4947] + Efficiency: + Made Baggy (-) Baggy about 100x faster [2a88c20c] + Made [(^)] Set, Set, Set about 35x times faster [0cdd6c25] + Made Setty (-) Setty at least 20x faster [10f840fc] + Made .BUILD/.TWEAK calls 15x faster when ther are no args to .new [43c1767b] + Made (Bag|Mix).WHICH about 8x faster [b2d2bf59][c585f370][d8c94353] + Made Map (+) Map between 3x and 6x faster [495fb5f8] + Made Baggy eqv Baggy upto 3.5x faster [49b1b03b] + Made Setty.ACCEPTS(Setty) about 3.5x faster [93d81d61][48c18f58][1ab4fd80] + Made Map.(Bag|Mix) 2.5x to 5x faster [72e5d614] + Made Setty eqv Setty between 2x and 3.5x faster [25047984] + Made Setty (-) Map between 2x and 3x faster [9936a3be] + Made Setty (-) Iterable about 3.5x faster [b66d8783] + Made Str.subst(Str,Str) upto 3x faster [327c8409] + Made Setty (+) Map about 2.5x faster [201a0bfb] + Made Any (-) Map|Iterable about 2x faster [e4f3358f] + Made Mix (+) Mix about 1.5x faster [d1838461] + Made Baggy (-) Baggy about 1.5x faster [36823ab1] + Made starting of installed scripts 46% faster [92f8abe0][4693ec86] + Made Baggy.keys about 40% faster [c65652d8] + Made Iterable (+) Iterable about 20% faster [38509227] + Made Setty (-) Setty about 20% faster [bacaa051] + Made internal nqp::index op used by many string operations 16% faster [4f5a1e20] + Made Setty.(Bag|Mix) about 5% faster [ae4c04ce] + Made Str:D (elem) Map 3%-10% faster [099a84b4] + Made Stash.AT-KEY a few percent faster [2ce5b678] + Gave Nil methods a much more efficient "take any args" signature [9a2127f2] + Made Exception messages created only when gisting [1a4d9493] + Made Any.tail() use iterator's .count-only if available [9c04dfc4] + Reduced cases when string concatenation needs renormalization [c40a2122] + Improve the speed of Unicode normalization [c40a2122] + Made all non-Texas set operators aliases where possible [f6025eb9] + Simplified `infix:<(|)>(**@)` candidate [46e009bf] + Fixed various VM errors in CallFrame. [e2ec7bdf] + Improved speed of `try` when exceptions are caught [1a4d9493] + Assorted internal improvements to CPU/memory use [3d2a521c][5a80412c][c4e14731][19be8722] [f03a176c][fff43337][f71cbed4][79ce1a99][640404fc][b4561229][30619e8d][9d14a724][a2a0d5c6] [66aef589][a95c70bd][d7e10466][73c3bcc6][7f109ed7][80b3e89b][05c255c1][2fb109f1][c0eeebde] New in 2017.06: + Fixes: + Fixed incorrect auto-boxing to native candidates in multi dispatch [ccfa5e51] + `^Inf .elems` now fails instead of returning Inf [20310d7d] + Made IO::Handle.print/.put signature consistent [613bdcf8] + Made sure that Setty:U is treated like any type object [ad8fa552] + Fixed behaviour of set() `(<)` X.Set [e6506bfd] + Made sure VM.osname always returns lowercase string [122aca1c] + Fixed List.Capture with non-Str-key Pairs [5b25836f] + Fixed inconsistency in .Int on zero-denominator Rats [6dbe85ed] + Fixed crash in smartmatch of non-Numerics with Numeric [43b03fc6] + Fixed occasional Windows file permission issues with installation of modules [8ec4dc5b] + Fixed crash in `X` operator used with empty List [9494cbd3] + Fixed spurious warnings/crash with certain `=para` Pod blocks [5e339345][807d30c2] + Fixed output of `CArray[Pointer].^shortname` [1ed284e2] + Fixed crash in Test.pm6's bail-out when used before tests [cb827606] + Fixed object Hash -> Set coercion failing to consider values [160de7e6] + Fixed Seq.perl for containerized Seqs [b22383fe] + Fixed Proc::Async.new not slurping first positional [92c187d2] + Fixed Proc::Async.kill failing to kill sometimes [99421d4c] + Fixed hang in deepmap with Iterable type objects [252dbf3a] + Fixed crash when Junctioning empty array after .elems'ing it [aa368421] + Fixed crashes/LTA errors in Junction.new w/wrong args [61ecfd51] + Fixed `infix:` calling .defined one too many times [77d3c546] + Made `fail` re-arm handled Failures given as arguments [64e898f9] + Fixed output of IO::Special.perl [7344a3d2] + Made IO::Handle.open with path '-'.IO properly handle non-default `$*OUT`/`$*ERR` [3755c0e7] + Fixed Promise.then to not lose dynamic variables [36bc4102] + Fixed allomorph smartmatching with Str values [8a0b7460] + Fixed IO::Path.extension with Range `:parts` when endpoints were excluded [8efffb1d] + Made coercion of lazy Iterable to Setty fail [211063c7] + Made Mixy/Baggy.new-from-pairs with a lazy Iterable fail [c9dfa840][e5719d6a] + Fixed byte.Range returning an incorrect range [af85d538] + Fixed edge-cases (e.g. Nan/Inf) in Mixy.roll [fb9e1a87] + Made sure that Mixy types only take Real values [7fa85682] + Fixed incorrect results in ignorecase+ignoremark regex matches [1ac7996a] + Fixed issues with `$*CWD` inside &indir when using relative paths [9151ebaa][326faed6] + Fixed crash with Seq:U.List [5c56e9e7] + Fixed various issues with Map `(<=)` Map [e1563a76] + Fixed various issues with Map `(<)` Map [b03d8044] + Fixed 4 cases of crashes with labeled `next` [3b67b4ac] + Made Proc.status/Numeric/Bool/exitcode/sink wait for Proc to be done [e4468c61] + Fixed Pair.perl with type-object components [c6b03c45] + Fixed bad shell quoting in Proc::Async on Windows [e9b30933] + Fixed crash when RAKUDO_MODULE_DEBUG was set to a non-numeric value [96e6b338] + Fixed Kernel.signals on OpenBSD [9435c14e] + Various improvements to warnings and error reporting [1c16bf2e][85bef661][e22508d4] [b6694bd0][ec51e73f][f2fca0c8][f9403b3b][86fe766a][c81b7a4b][7cf01296][fb7dd8a4] [7783fcab][9bf3ea3a][02614f64][e538cbc5][86c3d7aa][c2497234][b0a1b6c3][97298aca] [69b1b6c8][5e037736][e824266f] + Additions: + Implemented IO::CatHandle [5227828a] + Implemented support for merged STDOUT/ERR output Proc and Proc::Async [ac31c5df][05d8b883] + Implemented Complex.cis [a243063c] + Implemented Failure.self [0a100825] + Implemented Any.Seq [5c56e9e7] + Improved consistently to have .Supply on a type object it as Supply [52d39576] + Slightly changed IO::Handle.encoding; Nil now means 'bin' [95b4e5d5][27f09e9d][9c0362cb][51c73ba0] + Gave `(<=)` Baggy and Mixy semantics for Bags/Mixes [b1d83f9d] + Makde `use lib` accept IO::Path objects [3ff29d42] + Added IO::Socket.nl-out attribute [12d31e36] + Added Setty.pickpairs [e3695b16] + Added Str type constraints to IO::Spec::Win32 .join and .catpath [232cf190] + Made it possible to call &prompt with no args [0646d3fa] + Made IO::Socket::INET update localport if it binds on port 0 [bc98e671] + Improved support for Unicode properties `Prepend` and `Regional Indicator` [56e71d59] + Gave IO::Handle.read default value for size arg [b7150ae1][aa9516be] + Added default output for Mu.WHY [23d6d42d][cc4d9091] + Added support for binding to standard handles in Proc::Async [6b2967d7] + [JVM] Implemented Proc::Async [5154b620] + Removals: + Removed TAP.pm6 from core. Available as `TAP::Harness` in the ecosystem [ae891f93] + Removed all methods from IO::ArgFiles and made it a subclass of IO::CatHandle [f539a624] + Removed IO::Socket::INET.ins [75693b0b] + Removed NYI IO::Socket.poll method [cb404c43] + Efficiency: + Made Any (elem) Iterable:D between 1.3x and 110x faster [e65800a8] + Made `(<=)` and `(>=)` about 50x faster [32eb285f] + Made IO::Spec::Win32.catpath 47x faster [7d6fa739] + Made `(<)` and `(>)` about 40x faster [431ed4e3] + Made IO::Spec::Win32.join 26x faster [494659a1] + Made IO::Spec::Win32.splitdir 25x faster [2816ef71] + Made Map `(<=)` Map about 15x faster [0cb4df44] + Made Map `(<)` Map about 15x faster [f6f54dcf] + Made Str.subst(Str) without :g 14x faster [0331fb9d] + Made Setty.roll about 11x faster [e6192ca8] + Made IO::Spec::Unix.splitdir 7.7x faster [6ca702fa] + Made invocation of Proc.spawn and &run 4.6x faster [93524fb9] + Made SetHash.grab(N) about 3.5x faster [67292a1e] + Made SetHash.grabpairs(N) about 3.5x faster [0e9ee0d1] + Made invocation of Blob.decode() 2.7x faster [222b4083] + Made Baggy/Mixy.(hash|Hash) about 2.5x as fast (on a 26 elem Bag/Mix) [06cd0bc3] + Made Setty.roll(N) about 2x faster [18dd0741] + Made Setty.pick about 2x faster [10e9c8ba] + Made Set.new(@a) about 2x faster [b55a0f16] + Made Baggy.new(@a) about 2x faster [11f27a30] + Made SetHash.grab about 1.8x faster [d28540be] + Made Str:D (elem) Map:D 1.3x faster [b43303f2] + Made `$*KERNEL.signal` 64% faster, overall [79b8ab9d][01d948d2] + Made Iterable.Bag about 60% faster [f2876281] + Made Iterable.Mix(|Hash) about 40% faster [bba6de5f] + Made Setty.pick(N) about 30% faster [071c88cb] + Made StrDistance 25% faster [2e041b06][9185fa2c] + Made (Bag|Mix).AT-KEY about 10% faster [b43db636] + Made `infix:<∉>` about 10% faster [abfb52be] + Made Str.starts-with 8% faster [7ecb59dc] + Made .Set, .Bag, and .Mix coercers a few percent faster [8791b447][4139b96e][8c7e4e51] + Fixed lost optimization of for ^N {}; now its 3x faster [46b11f54] + Made &DYNAMIC about 1% faster [74242e55] + Made ^Inf marginally faster [446dc190] + Assorted internal improvements to CPU/memory use [2efd812c][07bff0e5][1369632f][2ac120ce] [539415cf][5ebf307a][ed07b2c3][0104a439][a91a2e4d][bd292225][8ff980e7][7edf9da6][241d2925] [7e8bac9b][3363c7b9][6f932687][e9b30933][51b63bf9][57553386][1171e67e] + Internal: + Refactored handle encoding. Non-binary read methods now throw when used on handles in binary mode [41bb1372][b3cd299e] + Refactored socket encoding [8ee383e3] + Made syncronous IO to not use libuv [05f3e9a0] + Made syncronous sockets to not use libuv [6f202fbe] + Moved encoding and line ending bits to IO::Socket [d6fd2491] + Moved get and lines to IO::Socket role [9cec9408] + IO::Path.Int method removed; handled by Cool.Int now [d13d9c2e] + Re-implemented Proc in terms of Proc::Async [ac31c5df] New in 2017.05: + Fixes: + Made Promise subclass-friendly [a61746fe][a7c23aa2] + Fixed unwanted warnings on Windows with `$*HOME` [4ae7c697] + Fixed handling of `<1` and NaN in Baggy.pick/.roll [40e4e132][e5d2c6f6] + Fixed NaN and empty Baggy handling with Baggy.pick/.(pick|grab)pairs [abc0509c][22ba2317][22ba2317][44c89ed9] + Fixed SetHash.(iterator|values|kv) to have same semantics as (Bag|Mix)Hashes [e5b5d346][e9ae0047] + Fixed off-by-one in `lines` routines when `:close` is given [bf399380] + Fixed `$*CWD` inside IO::Path.dir's :test Callable [b2a64a13] + Fixed regression with IO::Handle.close's value sunked in .slurp [84eb3599] + Made spaces and quotes escaped in MAIN() usage message [22bd2bbd] + Fixed dispatch hang in Str.match: Nil [1c21974d] + Made &slurp/&spurt/&get/&getc/&close `fail` instead of throwing [6fa4bbcb] + Made &lines/&words/&slurp/&spurt/&get/&getc/&close pass all of the given arguments to the methods they use [6fa4bbcb][34b58d1b] + Fixed handling of 8 digit hex literals in 32-bit systems [01dd2138] + Fixed $?BITS on 32-bit systems [d057efdb] + Fixed time stamp check interfering with packaging modules [ff4a034d] + Made perl6 usage message print to STDERR instead of STDOUT when an invalid cmd line option is used [2a6d3d1e] + Made sure Setty (^) Setty always returns a Set [4e37e7c5] + Fixed typed optional Array and Hash parameters [9f5c8e94][6231ecb0] + Made `$*HOME` default to Nil, not Any [7412184f] + Fixed crash on ^D to `$*IN` when reading with IO::ArgFiles [4b8fd4a4] + Fixed REPL crash when `$*HOME` is not set [1b0e41f9] + Fixed Test.pm6's &like crash when a non-Str is passed [ba3cf4e5] + Fixed Seq.perl for cached Seqs [54f50956] + Fixed crash in `eqv`, .iterator, .Slip, .join, .List, .list, .eager, .Array, .is-lazy, and .sink on cached Seqs [400f4ec8][c13d89b3] + Fixed role mixins with native attrs with defaults [6179ab34] + Fixed `andthen`-`orelse` chaining [37316f82][e1994d94][1ed76a90] + Fixed issues when `Empty` passed as arg to `andthen`/`notandthen` or postfix `with`/`without` [3c8822e8][e1994d94][1ed76a90][fdb2b2ab] + Fixed error in Iterable (+) Iterable if the Iterable contained Pairs [3d99321f] + Fixed .perl for IO::Path and subclasses [134efd83] + Fixed .IO on :U of IO::Path subclasses [69320e7f] + Fixed SetHash retaining the containers [551b8a69] + Fixed (Bag|Mix)Hash.values/.iterator/.pairs/.kv failing to check validity of assigned values [c1bd844e][0e0ac2fb][0338ce46][14e09532][c61c7f88] + Fixed 'ambiguous call' error in `eqv` and `cmp` with mixed allomorphs [e5870c11] + Fixed IO::Path.copy/move when source/target are same [08a8075f] + Fixed premature deletion of bin wrappers [c7aef59a] + Fixed ghost elements remaining when popping off an Array [c776c087] + Fixed rotate on empty list [b5c14bd1] + Fixed hang in .join/.gist in certain cases of flat slurpy positional arg [5e6b3878] + Fixed Str.comb(Int, $limit) for `<1` combers [a9959666] + Fixed Str.comb with empty-string comber [aa711c14] + Fixed unwanted split on read-chunk-size boundaries in IO::Handle.comb/.split by making them .slurp the entire file [973338a6] + Fixed crash in BagHash.pickpairs when given negative arguments [08b5c101] + Fixed incorrect results in `+>` for large negative numbers [ef29bb9f][66e8e72c] + Fixed is-deeply for Junction args [1c4d8451][dc5eece9] + Fixed crash in is-deeply when Seq type objects are given [f3f99b3a] + Fixed dispatch infiniloop in (elem) and (cont) [407bce1d] + Fixed issues with combiners on `/` in IO::Spec::Unix.is-absolute [f4309de9] + Fixed issues with combiners on `/` in IO::Spec::Win32.rel2abs [c96727aa] + Fixed crash when setting .nl-in/.encoding on unopened IO::Handle [06d8800e][70038855] + Made IO::Handle.open respect attribute values [95e49dcb] + Made IO::Path.parts a Map instead of Hash [9021a486] + Made IO::Spec::Unix.path consistently return a Seq in all cases [05479793] + Fixed IO::Spec::Win32.path failing to flatten resultant Seq [8992af13][816b2d4b] + Fixed IO::Handle.perl.EVAL round-trip [a282b8c8] + Made IO::Path.resolve set CWD to $!SPEC.dir-sep [a4127884] + Fixed unwanted padding Nils from Str.words($limit) [4bcf84a2] + Various improvements to warnings and error reporting [9962d2b6][9ed89d94][d87de586][6d28d788][8511081f][4f9fa6b0][12cec7a7][d1a81b30] [85c54db8][fc5698bd][1cf7ccba][0bd39de2][12c50b63] + Additions: + Made user grammars work more like real classes [db42d62f] + Loading deps no longer uses file timestamps [ca0a7439] + Changed type constraint on &slurp/&dir from Cool:D to IO() [6fa4bbcb][d0cd1372] + Added IO::Handle candidate for &spurt [6fa4bbcb] + Added Pair.Pair method [bd9e5730] + Added Seq.Capture method (makes it possible to unpack Seqs in signatures) [98e137b1] + Added QuantHash.Capture [5e74017d] + Made `(^)`, `(+)`, `(.)` multis [8b8f66c0][44893e6a][48ce8701] + Added primary and foreign key constraints and renamed some fields in profiler's SQL output [c776c087] + Added WhateverCode candidates to Map.roll and (Bag|Mix)Hash.grabpairs [1e58925c][2bda2703] + Made Baggy.roll/.pick/.grab Int-ify their $count arguments [31be5128] + Added big int support for `+<` and `+>` ops [6409ee58][ef29bb9f][66e8e72c] + Made Date.clone take a formatter [a9a161ae] + Added `$*DISTRO` and `$*KERNEL` information to `perl6 -V` output [94c4e7bf][b6496eda] + Made `perl6 -V` sort its output [85230d06] + Added support for `$*KERNEL.archname` [0c46aff2] + Added `$*PERL.compiler.verbose-config` [85230d06][c3b47280] + Added typed exceptions to IO::Handle.flush [b43ed18f] + Added support for building the dist in install-dist.pl [4298dd5e] + Simplified getting osname from VM.config [7c8f8d3e][18706852] + Added VM.osname as a rough equivalent to Perl 5's `$^O` [e79d7498][505ee33d] + Now show `System::Info` information with -V if module is installed [5feb3906][541597b8] + Made IO::Handle.encoding settable via .new [7e9496dd] + Added Proc::Async.ready [d76206e7] + Implemented $limit arg for IO::Handle.words [84502dc2] + Removals: + Removed IO::Handle.iterator that existed for a couple of releases [eb8d006e] + Removed unspecced Seq.is-ready method [59f6f485] + Removed broken Exception.resumable method [f2af3db1] + Removed argument forwarding from Instant.DateTime coercer [6bb1b5b4] + Removed IO::Path.dir's :absolute and :Str arguments [aa72bdef] + Removed .tell info in IO::Handle.gist [276d4a7e] + Removed `:directory` from Map returned by `IO::Spec::*.split` [6ed14ef6] + Efficiency: + Made Mixy (^) Mixy about 150x faster [9f0b1218][bea8ac68] + Made Baggy (^) Baggy about 150x faster [ee459360] + Made IO::Spec::Win32.is-absolute about 63x faster [c6fd7361] + Made Map (^) Map about 50x faster [13924397] + Made Setty (+) Setty about 45x faster [14568496] + Made Baggy (+) Baggy about 50x faster [ab5cd11b] + Made Mixy (+) Mixy about 45x faster [92df7d5c] + Made Setty (.) Setty about 35x faster [1562da07] + Made Baggy (.) Baggy about 35x faster [3f97831d] + Made Mixy (.) Mixy about 35x faster [226cd8b6] + Made IO::Spec::Win32.path 26x faster [8992af13][816b2d4b] + Made IO::Spec::Cygwin.is-absolute 21x faster [48cf0e67] + Made Setty (^) Setty about 20x faster [d92a2123] + Made Iterable (+) Iterable about 18x faster [6de08933] + Made Map.pick()/roll() about 7x faster [2fb6872b] + Made Baggy.pickpairs about 5x faster [c0270c66] + Made IO::Spec::Unix.path 4.6x faster [05479793] + Made (Bag|Mix)Hash.grabpairs/.grabpairs(N) about 4x faster [911b43de][3670720a] + Made Str.words/.lines with $limit arg lazy and up to 3.6x faster [4bcf84a2] + Made Iterable (^) Iterable about 3.5x faster [b2332816] + Made Map.roll(N) up to 3x faster [c74d37ba] + Made Mixy.roll(N) about 3x faster [b9222061] + Made IO::Spec::Unix.rel2abs 2.9x faster [277b6e5b] + Made Map (+) Map about 2.5x faster [a85b654d] + Made Map (.) Map about 2.5x faster [9c9ebd0b] + Made Iterable (.) Iterable 2.5x faster [3d99321f] + Made Mix.roll() about 2.5x faster [a2602b9c] + Made `notandthen` and postfix `without` 2.5x faster [fdb2b2ab] + Made `andthen` and postfix `with` 2.5x faster [3c8822e8] + Made `orelse` 2.4x faster [37316f82] + Made IO::Path.is-relative about 2.1x faster [ff23416b] + Made Baggy.pickpairs(N) about 2x faster [0f21f511] + Made 1-arg IO::Handle.say up to 2x faster [76af5367] + Made BagHash.roll 1.7x faster [07feca67] + Made MixHash.total 1.4x faster [5e459bce][4c813666] + Made IO::Spec::Win32.split about 82% faster [894ba82d] + Made IO::Path.is-absolute about 80% faster [74680d44] + Made `&say(**@args)` up to 70% faster [204ea59b] + Made `&put(**@args)` up to 70% faster [6d7fc8e6] + Made `+>` about 55% faster [ef29bb9f] + Made `<+` about 12% faster [6409ee58] + Made IO::Spec::Unix.join about 40% faster [d2726676] + Made IO::Handle.put($x) about 5%-35% faster [50429b13] + Made BagHash.grab 30% faster [2df7060c] + Made IO::Path.dir up to 23% faster [aa72bdef] + Made Baggy.roll about 15% faster [9e7d0b36] + Made BagHash.grab(N) about 10% faster [87a95fc1] + Made Baggy.EXISTS-KEY about 8% faster [451a2380] + Made List.AT-POS about 5% faster for common path [736be4d4] + Made IO::Spec::Win32.rel2abs 6% faster [c96727aa] + Made Hash.EXISTS-KEY about 1% faster [eb1ce414] + Micro-optimized reg/init dynamic [1d6a0023] + Speeded up module loading a bit by persisting source checksum [3829488f] + Assorted internal improvements to CPU/memory use [89f2ae4f][3c7cd933][aa23a91f] [7c531835][ccedd6b1][3dc08553][514124e3][146f3a39][9cb26c09][afd24a88][f2fc5674] [6641df83][d6cf518c][f18d0dc0][1a920dcc][bdb5391b][b1fbd133][7404c706][762fd239] [fec547a1][5ec8a464][8088f080][45305eca][e7087f29][f4017c32][3f7d1334][6ea2f12e] [788e6de6][3fb3c27e][09506dc8] New in 2017.04.3: + Fixes: + Fix REPL history file failure with Linoise on [6c66c1b88c] + Fix `)>` to work whenever .MATCH is called [2f143f476d][0150c7b8c5] + Fixed issues with false positive case-insensitive regex matches when only start of string and end of string match [f756b4b54f][25048824c8] New in 2017.04.2: + Fixes: + Fix "Cannot invoke this object (REPR: Null; VMNull)" [4a560aa] + Improve relations between %?RESOURCES and Native trait [647abfe] + Support all appropriate IO::Path methods on Distribution::Resources [f4f1c42] New in 2017.04.1: + Fixes: + Removed unwanted debugging output [c9ebfc20] + Reverted 9d8e391 IO::Path.resolve fix for JVM, as it does not yet know how to do utf8-c8 decode [88a6facc] New in 2017.04 + SPECIAL NOTES: + There are two Upgrade Notifications for this release: - Part 1: http://rakudo.org/2017/04/02/upgrade - Part 2: http://rakudo.org/2017/04/03/part-2 - Part 3: http://rakudo.org/2017/04/17/final-notes + Changes for Texas operators listed in this release also apply to their fancy Unicode alternatives. https://docs.perl6.org/language/unicode_texas.html + Fixes: + Fixed infinite loop due to wrong args in many Cool methods [8c88b0c] + Fixed failure to distinguish rw args in Capture.WHICH [4605d52] + Fixed regression in .rotor with negative gaps [5917b81] + Fixed a 1-arg-no-phasers path in .map stopping after 1 value [86dc997] + Fixed containerization issues in listinfix metaops [16f950b] + Fixed Inline::Perl5 detection in t/harness6 [b15cd20] + Fixed incorrect number of tests run in t/harness6 [8766370] + Fixed t/harness5 incorrectly failing NOTESTS runs [f28c515] + Fixed crash in S/// and s/// for some combinations of adverbs [43e0902] + Fixed crash when doing EVAL from multiple threads [218f8c4] + Fixed errors in concatenations of Hangul script with \r\n in it [a123eb3] + Fixed case insensitive string compare with synthetics in haystack [e87179d] + Fixed case insensitive regex with synthetics [666ce35] + Fixed issues with foreign lang cursor without a name [ffeb896] + Fixed introspection of attributes with explicitly typed keys [a6ba994] + Fixed spurious warnings in define_slang [666ce35] + Fixed issues in :exists with multidimensional hash slice lookup [a758c0b] + Fixed unwanted overflow when too-large values were *assigned* to native attributes [666ce35] + Fixed failure to set $/ by matching routines when used in loops [a62b221] + Fixed handling of Baggy (|) Mixy, Mixy (|) Baggy in dispatch [48619f8] + Fixed Allocations tab in --profile output [c16cdb2c] + Made `is equiv` to not propagate operator's `assoc` value [f9f0883] + Made Code.ACCEPTS pass take its parameter `is raw` [c0eb9bd] + Fixed SEGV in IO::Pipe.t [3e275dd] + Made `dynamic` default to False instead of Nil on Scalar/Hash/Array [28a6e80] + [IO] Fixed wrong results in IO::Path.resolve for paths with combiners on `/` [9d8e391] + [IO] Fixed a crash when using Whatever limit in in IO::Pipe.lines [0c62815] + [IO] Fixed crash in smartmatch of Cool ~~ IO::Path for some Cools [c360ac2] + [IO] Made IO::Path:: subclasses instantiate a subclass, not IO::Path [a0b82ed] + [IO] Fixed crash when very large files were read with IO::Path.slurp [d0924f1] + [IO] Ensured IO::Handle.Str coerced .path to Str [1f689a9] + [IO] Fixed crash when binary slurping large files with &slurp/IO::Path.slurp [756877e] + [IO] Fixed occasional zero byte read when binary slurping files [756877e] + [IO] IO::Handle.symlink/.link now take name of the link as argument; the invocant is the target [8c09c84] + Various improvements to warnings and error reporting [6a77cda][d90c6bf][f9968b3] [27f5469][41ac4b4][75c3f29][87fe800][7ba2fc5][093bb89][d3c93ad][6ee71c2][490ffd1][7112a08] + Additions: + Gave `Thread` a numeric representation [e5528dd] + Made Any.maxpairs/.minpairs use `cmp` and return Seq [5927186] + Made `Parameter` object available in bind error [0f9f000] + Added typed exception for parameter constraint failure [f1cd8e3] + Allowed nativesize to be unset in NativeHOW, but still compose [af4aae2][932b59f] + Made sure that Baggy and Setty handle bare objects [7433947][e660a57] + Added experimental coverage reporter tool with MoarVM backend (so far works with reports for core code; more work needed to expand for wider use) [932b59f][d0924f1] + Made it possible to assign to system dynamic vars on initialization [1b9d53c] + Broadened acceptance in `(<+)`/`(>+)`: all Quanthashes can be considered Settys and all Baggys can be considered Mixys [1ebeeb3] + Implemented `skip-all` option in &plan in Test.pm [14b6d5f] + Made it possible to use `.head(*-N)` (all but last N) [1fea495] + Made it possible to use `.tail(*-N)` (all but first N) [188b7b1] + Allowed `*` and `Inf` args to Array|List.tail [1b34ea6] + Made .Set, .SetHash, .Mix, .MixHash, .Bag, and .BagHash nodal [189615c][3e412b9][7025050] + Made `infix:<(&)>` a multi and added basic candidates [e8cb9a2] + Made `(-)` a multi [495f970] + Added default descriptions for Test.pm's `like`, `unlike`, and `use-ok` [4b915f7] + Made `is rw` on optional params throw a typed exception instead of generic one [8370675] + Made it possible to pass IO::Path to `is native` trait [9984080] + Implemented bypass of dependency resolution in the Staging repo via RAKUDO_RERESOLVE_DEPENDENCIES env var [5b862a3][d4d6a99][2a0a2d3] + Merged Cursor into Match; in preparation of for future removal of Cursor [b7c036c][cdd625b] + [IO] Added more powerful features to IO::Path.extension [b1e7a01][15a25da] + [IO] Added IO::Path.add [40217ed][0b5a41b] + [IO] Implemented IO::Path.sibling [8bacad8] + [IO] Implemented IO::Handle.lock [214198b] + [IO] Made IO::Path throw when path contains NUL byte [e681498] + [IO] Implemented `:completely` param in IO::Path.resolve [6a8d63d][51e4629] + [IO] Implemented IO::Handle.slurp [f1b4af7] + [IO] Made IO::Path.dir a `multi` method [fbe7ace] + [IO] `$*TMPDIR` now has a container, so it's possible to `temp` it [b62d1a7] + [IO] Allowed IO::Path.z to be called on directories, to mirror .s [b6838ee] + [IO] Implemented IO::Handle.spurt [a5800a1] + [IO] Implemented &indir [a0ef2ed][ca1acb7] + [IO] Implemented IO::Path.concat-with [966a7e3] + [IO] Made `&*chdir` return new `$*CWD` [5464b82] + [IO] Expanded accepted arguments from Cool to IO() in &spurt [099512b] + [IO] Implemented :parent in IO::Spec::Cygwin.canonpath [0c8bef5] + [IO] Made IO::Path.lines lazy again (reversal from last release) [90da80f] + [IO] Re-added :close param to IO::Handle.lines (reversal from last release) [90da80f] + [IO] IO::Handle.lines($limit, :close) now closes the handle when $limit is reached [90da80f] + [IO] Added IO::Pipe.path and .IO methods to return an IO::Path type object [d46e8df] + [IO] Made IO::Path.mkdir return invocant on success [c01ebea] + [IO] IO::Path now `does` role `IO`. This exists solely as a future compatibility feature with `IO()` coercer type check and provides no new methods [87987c2][c95c4a7][fd503f8] + [IO] &chdir and IO::Path.chdir now support :r, :w, :d, :x args for file tests and default to :d test only [a0ef2ed] + [IO] Changed coercers from Str() to IO() in `&*chdir`, &chdir, IO::Path.chdir, &rename, &move, © to avoid limitations of IO::Path.Str and race conditions with `$*CWD` [2483d68][a0ef2ed][ff97083] + [IO] Changed a Capture of remaining args to be passed to the delegate IO::Handle methods, instead of the internal .open call in IO::Path .lines, .words, .comb, .spurt, and .split [099512b][90da80f] + [IO] The following now return Failures instead of throwing: &chdir, `&*chdir`, &spurt, IO::Path.spurt, IO::Handle.spurt, IO::Path.slurp, &symlink, &link, &rename, &move, © [a0ef2ed][2483d68][5464b82][c13480c][da1dea2][ff97083] + Removals: + Removed unused $.pid from Proc [5b8d4c2] + [IO] Removed &mkdir candidate that creates multiple dirs [0d9ecae] + [IO] Removed IO::Path.abspath [cb323d5][a432b3d] + [IO] Made IO::Path.new-from-absolute-path a private method [7f73f92] + [IO] Removed vestigial IO::Path.pipe [a01d679] + [IO] Removed unused Capture in signatures of some .IO coercers [0c7e4a0] + [IO] Removed IO.umask method [87987c2][fd503f8][c95c4a7] + [IO] Removed :bin argument in IO::Handle.Supply; now uses handle's mode instead [184d499] + [IO] IO::Handle and IO::Socket no longer `does` role `IO` [87987c2] + [IO] Removed .chmod, .e, .d, .f, .s, .l, .r, .w, .x, .modifies, .accessed, .changed, .mode, and .watch methods from IO::Handle [36ad92a][50aea2b] + [IO] Removed &tmpdir and &homedir + [IO] :$test param on &chdir and IO::Path.chdir is now deprecated and will be removed in 6.d language [a0ef2ed] + Efficiency: + Made .Set/.SetHash.clone about 250x faster [d673ea7] + Make Baggy (&) Baggy about 80x faster [e9a3075] + Made Mixy (&) Mixy about 60x faster [03ef4be] + Made Str (elem) Map / Map (cont) Str 50x faster [a8c6eca] + Made Setty (&) Setty about 40x faster [89b5d65] + Made Setty (-) Setty about 40x faster [49c0ab6] + Made Baggy (|) Baggy at least 40x faster [4facf10] + Made Mix.BagHash and Mix.Bag coercions about 28x faster [2d8ac1e][af50e06] + Made Setty `(<+)`/`(>+)` Setty at least 25x faster [224e40f] + Made Mix.MixHash coercion about 25x faster [de983bc] + Made Map (|) Map 15x to 20x faster [9470d1c] + Made Setty (|) Setty about 25x faster [49807eb] + Made Object Hash.Set(Hash) coercion 12x faster [fb5d726] + Made .invert about 10x faster [7ea0f66] + Made Baggy coercion to Set|SetHash 10x faster [f947a19] + Made @a.first(Foo) 6x-10x faster (also affects many set operators) [9671ffe] + Made Iterable (|) Iterable about 9x faster [80062b0] + Made Set.WHICH about 8x faster for 50 elem Sets [167a0ed] + Made Set.SetHash coercion 12x faster [2731087] + Made coercion of Map to Set(|Hash) about 8x faster [4683e83] + Made Setty coercion to (Bag|Mix)Hash 7x faster [6686abb] + Made Map (&) Map about 7x faster [605e9e9] + Made Baggy `(<+)`/`(>+)` Baggy at least 6x faster [928a406][0672082] + Made Mixy `(<+)`/`(>+)` Mixy at least 5x faster [38b341a][0672082] + Made (cont)/(elem) 25% to 5x faster for QuantHashes [5b7ef3e] + Made Setty.hash about 4x faster [10fe02a] + Made Setty.pick/SetHash.(grab|grabpairs) 4x faster [6c9f31b] + Made Iterable.Set(|Hash) about 4x faster [f849df3] + Made m:i// regex matching 1.8x-3.3x faster [3e275dd] + Made Enum.ACCEPTS(Enum) 2.9x faster [17d34cd] + Made Iterable (&) Iterable about 2x faster [0fc3751] + Made internal nqp::index 2x faster, affecting many methods that work with strings [f1fc879] + Made case-insensitive regex 2x faster [822566f] + Made Baggy.new-from-pairs 1.5x faster and use less memory [ff52b74] + Made concatenation with control chars at end 30% faster [027aa54] + Made Baggy.new, bag(), and mix() about 25% faster [ae3ff5c] + Made Iterable.flat about 20% faster (also affects `*@foo` slurpy params) [f532f81] + Made Numeric.ACCEPTS(Any) about 15% faster [89457f8][e0e0800] + Made Hash.Bag about 15% faster [e7e97c7] + Made generic handling of `(<+)` and `(>+)` about 15% faster [5ae4549] + Made Set.new(42) about 8% faster and use less memory [fb60621][1471527] + Made Set.new-from-pairs about 4% faster for Pairs [213a72c] + Made Any.unique a few percent faster [6060bd3] + Streamlined tai/epoch conversion / leap-second check [dcebce4] + Added fastpath for `infix:<(|)>` with empty list of args [e24980f] + Made multiple memory use reductions in internals in MoarVM [d0924f1] + Made Grammars pre-compute their NFAs during precompilation [064b585] + Improved FSA which gives better multithreading performance [20af51f] + [IO] Made IO::Spec::Unix.split 36x faster [4fdebc9] + [IO] Made IO::Spec::Unix.catpath 9x faster [55abc6d] + [IO] Made IO::Spec::Unix.join 8.5x faster [55abc6d] + [IO] Made IO::Spec::Unix.is-absolute about 4.4x faster [4eef6db] + [IO] Made IO::Spec::Unix.catdir 3.9x Faster [0111f10] + [IO] Made IO::Pipe.lines 3.2x faster [0c62815] + [IO] Made IO::Spec::Win32!canon-cat 2.3x faster [0e36bb2] + [IO] Made IO::Path.child 2.1x faster on `*nix` [55abc6d] + [IO] Made .IO.slurp about 2x as fast [b4d80c0] + [IO] Made IO::Handle.open 75% faster [4032953] + [IO] Made IO::Spec::Unix.rel2abs 35% faster [dcf1bb2] + [IO] Made IO::Path.slurp 12%-35% faster (for small files) [c13480c] + [IO] Made IO::Path.new 7% faster when creating from Str [ae5e510] + Assorted internal improvements to CPU/memory use [1132b1a][a123eb3][1bacc61][c3c849e] [fa9aa47][666ce35][e7e97c7][213a72c][fab9f87][9671ffe][08a9735][8a4df162][b64f210][1277fb5] [463898a][3f36508][65037c3][e408e47][6ef7b59][a4b30dc][7875eaf][d793e21][bf63719][9a2446c] [0dbe451][1867099][2694f5d] New in 2017.03 + Fixes: + Made IO::Path.lines non-lazy so it can always close the file handle [0083c4f] + Fixed unwanted container re-use in `infix:` [5b7b7fb] + Made Emoji_Modifier_Base return Bool instead of int with uniprop [2125d4d] + Fixed JIT rounding bug for negatives in nqp::div_i [deac603][f73d984] + Fixed failure in `\c[]` with non-ASCII names [deac603] + Fixed issues in `infix:
` optimization [deac603] + Fixed .split(...:skip-empty) not skipping with empty strings [fc86084] + Fixed duplicated .done/.quit on Channels in Proc::Async on exit [c4a4c84] + Fixed error handling when Proc::Async process failed to spawn [f73d984] + Made sure `infix:` always returns a Seq [1eb7b1f] + Partially fixed `infix:` being non-lazy [f190f24] + Fixed SC collision when loading identical modules from different dists [254f76a] + Fixed CURI loading of modules with identical short-names [c1a0fa7] + Fixed SEGV in exception handler resolution in sub/INIT/return [b2eb115] + Fixed SEGV on `xx` with a huge repeat values [1cafc67] + Fixed SEGV on chars with a huge number of combiners [1cafc67] + Fixed SEGV when `Scalar` type object is processed by `unique` [cfe0e04] + Fixed .comb(Int) failing to work on Cool [a08e953] + Fixed hang in dispatch of .lines/.words when given wrong args [7425737] + Fixed cases of lack of panic upon with quantifiers in regexes [91a4ac5] + Fixed broken thunking of infix: [5e6f30a] + Fixed failure to thunk RHS on `or=`, `and=`, and `notandthen=` [3e88c41] + Fixed precision loss with `cmp` involving Rationals/Int [9e8ecb7] + Fixed crash in .Bool, .so, .not, .hash, and .elems on Baggy:U [e8af855] + Fixed crash in .Str on Bool:U [3de5fb2] + Fixed crash in IO::Special .WHICH/.Str [dd4dfb1] + Fixed install wrapper when no binaries are found [796b6a8] + Fixed crash when calling .sort on reified empty Array [8e250db][75e070f] + Fixed `Nil` being displayed as `Mu` in REPL [a274bdd][cd47e2a] + Fixed previous output silencing exceptions in REPL [db70a1f][61a65ce][7f9235c] + Fixed loss of data when using a hash in assignment to itself [ae7bcf1] + Fixed IO::Path.e failing to detect changes on the filesystem [76f7187] + Fixed `infix:` with Seq/List containing same elements [f9eb811] + Fixed CArray to pass NULL when for type object elements [26e6993] + Fixed GC deadlock when event loop worker thread was spawned [26e6993] + Fixed `:i` in regexes using lowercase instead of fold case [26e6993] + Fixed parsing issue with detached methods in `[…]` metaop [e1ebb50] + Fixed unwanted list flattening in triangle reduce [10f5f74] + Fixed Range.int-bounds for NaN and Inf end points [79f2681][16ef21c] + JVM backend fixes [b1def95][2f6d2c6][dc19892][cef41b2] + Various improvements to error reporting [dc5fb20][d66c382][b11dc88][6cb9be2][3bf734f][26e6993] [20fa14b][127338a][1934a56][27dc7b1][1e24666] + Additions: + Made symbol imports of `require`d modules lexical. For more information, see http://rakudo.org/2017/03/18/lexical-require-upgrade-info/ [63cf5ca][3e86d0f][5b98caa][6771dee][9da6de4][4fce405][030c4c5] + Added ≤, ≥, ≠ as Unicode versions of <=, >=, and != [5c68ea6] + Made it possible to hyper ops that return a Seq [e2db7b8] + Made `infix:<∘>` keep RHS's .count and .arity and LHS's .of [032b283][cb149a8] + Made purity propagate up through meta-meta ASTs [68a40f7] + Made Proc::Async default to translating newlines [05add43][2973ccd] + Implemented Str.parse-names [5c1761a] + Added `$epsilon` argument to Complex.Rat/.FatRat [a4af702] + Fixed loss of precision in Instant.Rat [a4af702] + Implemented .FatRat coercer in Cool and Numeric [a4af702] + Added Mu candidate for `infix:` [e270a15] + Implemented Mu.iterator [81fcd1b] + Made sure Str.split always returns a Seq [f595733][8301a30] + Made List.reverse return a Seq [beda576] + [EXPERIMENTAL] Added support for Parameter.set_default [d6c95ea] + Implemented new internal braids API to make future optimizations easier. This affects any slang modules that access `%*LANG`, `%*PRAGMAS`, and `$*ACTIONS` internals using unofficial API. + Removals: + Removed IO::Path.Bridge [212cc8a] + Removed support for IO::Handle.lines(:close) agument [76a59cf] + Efficiency: + Made min/max/min=/max= about 3x faster [a9c5196] + Made .WHICH of numerous types about 1.8x faster [79bb179][65b0040] + Made case-insensitive regex match 20%-30% faster [5b6e0fb][f73d984] + Made triangle reduce right op with 2 params 2x faster [e114d52] + Made triangle reduce right op with 2+ params 1.5x faster [d04c47f] + Made IO::Handle.lines about 10% faster [9019a5b] + Made IO::Handle.getc about 3% faster [9019a5b] + Made reduce chain op about 5% faster [9cec31a] + Made IO::Handle.lines about 10% faster [9da50e3] + Made List.reverse 0%–30% faster and reduced memory pressure by up to 70% [beda576] + Made loops/maps with NEXT phaser about 5% faster [80e0bce] + Made `infix:<%%>` about 14x faster for Int,Int case [755e25b] + Made `infix:<%>` about 8x faster for Int,Int case [5ec2517] + Made Junction creation about 20% faster [fafe663] + Made callframe() about 20% faster [7966dad][9a74cd0] + Made meta reduce with right-assoc. op 30%–200% faster [60a8f9e][2cf9b53] + REMOVED caching of IO::Path.e results to fix unwanted behaviour [76f7187] + Assorted internal improvements to CPU/memory use [b2e0ac0][25a3cc5][b61b3c7][829762a][45b3af8][7010ae9][556db9d][9e9a4ad] [8e8cd14][7556498][adb6f87][9a109c9][3de7b08][b283e52][0be7247][74573d0] [79d5670][313e7b2][e723e00][5843ee6][7c279c3][318f8ee][4ef1e69][9d497e9] [b597398][4bc826d][9da50e3][2a2e460][0633f03][d444f65][f94a2c7] New in 2017.02 + 6.d.PREVIEW changes: + It is now possible to use different language versions in different comp units. Pragma `use v6.d.PREVIEW;` loads PREVIEW version of 6.d language [9044fca] + Made `await` non-blocking (i.e. not using a thread for waiting) [dd1cb5f] + Made `react` non-blocking [4aa8d70] + Various improvements to error reporting [ee7c1bb][a2d69a0][f22170f] + Fixes: + Fixed data race in NFA cache [8f53a6f] + Fixed handling of Unicode characters on Windows command line [8f53a6f] + Fixed overflow during full GC collection on 32-bit systems [8f53a6f] + Fixed GC problem in string repeat op [8f53a6f] + Fixed .perl.EVAL roundtripping for circular Arrays and Hashes [67aeefa][673f06b] + Fixed instantiation of subclasses of classes that do Rational [7f245f7] + Fixed incorrect handling of precision flag in sprintf '%d' [a1c7d01] + Fixed `infix:(..., *)` for empty Slips [4e49ec1] + Fixed .pairs, .values, and .kv with native shaped arrays not having values in writable containers [0fdb9e4][1181afe][e195e5f] + Changed Pair.AT-KEY on non-existent key to return Nil [9728c4a] + Fixed Slip.List not returning a Slip instead of a List [4d4822a] + Made Map.List and Hash.List always return a List [6dd542f] + Fixed crash when using `.=` to initialize attributes [700a077] + Fixed leak of asynchronous task handles [483e4fd] + Fixed issues in .skip-one in internal Mappy iterator [3a77cb5][e7ea4c2] + Fixed count-only on all Hash based .kv methods reporting only half of actual value [aecbb3e] + Fixed crash in internal iterator used by .rotor and .batch [bcd902a] + Fixed LAST phaser called twice in sunk do for {} loops [3424465] + Fixed various discrepancies as a result of inlining non-native types [f8b3469] + Fixed leaks and an invalid read in synchronous sockets on errors [9ed4449] + Fixed NFA generation for the constructs `x ** 1..2` and `:i <[A..Z]>`, and hardened NFA processing in MoarVM so as to not read out of bounds [9ed4449] + Fixed memory leaks on startup and module load with augmented types [9ed4449] + Fixed smartmatch of Complex against Ranges [f2894d3] + Fixed premature overflow of `div` on native int types [c98b3a5] + Fixed flat()/Iterable.flat not propagating `is-lazy` [51b0aba][ca102c5] + Fixed hang with `*@` slurpies when given infinite list [51b0aba] + Fixed abs() failing with negative zeros [f85978b] + Fixed List.perl of containerized empty lists [a148c70] + Fixed at-times incorrect result of Rational.ceiling [6372417][79553d0] + Fixed Rational.norm failing to normalize the Rational [aac9efc] + Fixed issues with close() and read() on closed async sockes [f16cf37] + Fixed occasional disordering of messages in Supplier::Preserving [cabf6fb] + Fixed a data race in NFA caching causing SEGV [62bd30b] + Fixed data races and over-sharing of %*ENV in precompilation [bab1c02] + Fixed data races in CompUnit::PrecompilationStore::File [accc156][39c517e][917d473][a88da2e][6c374d5][2b1eb64] + Various improvements to error reporting [10bcec2][5822605][f230224][b51a550] [8733aa5][483e4fd][f0b9234][e922275][51ebfb1][acae345][1b99196][301bcf9] + Additions: + Implemented Array.clone [dc69daf] + Implemented Mu:U.clone [11d005e][4b85db6] + Added experimental `infix:` [6f6f0cf][5870ef9][eb3356c][6990133] + Added experimental `infix:`, `Any.collate`, and `$*COLLATION` [2061485][4efcc29][46313fa][1923878][5611425][6990133][f85978b] + Implemented Any.skip [8a6bfc6] + Implemented Supply.skip [d71bf1e][15753fd] + Implemented Any.batch [e0201f1][f6531d3] + Added Supply.rotor($batch) candidate [5694727] + Added support for all Nd characers in sprintf format strings [483e4fd] + Added support for more named Unicode sequences [3a77406] + Made named Unicode lookups (e.g. "\c[...]") case insensitive [3a77406] + Added support for Support East_Asian_Width Unicode property [9ed4449] + Made CompUnitHandle.globalish-package return the actual Stash [960a789] + Made Test.pm6's skip() only accept Int test counts [ae9d517] + Numerious fixes related to colonpair-extended names on subroutines [48abeee] + Made merging of Perl 5 symbols use the same mechanism as for Perl 6 [4e7ab20] + Included try-load in CompUnit::PrecompilationRepository's interface [d932355] + Made S/// set $/ to Match objects made during substitution and avoid returning the result in $/ causing container-reuse in loops [97359ae] + Made CompUnit::Repository::Installation sort binaries by version [7c39bbf] + Made it possible to call IO::Path.s on a directory [25fd1ca] + Gave fakesignature a $/, $_, and $! to avoid unintended sharing [71a1283] + Implemented smartmatch of character Ranges [8477f3b] + Str ~~ Numeric no longer throws if Str cannot be coerced to Numeric [1615c83] + Efficiency: + Made SetHash.iterator|pairs|antipairs|kv|values about 20x faster [a2fbe20] + Made Int.WHICH about 1.7x faster [9841313] + Made Baggy.kv about 15% faster [e995107] + Made Baggy.kxxv about 30% faster [5db0b29] + Made Baggy.antipairs about 25% faster [2922ec4] + Sped up postincrement and postdecrement by about 5% [fd74c91] + Internal improvements for 1%+ faster parsing [dd514da][9493ffb][951a441] + Made `` parsing 5%+ faster [0bb7c20][d5262e6] + Generalized sink branch optimize logic improving performance for sunk post increment [5401a1a] + Improved radix operations (50% faster with non-ASCII digits) [9ed4449][c98b3a5] + Made uniprop/unival/unimatch 1.1x to 2.1x faster [411782e] + Fixed performance loss on `infix:` with very large number [8878af8] + Made Map.sort about 1.5x faster (also affecting its .perl/.gist/.Str) [0ee3b7d] + Made an improvement in candidate selection order of &sort [b7c6e73] + Made .skip of internal mappy iterator about 15% faster [54f647d] + Made List.keys on lazy lists a bit faster [0ad05ce] + Made Seq.InfiniteLoopIter about 6% faster [00e60d9] + Made do repeat while about 3%-11% faster [a832944][af49026] + Made `do while foo { bar }` loops about 20% faster [4932112] + Made `do repeat while foo { bar }` about 20% faster [3888b42] + Made `do loop ( init; while; next ) { }` loops about 6% faster [c2eb7fb] + Made `.map: -> $_ --> non-Slippy-Foo { ... }` maps about 2x faster [fdcf462] + Made firing of phasers about 25% faster [7e98504] + Made `my @a = do for @b { ...; PHASER foo }` about 1.5x faster [031efe0][3424465] + Made `for @b { ...; PHASER foo }` about 15% faster [031efe0] + Made `@b = @a.map: { }` 10% and `@b = do for @a { }` 20% faster [3e28b1e] + Made `for @a { ... }` about 1% faster [d69f375] + Made `my @b = @a.map: -> \a,\b { }` about 15% faster [9f15a4d] + Made `for @a -> \a, \b { }` about 2% faster [7384939] + Made .tail on reified List/Array about 8x as fast as `[*-1]` and .tail(N) about 16x as fast as `[*-N .. *-1] [*-N .. *-1]` [833fe43] + Made improvements and refactoring of various internal iterators [f2b97b0][18e6f0d][87f61d9][c069f45][ad90806][4ef37cf][54f647d][49e2d40a] [7c26985][4d8fc05][b1afc13][072d959][9d5c3fd][6b6a0b4][b31c591][b9d9279] [f799a03][98f9d8a] + Made improvements to performance of internals [ed4ef3b][f85978b] New in 2017.01 + Fixes: + Fixed importing globals nested in imported packages [85d8b14] + Fixed "Object of type A in QAST::Var value, but not in SC" [43d20eb] + Fixed use Foo::Bar; class Foo {my Foo::Bar $bar} not finding Foo::Bar [5c4db5e] + Fixed class Foo { use Foo::Bar; my Foo $foo; } not finding Foo [226cb36] + Fixed our scoped nested package swallowed by lexically scoped parent [85b9d8a] + Fixed imported nested enum colliding with symbols from outer scope [a962928] + Multiple methods that return listy things now throw instead of failing to avoid accidental Failure silencing through 1-elem lists [99e33fc][bd4e1f4] + Made List.roll always return a Seq [bd4e1f4] + Fixed SEGVs and GC panics in certain deep recursions [58c79e2] + Fixed detection of runtime errors in threads [b8df3a6] + Made sure .sort on shaped arrays uses the leaves [a4bc51a] + Made U+2212 infix:<−> and prefix:<−> same as regular `-` for all types [91af128] + Made sub MAIN usage ignore anon *% param [38ec79c] + Fixed lack of warning on unitilized values in infix: [c498d5b] + Fixed Distribution::Path bin/resources file format [393afcf] + Fixed spurious warnings in List.reduce [1ee24cc] + Sorting uninitialized List now returns a new list [005166e] + Made .sort always return a .Seq [434bf75] + Fixed combinations() incorrectly returning 1-item list in some cases [d86c419] + Made combinations() always return a Seq on succcess [db1836a] + Fixed useless "useless use" warnings in hypered ++ and -- [7193df1] + Fixed numerous bugs with $limit in lines() [19df358] + Fixed regression with mutability of .pairs on shaped arrays [dc7b688] + Fixed regression with infinite lists assignment to shaped arrays [aa35065] + Fixed regression with looping over uninitialized shaped array [696b1f4] + Fixed regression with regex match against NFC [8d35951] + Fixed infix: with 0-denominator rationals [a567eb4] + Fixed crashes in X::OutOfRange reporting with 0-denominator rationals [b2332c2] + Fixed &infix:<==> on 0-denominator rationals [73182d4] + Fixed &infix:<===> on 0-denominator rationals [cb2476f] + Fixed incorrect .isNaN result for 0/0 rationals [7434a8f] + Fixed IO::Socket::INET.new not parsing IPv6 URLs correctly [cb9ec03][df20d8b][fbd061b][8751f05] + Made IO::Socket::INET.new fail when invalid port or family is given [cb9ec03] + Fixed Range.AT-POS on int ranges failing for too-high indexes [c5e54ef] + Fixed (^) set operator on Baggies to take weights into account [a687d95] + Fixed incorrect dispatch in some cases of multi subs with where clauses [0c0dd82] + Fixed unwanted role punning due to attached Pod [d487657] + Made Routine.prec(key) return '' rather than Nil on fail [d7d76b7] + Moved .prec from Routine to Code [a7ccfc6] + Fixed an occasional heap profiler crash, and prevent heap profiler from greatly reducing the number of full GC collections [e182deb] + Fixed specializer log slots keeping alive, and so leaking, objects once specialized code has been produced [e182deb] + Fixed build under some versions of MSVC [e182deb] + Fixed code-gen bug in dispatch: [3d86286][ba8a284] + Fixed `1,*,3 Z~ ` case using Whatever value for the rest of list [471f4ba] + Fixed threading issues in ||=, //=, and &&= [d1c2e76] + Fixed GC in spesh triggered by managed mutex use [25615c7] + Fixed bugs in interaction between inlining, GC, and threads [25615c7] + Fixed endpoint-exclusion on string ranges with non-alphanumeric chars [daf7e51] + Fixed fatality of Nil.chomp/chop (back to just a warning) [7c81bec] + Fixed infix: on NaN and signed zeros [3f80e13] + Fixed crash in infix: when comparing Real and RatStr [8ec54ba] + [TEST] Test.pm tests no longer backslash every backslash in descriptions [b183cab] + [TEST] Fixed TAP::Harness parsing of single backslashes in test descriptions [b120ac4] + [TEST] Fixed TAP::Harness failing to parse full-file skip directive [aee7af3] + [UNI] Fixed `ISO_Comment` property in uniprop [4ff2fb2] + [UNI] Fixed uniname() on "\x[80]", "\0" and other controls [8163113] + [UNI] Made unival() use full Unicode names for Numeric_Value_* [dbbf9dd] + [UNI] Fixed several aliases for Unicode characters [5ba982a][644cd34] + [UNI] Fixed number of characters reported for hundreds of Unicode Emoji [823f0f7] + [UNI] Fixed compilation of /:ignoremark \"/ to actually ignore marks [6188771] + [UNI] Fixed mismatched closers on U+298D/U+2990/U+298E/U+298F brackets [76283f6] + [UNI] Fixed return value of uniprop Bidi_Mirroring_Glyph if no BMG [48e8ccc] + [UNI] Fixed breaking after Prepend characters [7c8b705] + [JVM] Fixed build issues [7bba13a][adcfb8b][e6ccb47][29f487e] [fb4f161][4320fdc][39bf63f] + Assorted improvements in error reporting + Additions: + Made importing globals from loaded modules lexical [4b529c8] + Added degenerate Any.match [3fe5893][cc0f836] + Added infix +/- for DateTime/Duration [6b850ba] + parse-base() now allows for omitted whole part [3282813] + Using a Bool:D literal as type constraint in signatures now warns [b01dfcd] + Made Bool.ACCEPTS work with Junctions [9fc616f] + Made Proc::Async sub-class friendly [a2cc58a][1dc0c01] + Implemented .clone for SetHash, BagHash, and MixHash [1ee9c82] + Implemented .List on shaped arrays [8568dd1] + Added own .perl method to Empty [ec0258a] + Made Inf and Whatever work as part of rotor()'s cycle [7ddc5f7] + Made it possible to use Inf and Whatever in .head and .tail [93b0ffa] + Implemented `next` in `whenever` blocks [f97d5c2] + [TEST] Test::is() now handles Mu types [268dc92] + [UNI] uniprop now handles Emoji properties [3baffe7] + [UNI] Implemented Bidi_Mirroring_Glyph as an integer property [7c8b705] + [UNI] Implemented Emoji grapheme breaking and other combined codes [7c8b705] + [UNI] Added Emoji Unicode properties [7c8b705] + [UNI] Added secondary and tertiary Unicode collation support [ee38721] + [UNI] Re-implemented UTF8-C8 streaming decode [7c8b705][ee38721][e182deb] + [UNI] Made all Nd chars accepted in ${} special variables [eba3fe0] + [UNI] Made all Nd chars accepted as regex quantifiers [e40a129] + Removals: + [UNI] Unicode 1 character names are now deprecated and issue a warning [e7c1d51] + Removed IO::Path:U.chdir candidate on account of it being a footgun [94df18c] + Efficiency: + [UNI] Made unival() slightly faster for repeated lookups [dbbf9dd] + [UNI] Made decoding UTF-8 text 14% faster [528ec53] + Made compilation of custom operators about 1.5x faster [c99fbc6] + Made improvements to memory management of various aspects of invocation records (aka call frames), greatly reducing memory pressure in a number of cases, especially in applications that produce and store a large number of closures. Up to 20% improvement to CORE.setting build time and ~10% peak memory use reduction observed [e182deb] + Made I/O memory buffers properly contribute to full collection criteria, reducing memory overhead required [e182deb] + Made @a[*-1] 13% faster [b39c0d8][ab26b58] + Removed unnecessary caching on .elems in core code [ab26b58] + perl6 -ne '' is now about 40% faster [541d127] + Made IO::ArgFiles.lines about 10% faster [73797b7] + Made List.sort() about 4x faster [8d33b89] + Made native @a.sort() about 12x faster [4b2cea0] + Made Str.split() about 3x faster [f0398fb] and then 10%-40% faster on top of that, based on length of string [2496963] + Made Any.sort(&by) about 40% faster [1374fcf][def5262] + Made List.sort(&by) about 5% faster on reified List/Array [1e54371] + Made .sort on 0- and 1-element lists 10%-40% faster [340bc90] + Made .sort on 2-element lists about 50% faster [4724bd6] + Made Supply.sort a multi for faster dispatch [54cc06b] + Made Cursor.MATCH about 10-15% faster [9eef565] + Made QuantHash.AT-POS and Baggy.new about 5%-8% faster [c13e67b] + Made is nodal check a bit faster [0f25d83][996ab6a] + Made Capture.Bool about 3x faster [516e527] + Made sorting of 0,1,2 element native arrays about 30% faster [4038c6c] + Made generating iterator after List.eager does not reify again [7a759d7] + Added Seq.join that's 25% faster than List.join [3c52aa0] + Make @a Z @a 5x faster [4ab020f][3d1d699] + Made slow-path in grep 10% faster [362f674] + Made fast-path in grep about 1.4x slower as a result of a bug fix [362f674] + Made internal improvements with Empty and SlippyIterator [ebe9147] + Streamlined .prec on operators [caba0d3] + Made zip(@a,@b,:with(&[+|~]) about 12x faster [62f7027] + Made zip(@a,@b,:with(&op)) about 7x faster [62f7027] + Made zip with generic listinfix ops (e.g. zip(@a,@a,:with(&[minmax])) about 2x as fast [5c685f2] + Made zip(@a,@a,:with(&[=>])) about 5x faster [46cdf16] + Made generic right-assoc zip ops in zip(@a,@a,:with(...)) form at least 2x faster [6703b4c] + Made Zop handling (except for non-LHS-thunky ops) 13x faster [f66d4b3] + Made List.from-iterator about 10% faster [8f3476d] + Streamlined Array.from-iterator, making it 30% faster in some cases [fab1a14] + Improved ||=, //=, and &&= by avoiding thunking and invocation [d1c2e76] + Made List.combinations(N) about 20% faster [1a54bba] and on top of that made List.combinations() 1.5x, List.combinations(3..5) 2x faster [502fc77] + Made permutations() 2x to 24x faster [78edbbb][b5293c2][c64aeb3] + Made roundrobin() about 4x faster [73d0cec] + Made X and cross(...,:with) about 5x faster [8a3ff7b] + Made Xop about 7x faster [a26f513] + Made 1 X foo about 20% faster [d4a5b69] + Made List.rotor between 15x and 20x faster [d7b8214] + Made Range.excludes-(min|max|infinite|is-int) 2.5x as fast [99b186b] + Made reified List.Array about 3x faster [c9a9bc8] + Made List/Array.sum about 30% faster [017c6cf] + Made List/Array.fmt with no args about 60x faster [22e589a] + Made List/Array.fmt("%s") about 60x faster [7ef3682] + Made List/Array.join about 20% faster [ed482ec] New in 2016.12 + Fixes: + Fixed inability to autocurry superscript exponents properly [c35d562] + Fixed Match.prematch and Match.postmatch for zero-width matches [c04b8b5] + Fixed Match objects being erroneously treated as value types [7f26e8b] + Made U+2212 minus work in places it didn't [cb9df2b][01775b7][6cd2144] + prefix:<~> now calls .Str on Str types (helps with allomorphs) [e0a415f] + Fixed errors in `$*ARGFILES.lines` limit counter [bd42363] + Fixed bug with add history for Readline module in REPL [f544e4c] + sum and [+] metaop now correctly work on Junctions [8d04bec] + Fixed various scoping bugs with NEXT/LAST/QUIT [6bb8823] + Fixed issues in QUIT handlers running asynchronously [c027e6a] + Fixed occassional hangs in Proc::Async [e4d78c6] + Fixed operations still running after supply deactivation [f928a20] + Fixed Iterator.flat occasionally skipping inner iterables [61a18c0] + Fixed slurp not propagating :bin and :enc args on `$*ARGFILES` [15f51a5] + Fixed negative zero handling in many places [f1263ab][e2587cd][a9654c0][085145f] + Synthetics in numbers in colonpairs in :42foo format now throw [4663d43] + Fixed hang in .subst with no arguments [0a874fb] + Fixed sleep() with huge values failing to sleep [c797d3f][7c5ea31][2f72fa0] + Fixed attributive binding not looking outward for `self` [843a6be] + Fixed sprintf($format) without args issuing spurious warnings [35183f3] + Fixed infix:<===> failing when both sides are allomorphs [4a59ab4] + Fixed data race in Supply.interval [47ffdea] + Fixed data races in supply/whenever [33f7456] + Fixed memory corruption in Proc::Async [74eb6b9] + Fixed handling of time resolutions below 1ms in Supply.interval [c38f1ad] + Fixed issues with `-Inf` being a single term [ae614f9] + Fixed Signature.gist stripping sigils from anon typeless scalars [219f527] + Made permutations/combinations/grep die instead of fail()ing [ab3a59c][bc13bb5] + Fixed spurious warnings on .trans with regex pair complements [2e1b82c] + Fixed premature frees in async sockets when errors occur [b2ac4e4] + Fixed handling of superscript powers larger than int [0428b79] + Fixed Proc::Async sending empty string to taps on program exit [7532297] + Fixed wrong results for .first on Numerics [8cb3e1b] + Fixed matcher-less .first not respecting its adverbs [ababb24] + Fixed `sink` statement prefix failing to explode Failures [345f6a7] + Fixed regression in S:g/// not returning original string [5476d60] + Reverted .match/.comb to return empty List instead of Empty when failing to match [5476d60] + Fixed Mu.clone incorrectly marking all attributes as initialized [9a161fa] + Fixed cloned Baggy having an undefined .WHICH [9a161fa] + Fixed smartmatching against UInt type object [f9d34a9] + Fixed some Date constructors accepting invalid dates [aa27d5c] + Fixed .rotor on empty list returning an internal iterator object [5558710] + Fixed unimatch to check canonical short/alternate unicode props [b456471] + Fixed uniprop to return correct values for na, uc, tc, lc properties [2a8ec40] + Fixed uniprop for 'Numeric_Value' not returning a numeric value [9ff5b7e] + Fixed crash with Rat Ranges constructed with Range ops [1d46004] + Fixed crash with tapping supplies supplied by thunked block [a980eb1] + Fixed .perl on parametarized Hashes with no items in them [003e654] + Fixed .perl for itemized Slips [8eef234] + Fixed chained `andthen`/`orelse` operators returning internals [287af6a] + Fixed ThreadPoolScheduler.cue not applying delays to all cues [b286048] + Fixed control exception propagation when thrown from within statements handled by `without`, `with`, `andthen`, or `noandthen [9a3c350] + Fixed Rand.rand generating value equal to excluded end point [334d134] + Fixed `last` not working inside .grep's block [7021861][f775474] + Fixed .head not always returning a .Seq [69d808f] + Various fixes and improvements in error reporting + Additions: + Bare \b, \B, and \K in regexes now throw [08589d3][ee14067] + Added SQL as an output option for --profile-filename [f20b8b6] + Implemented native str Arrays [014d4cf][6d726f8] + sub MAIN now allows Enums as type constraints [546dbd9] + Count in .pick/pickpairs/grab/grabpairs can now be a Callable [e9487d6] + REPL with Readline module now loads `inputrc` files [573ed59] + REPL with Readline module now saves history [9043f58] + perl6 --doc=Text now shows signature parameter pod [6ea6563] + Generated sub MAIN usage message now shows original program name [b597b7c] + Added arity-1 infix:<~> for Blobs [77e9d4b] + Added IO::Handle.printf [8774f24][3c4ac3c] + Added ability to negate all numeric literals in signatures [5baa064] + Added .reverse/.rotate/.sum to shaped 1-dimmed arrays [a2ede36][4f4737d] + Added Mu.emit [4e76827] + Added --with-nqp Configure option for having NQP in a different prefix [6f6e6db] + Added .gist, .perl, and .Str to BOOTSTRAPATTR [3dd2916] + Made .sum nodal [4fd6e94] + Implemented uniprops [f55ff82][0328422][05db996] + Added 5 new sets of matching brackets for available delimiters [8965145] + Removals: + Removed X::Syntax::Number::InvalidCharacter exception [a8ff3b9] + Efficiency: + Made indirect type lookup 3x as fast [939d273] + Made shaped(int|num|str)array.AT-POS at least 15% faster [bfe89a5] + Made shaped(int|num|str)array.ASSIGN-POS at least 10% faster [ecc202e] + Made shaped(int|num|str)array.EXISTS-POS at least 20% faster [bbbb2b6] + Made 1-dimmed native arrays at least 3x faster [4a711bc] + Made native shaped array creation about 1.5x faster [1b840f1] + Made native 1-dimmed array init at least 11x faster [b6de5e8] + Made native 1-dimmed array copying at least 25x faster [b6de5e8] + Made use of native 2-dimmed arrays 2.5x–4x faster [172898e] + Made use of native 3-dimmed arrays 2.5x–4x faster [64343d7] + Made copying 1+ dimmed native arrays up to 9x faster [e0c0ae5][331c2e2] + Made copying intX[2;2] to intY[2;2] native array just as fast as copying intX[2;2] to intX[2;2] [79090b2] + Made native shaped array initialization 4x–6x faster [d704820] + Made iteration of 1-dimmed native arrays 17x faster [947422b] + Made iteration of >1 dimmed native arrays 11x faster [3e93ddd] + Made .(anti)pairs for native shaped arrays 7x faster [39261e7][471cea2] + Made .kv for native shaped arrays 16x faster [965fa4d][c1a3a3c] + Made native array.reverse|rotate about 20x faster [0ee6bc0] + Made @a[2;2] about 40% faster [b9e2ffa] + Optimized Int->int coercion [b2ac4e4] + Made infix:<..> on Nums 13x faster [a8ba26b] + Made uniprop with the default lookup 5x faster and other lookups 15% faster. [474ea33] + Made print, say and note 25% faster to stderr and stdout [e9ce28a] New in 2016.11 + Fixes: + Various improvements to warning/error-reporting + Fixed assigning values to shaped arrays through iterators [839c762] + Fixed Str.Int not failing on numerics with combining characters [d540fc8] + [JVM] Fixed .antipairs breakage [dd7b055] + defined routine now correctly authothreads with Junctions [189cb23] + Fixed poor randomness when .pick()ing on ranges with >32-bit numbers [34e515d] + Fixed infix: silencing Failures [2dd0ddb] + Fixed edge case in is-approx that triggers DivByZero exception [f7770ed] + (Windows) Fixed returning of an error even when succeeding in mkdir [208a4c2] + (Windows) Fixed precomp unable to rename a newly compiled file [44a4c75] + (Test.pm) Fixed indent of multi-line diag() and test failure messages [43dbc96] + Fixed a callframe crash due to boxing of NULL filenames [200364a] + ∞ ≅ ∞ now gives True [4f3681b] + Fixed oversharing with grammars used by multiple threads [7a456ff] + Fixed incorrect calculations performed by acotan(num) [8e9fd0a] + Fixed incorrect calculations performed by asinh(num)/acosh(num) [a7e801f] + Fixed acosh return values for large negative numbers [5fe8cf7] + asinh(-∞) now returns -∞ instead of NaN [74d0e36] + atanh(1) now returns ∞ instead of throwing [906719c][66726e8] + Fixed missing close in IO::Path.slurp(:bin) [697a0ae] + :U QuantHashes now auto-vivify to their correct type and not Hash [79bb867] + Mix/MixHash.Bag/BagHash coersion now ignores negative weights [87bba04] + arity-0 infix: now returns a Seq instead of a List [3fdae43] + Fix augment of a nested package [87880ca] + Smartmatch with Regex variable now returns a Match instead of Bool [5ac593e] + Empty ()[0] now returns Nil instead of False [f50e39b] + Failed IO::Socket::Async connection no longer produces unexpected crash [f50e39b] + Quitting Supplies with no QUIT phasers no longer unexpectedly crash [f50e39b] + Fixed NativeCall issues on big endian machines [627a77e] + Fixed broken handling of $/ in some uses of `.match` [ba152bd] + Fixed Lock.protect not releasing the lock on control exceptions [48c2af6] + MoarVM now builds on any version of macOS [b4dfed2] + Fixed concurrency crashes due to garbage collection [6dc5074] + Fixed race condition in EmptyIterator [ed2631c] + Fixed hang with multi-threaded long-running NativeCall calls [f99d958] + Made my @a[10] = ^Inf work [aedb8e7] + Fixed [;]:delete [3b9c4c9] + Fixed incorrect handling of negative weights in ∪ operator [e10f767] + duckmap now preserves types of Iterables [43cb55f] + Fixed premature overflow to Inf with large Num literals [729d7e3] + Fixed race condition in NativeCall callsite used by multiple threads [49fd825] + Fixed instabilities in programs launching many threads at startup [0134132] + Fixed crash when reporting X::Composition::NotComposable or X::Inheritance::Unsupported exceptions [a822bcf] + Fixed clock_gettime issue on macOS [ee8ae92] + Fixed SEGV in multi-threaded programs with strings-as-strands [395f369] + `regex` TOP Grammar rule will now backtrack if needed [4ccb2f3] + Fixed .rotate/.reverse on 1-dimmed arrays assigning to self [2d56751] + Fixed exponentiation involving zeros for Complex numbers [7f32243] + Fixed Label.gist [29db214][53d7b72] + Fixed certain edge cases of incorrect stringification of Rationals with .Str, .perl, and .base [b5aa3c5] + Additions: + Added TWEAK submethod for object construction [fdc90a2][9409d68] + Added DateTime.hh-mm-ss [bf51eca] + Added parse-base routine [7e21a24] + is-approx with no explicit tolerances now uses more complex algorithm to choose a tolerance to use (same as old is_approx) [82432a4] + on failure, is-approx now displays actual values received [b4fe680] + Added Iterator.skip-one to skip a single value [71a01e9] + Added Iterator.skip-at-least to skip several values [8d357af] + Re-imagined Str.match [b7201a8]: + the family of :nth is now lazy will return whatever can find + non-monotonically increasing :nth iterator values will now die + Str.match/subst/subst-mutate now have :as adverb [1b95636][c9a24d9][aaec517] + &infix: now works with Setty objects [d92e1ad] + :ov and :ex adverbs are now illegal in Str.subst [b90c741] + Made nextwith/samewith/nextsame/callwith to be real subroutines [70a367d] + Added CX::Emit and CX::Done control exceptions [07eeea8] + Setty.Mix/.MixHash coercers now use Int weights instead of Bool [7ba7eb4] + Implemented :kv,:p,:k,:v on 1-element multidim [;] [764cfcd] + .chrs can now also accepts codepoint numbers as Str [4ae3f23] + Added support for compilation of Rakudo on Solaris [a43b0c1] + IterationEnd.perl/gist/Str now returns text "IterationEnd" [59bb1b1] + Added X::Syntax::Number::InvalidCharacter exception [2faa55b] + .reverse/rotate on 1-dimmed arrays are now nodal [cd765e6] + .line and .file on core Code now references original source files [b068e3a] + .rethrow now works on unthrown exceptions [58a4826] + All Reals now accept `Whatever` as the second argument to .base() [c1d2599] + sub MAIN usage message shows possible Enum values if param is named and is an Enum [a3be654] + Efficiency: + Made slip(@a) about 1.2x faster [37d0e46] + Made initialization of 2+dimmed array 10x to 16x faster [dfb58d4] + Str.match is now about 5% faster [4fc17df] + Str.match with :nth feature is now about 2x faster [41e2572] + my @a = Str.match(...) is now about 5% faster [e472420] + Str.comb(Regex) is now about 7x faster [1794328] + Simple Str.subst/subst-mutate is now about 30% faster [364e67b] + Match.Str|prematch|postmatch is now about 2x faster [e65d931] + Match.Bool is now about 1% faster (not much, but used a lot) [1fce095] + Made ~~ /foo/ faster: 2% for successful/6% for failed matches [05b65d0] + Made ~~ /foo/ about 2x faster [e4dc8b6] + Made %h ~~ /foo/ about 2x faster [33eeb32] + Frequent accesses of multiple adverbs (e.g. %h:p:exists) is now 2x faster [f22f894] + Made infix: faster: Str: 14x, type: 10x, Range: 3.5x, Int|Seq|Hash: 1.5x, Array: 1.2x [bc7fcc6] + IO::Spec::Unix.canonpath is now 7x to 50x faster [f3f00fb] + Baggy.roll/pick is now about 10% faster [fc47bbf] + Made copying shaped arrays 10x to 20x faster [a1d8e93][0cf7b36][d27ecfa] + Made setting up a shaped array 2x as fast [f06e4c3] + Made creation of typed shaped arrays 15% faster [f5bf6c1] + Made 2d/3d array accesses about 7x as fast [d3a0907] + Made AT-POS on 1,2,3dim arrays about 20x faster [feb7bcb] + Made creating a shaped array about 50% faster [1293188][576f3a1] + Made .AT-POS on 3+ dimmed arrays 20% faster [1bb5aad] + Made over-indexed .AT-POS on 1,2,3 dimmed arrays about 10% faster [1bb5aad] + Made multi-dimmed ASSIGN-POS about 30% faster [5b2bdeb] + Made .ASSIGN-POS for 1,2,3dimmed arrays about 40x faster [050cf72] + Made n-dimmed .EXISTS-POS about 1.5x faster [006f008] + Made .EXISTS-POS for 1,2,3dimmed arrays about 10x faster [b1c41b7] + Made n-dimmed DELETE-POS about 1.3x faster [6ccecb1] + Made .DELETE-POS for 1,2,3dimmed arrays about 20x faster [55b9e90] + Made n-dimmed BIND-POS about 1.3x faster [2827edb] + Made .BIND-POS for 1,2,3dimmed arrays about 20x faster [9f94525] + Made @a[10].STORE at least as fast as @a.STORE [8064ff1] + Made .kv on shaped Arrays about 4x faster [e42b68e] + Made .pairs/.antipairs on shaped Arrays about 2.8x faster [0f2566a][f608a33] + Made List.kv about 30% faster [7a2baf4] + for loops on 1-dimmed arrays are now 3x faster [ed36e60] + .kv on 1-dimmed arrays is now 7x faster [608de26] + .pairs/.antipairs on 1-dimmed arrays is now 3x faster [b7d9537][1c425f9] + postcircumfix[;] on 2/3 dimmed arrays is now 9x faster [0b97362] + Assignment to [;] for 2/3 dimmed arrays is now 10x faster [ce85ba3] + [;]:exists for 2/3 dimmed arrays is now 7x faster [e3e3fef] + [;]:delete for 2/3 dimmed arrays is now 10x faster [3b9c4c9] + [;] := foo for 2/3 dimmed arrays is now 10x faster [eaf4132] + .iterator and .values on shaped arrays are now about 4x faster [736ab11] + Fixed optimization of shaped arrays that gives 10% gain on simple `for` loops and likely will give larger gains on bigger programs [b7e632e] + Made starting MappyIterator faster, affecting all Hash/Map/Baggy iterator methods. 2-elem Hash iteration is 1.6x faster [97fb6c2] + Made starting a grepper faster: .grep on with no adverbs on 2-element list is now 20% faster [077c8f0] + Made Date/DateTime creation 20% faster [0e7f480] + Hashes now use 4 (32-bit) or 8 (64-bit) bytes less memory per stored item [395f369] + Rational.Str is now about 40% faster [b5aa3c5] + Rational.base is now about 30% faster [b5aa3c5] + Various streamlining of code that's hard to measure the final impact of New in 2016.10 + Fixes: + Many fixes and additions improving JVM backend support + Several improvements to error messages + Fixed .tree([&first]) incorrectly calling .tree($count) candidate + Fixed unwanted errors when smartmatching objects against IO::Path + Fixed is-deeply with Seqs showing Seq.new-consumed() in failure text + Fixed concurrency race when setting up NativeCall routines + Fixed Match.list treating inner unmatched captures as end of list + .first now correctly handles Junction matchers + Fixed GLOBAL symbol clash re-compiling due to a repo change + Fixed Backtrace.map candidate being uncallable + Fixed multiple bugs in Hash/Baggy.classify-list/categorize-list + Fixed PERL6_TEST_DIE_ON_FAIL not exiting on failed subtests + Fixed autovification using Junctions as keys + Fixed infix:<^^>(Mu, Callable) candidate being uncallable + Fixed IO.l for dangling symlinks + Fixed infinite recursion in duckmap when mapper returned Any + Fixed .subst/.subst-mutate treating incorrect arguments as failed matches + Fixed .subst-mutate not returning all matches with :x + Fixed hang on smartmatching Promises against numerics + Fixed failure to smartmatch Numeric:U against Numeric:D + Fixed hang on incorrect .splice arguments + Fixed hang on incorrect .split offset + Fixed multi-argument WhateverCode not detected in double closures + Fixed Baggy:U ~~ Baggy:D emitting gut-referencing warnings + Fixed uncallable Dateish.IO + Fixed Exceptions::JSON for exceptions with no `message` method + Fixed Exceptions::JSON for exceptions with non-JSON-friendly attributes + Proc::Async decoding exceptions are now catchable + Prevented return handler being optimized out in `sub { 42.return }()` + Fixed error reporting when trying to invoke a native parameter + Fixed uncallable 0- and 1-arg candidates of infix: + Fixed Cool.match not setting $/ + Fixed Cool:U.IO coercion emitting internal warnings + Fixed Nil.chrs failing when called + Num:U++ now returns a Num zero instead of an Int one + Removals: + Removed argument-taking Dateish candidates for is-leap-year, days-in-month, and day-of-week [were never part of the spec] + Cool.IO no longer accepts any arguments + Overflow check has been removed from infix:<**>(int, int) + Additions: + Added basic Unicode 9 support (NFG changes for latest TR#29 still to do)) + X::Proc::Unsuccessful now includes command that was run + IO::Handle.new now uses 'utf8' encoding by default + Bare `put` now requires parentheses to call as sub + .head/.tail with no arguments now return the item and not a 1-item List + Added basic native attribute parameter binding + Made nativecast and spurt multies + Added .^elems metamodel method to enums + Enums can now be used to declare array shapes + Added X::Invalid::ComputedValue exception + Throw when dereferencing a null pointer in NativeCall + It's now possible to refer to sigiless parameters inside `where` clauses + Added extra candidates to .splice to allow for all combinations of Int|Whatever|Callable for both $start and $elems arguments + Made enums able to typecheck against the roles they do + Made Complex.new() return 0+0i + Int.new can now handle any value that can .Int + Added shortname() method to CurriedRoleHOW + Proc::Async new, stdout, and stderr methods now take :enc + IO::Socket::Async listen, connect, and Supply methods now take :enc + .Date and .DateTime are now supported on :U/:D Date/DateTime + Trailing empty cells can now be omitted in Pod tables + Mix/MixHash with non-Int weights can now be coerced to .Bag/.BagHash + Efficiency: + Made List.reverse about 5% faster + Made auto-threading about 10% faster + Made huge improvement to CUR::Filesystem.id performance + Made dir() about 20% faster + Made Regex.Bool about 2x as fast + Made Str.match about 3% faster New in 2016.09 + Fixes: + Various improvements to the content of error messages + Defaults on a slurpy params now throw instead of crashing at the VM level + Distribution::Path now handles native libraries correctly + Junctions now work in .classify + Control statements (e.g. `next`) in toplevel REPL now show useful error + IO::Handle.encoding now returns correct values + .comb/.split on binary handles now throws X::NYI + Fixed filehandle leak in precompilation + Regex in .grep and .first on Pairs now works correctly + Pod parser returns proper Bool instead of Int on passed config options + Fixed PERL6_TEST_DIE_ON_FAIL=1 exiting the test suite too soon or dieing on failing tests inside TODOed subtests + Fixed failure to accept enums as types for optional arguments + Fixed blocking bug when using socket accept and threads + Fixed fatal bug when using Non-ASCII tokens in regex/grammars + Fixed missing adverbs and candidates in Cool.split; made same as Str.split + Fixed missing adverbs in Cool.trans; made same as Str.trans + Fixed NativeCall CArray hanging when created from empty list + Fixed various issues with reading chars from an async socket (uncatchable exceptions on decode errors, and mis-handling of graphemes and multi-byte sequences over packet boundaries) + Fixed "%%foo @@bar" interpolation trying to find %foo and @bar variables + Fixed mis-compilation and possible compiler crash when using a construct like /$=@(1,2)/ + Fixed a memory leak involving EVAL + Fixed a multi-dispatch cache unbounded growth bug involving calls with many named arguments + Fixed warnings emitted when using hyper operators on two hashes + Channel.elems now returns a Failure rather than eating all values + Fixed type error ion IO::Path.rw + Fixed …, ???, and !!! yadas not working to stub classes + Fixed tab-completion issues with non-identifiers in REPL + Additions: + Coercions now work in return types + Added RAKUDO_EXCEPTIONS_HANDLER env var to control exceptions output + IO::Handle.slurp-rest now has :close flag + CompUnit::Repository::Installation now cleans up short-name folders when empty + Added support for very large numbers in :42foo colon pairs + Added a .Map coercer for object hashes + All Unicode quotes can now be used as quoters inside qqww/qww + LEFT/RIGHT DOUBLE PARENTHESIS characters can now be used with q and others + Unicode digits can now be used with Match variables ($١), quote pairs (:۳<12>), negative numbers (-١), and radix bases (:۳("22")) + Efficiency: + Numerous improvements in CUR, offering up to 10x faster module loading + Baggy.ACCEPTS(Baggy) is now about 25x faster + Baggy eqv Baggy is now at least 10x faster + Infix === now checks identicality, offering performance gains on large objects, such as a Bag with 1000 elements + Many metaops are now about 10% faster + Made Junction.Bool|ACCEPTS about 2x faster + Improvement in performance of IO::Path::child + Made permutations() about 5x faster + Made List.permutations about 40x faster + Made combinations() about 1.8x faster + Made List.combinations about 7x faster + Made Unix's canonpath several times faster for simple paths + Made Buf|Blob.reverse 1.5x faster + Made .IO.lines about 10% faster on large files + Changed APIs: + The operator precedence configuration rule `O()` has been changed to be more precompilation-friendly; rather than taking a string containing colonpairs, it now takes named arguments directly. This is not strictly a Perl 6 change, but rather a change in NQP, and thus only applies if you're doing fairly involved hacking on the grammar. If the sentences above made no sense to you, your code is not affected by this change. New in 2016.08.1 + Fixes: + Updated NQP version to avoid broken tag New in 2016.08 + Fixes: + Numerous improvements to content of error messages and addition of new previously-undetected warnings, such as on sinks and ... terms + Removed redeclaration error for anon subs + Concatenation/substr with strings constructed with repeat operator no longer results in incorrect strings + Fixed error for unknown symbol in parametric type + Things that produce a Seq no longer get constant-folded, avoiding bogus Seq exhaustion errors + where {} clause on unit sub MAIN no longer produces bogus errors + Fixed compilation and behaviour of :D on subsets + Assigning Nil to a :D variable now fails (unless its default is :D) + Fixed CURF's resolve generating the wrong repo-id + Fixed precomp file for Staging repo containing build path + Fixed merge global symbols failures when changing repositories + Fixed -Ilib and friends not overriding installed dependencies + Fixed <[a..z]> ranges breaking grapheme awareness + Fixed a race condition in Channel.Supply + Fixed an occasional deadlock when using the supply/react syntax + Fixed a race condition involving tearing down listening async sockets + start blocks now get their own fresh $! and $/ + .squish, .unique, .repeated, and .grep now correctly pass on .is-lazy + Fixed segfault on "multi cross{}" + .sort stored in a Callable no longer incorrectly returns BOOTArray + Smartmatch with two signatures, only one of which has slurpy hash, no longer produces spurious exception + @a.splice now returns array with correct descriptor + .rotor with negative gap that lands out of range now throws + Range.rotor with Rat arguments no longer crashes + .hash on Bag, Mix, BagHash, and MixHash types no longer stringifies keys + .abspath on filenames starting with '-' no longer results in empty string + generated setting file now has empty lines for those that were skipped in the past, allowing to directly map the line in a setting to the source code it was generated from + loop and repeat now properly self-sink + for { ... .map } now properly sinks + Backtrace::Frame.is-(hidden|routine) now returns Bool + Bool.Int now properly returns an Int + Starting the REPL with a module loading error, will now just exit + Names of phasers (such as BEGIN) will now be included in suggestions + Fixed loading of modules when a FileSystem repo doesn't actually exist + Fixed mis-scoping of blocks in s/// + Closure clones are no longer double code-generated + Caller $/ is now propagated through deferral + Fixed inconsistent coersions to Bool + Fixed over-assuming optimization of R meta operator + Fixed endless recursion in Any::BIND-POS under certain conditions + Additions: + Str.samemark('') now returns self instead of failing + Test.pm now provides bail-out() + Implemented $?MODULE and ::?MODULE + Implemented CompUnit::Repository::Installation::installed + InstalledDistribution now gets returned where appropriate + returns in signatures of many builtins now marked as --> Nil + .min/.max can now be called on Hashes + Invocant marker (:) can now be used in bare signatures + Added X::Syntax::NonListAssociative exception type + Hash[Any].new.perl now roundtrips + Buf.push|append|unshift|prepend also allow Blob:D + .succ now increments additional 29 digit ranges, such as Thai digits + List.sum is now marked as nodal + Can now return Nil as a result of a Promise + Implemented :exists on multi-dim assoc subscript literals + Added PERL6_TEST_DIE_ON_FAIL env var in Test.pm6 to bail out of the test suite on first failure + Efficiency: + Streamlined multiple internal code paths that may or may not result in performance improvements in user code + Improved dynamic variable lookup (2x as fast) + Hash.AT-KEY is about 35% faster + Hash.ASSIGN-KEY about 2x as fast + Hash.DELETE-KEY about 2x as fast + Hash[Any,Any].AT-KEY about 20% faster + Hash[Any,Any].ASSIGN-KEY about 15% faster + Hash[Any,Any].BIND-KEY about 15% faster + Hash[Any,Any].EXISTS-KEY about 10% faster + Hash[Any,Any].DELETE-KEY 10% faster + Repeated calls on Bag.WHICH now 5x as fast + Backtrace creation 25% faster + .first/.first(:end) iteration is now about 10% faster after testing 1000 elements + .minmax about 25% faster + .min/.max about 40% faster + min/max/minmax on native arrays is between 15x and 25x faster than non-native equivalent + Array.splice() almost infinitely faster and is much easier on memory (no longer copies anything but instead transplants internals) + Array.splice(offset,size) is now 20x to 40x faster for small offsets and sizes + Array.splice(offset,size,@) is about 10x faster + 10% improvement to .map/for in special cases of one-argument block that has a return signature that excludes Slips, such as -> Int $_ --> Str { .Str } + Many Set/SetHash methods are now at least 5% faster + Coercing a MixHash/BagHash to a Mix/Bag is now 300x faster + Coercing a Bag/BagHash to Mix coercion is now 1000x faster + Coercing a SetHash to a Set is now 80x faster New in 2016.07.1 + Fixes: + `make DESTDIR` now correctly finds CompUnit::Repository::Staging + .polymod with a lazy list no longer loses mods if the list runs out + Output from Test.pm6's diag() is no longer lost in non-verbose prove output when called at the start of the test file or during TODO tests + Bitwise operators that return int/Int no longer fail with candidate error when given a native int argument + Additions: + Improved error message when IO::Path.new is given incorrect arguments + Improved error message when .polymod is given a zero as divisor + Efficiency: + Str.samecase is now 5x faster + Str.indices is 10% faster + Str.rindex is 30% faster + Str.index is 30% faster New in 2016.07 + Fixes: + Mu can now be the result of a Promise + samewith() now also works on non-multi's + Many fixes in the area of pre-compilation and installing modules + Maps now correctly identify themselves as value objects + BagHashes and MixHashes no longer identify themselves as value objects + count-only and bool-only now are optional methods in Iterators (only to be implemented if they can work without generating anything) + Hash.Map now properly creates immutable Map + IO::ArgFiles.slurp / IO::ArgFiles.eof are fixed + Several wrapper file fixes + If a file is unknown in an error report, it is no longer shown (This typically happens in the REPL, or when doing an EVAL) + REPL whitespace and error handling + CompUnit::Repository::Installation no longer considers `bin/xxx` and `resources/bin/xxx` the same content address + Callable in a Signatures stringifies correctly + BEGIN time EVAL no longer negatively affects MAIN_CTX + Str.chop correctly works when given very large arguments + min/max on Failures throw instead of returning ±Inf + NativeCall's is mangled trait no longer ignored for CPPStruct + Additions: + The "is required" trait on Attributes can now take a Bool or a Str + Support for new leap-second at 31-12-2016 added + IO::[Path,Handle] gained a .mode method which returns the POSIX file permissions + Fixed LTA error message with Str.samemark when no pattern present + Distribution is now a role interface that enables encapsulating IO used for distribution installation + CompUnit::Repository::Installation now uses the new Distribution interface + The original distribution META `provides` data is now preserved + Custom repository implementations now supported, including precompilation + List.BIND-POS now fails instead of throwing + RAKUDO_JDB_PORT and RAKUDO_PRECOMP_NESTED_JDB debug environmental variables + Failures in Cool.Numeric and related coercers now get propagated + Improved warning message for literals with leading zeros + Improved error message for attempts to `use` core types + Efficiency: + The MMD cache accepts candidates with named parameters if it can. (This made adverbed slices about 18x as fast) + Str.samemark is 50x faster + Str.contains is 6x faster + Baggy.pick(N)/pick()/roll()/grab() are 6x faster + Array.List is 5x faster + List.elems is 4.5x faster + for/map with 2 arguments is 4x faster (e.g. for @a.kv -> $i, $v { }) + Str.substr-eq is 4x faster + List.Bool is 4x faster + Str.chop is about 3.5x faster, Str.chop(N) 20% faster + Map eqv Map is 3x faster + Make "for List.pairs {}" 2.5x faster + Array.pop is 2.5x faster + List.AT-POS/EXISTS-POS are 2.5x faster + Creating arrays with [] is 2.5x faster + Array.AT-POS/ASSIGN-POS/BIND-POS at least 2x faster for unreified elements + Array.DELETE-POS is 7x faster + Str.starts-with is 2x faster + Array.shift is 2x faster + Baggy.roll(*) is 2x faster + Blob/Buf.AT-POS is 2x faster (underlying method of e.g. "$buf[2]") + List.STORE is 2x faster (e.g. "my ($a,$b,$c) = (1,2,3)") + Make "for List.kv {}" 1.8x faster + Array.push/append is 40% faster + Str.comb 30% faster + Map/Hash initializations are now 30% faster + A slurpy taking a list is 30% faster ("sub a(*@a) { }; a(1,2,3,4)") + Str.ends-with is 25% faster. + Str.chomp is 20% faster + single element for/map in sink context without phasers, is 20% faster + Pair.new is 10% faster + val() is 5% faster + {}|[]:adverb is 2.5x faster + foo xx Int is 10% faster + Str.Int is 5% faster + Code.arity|count are 2x faster New in 2016.06 + Fixes: + Arrays with holes (e.g. from :delete) now correctly iterate/auto-vivify + Hash.keyof now correctly returns Str(Any) + Precompilation from a debug Perl 6 now uses "normal" Perl 6 executor + Inf,NaN,-Inf now can be coerced to Rat, and back to Num + Creating an Enum from a List/Range no longer warns + Precompilation on file systems with coarse timestamps no longer fails + An issue with reverse dependencies of installed modules was fixed + Fixed issue with comparing v6 and v6.c Version objects + Fixed ≅ ignoring the signs of compared numbers + Additions: + Add default for CompUnit::PrecompilationRepository.precompile(:source-name) + The "is-approx" sub from Test now allows for relative/absolute tolerance + The "cmp-ok" sub from Test now can take any infix as Str, even custom ones + A fail in a custom BUILD will now be returned, rather than thrown + use MONKEY-WRENCH and use MONKEY-BARS are now reserved names for future use + Efficiency: + .map between 10% and 30% faster + .unique, .repeated and .squish 10% to 20% faster + gather/take about 10% faster + Basic object creation (using either .new or .bless) now up to 3x faster + (+@a), (*@a) and (**@a) signature handling between 20% and 4x faster + Iterating List/Array now uses less memory and is faster + All routines now have less overhead, thanks to improved implementation of return handlers (including those that do not use return) + return, next, last, and redo are now all faster + infix:<,> about 40% faster + numerous other smaller or edge-case speed improvements + Deprecations: + The "is_approx" sub (note underscore) from Test New in 2016.05 + Fixes: + Fix EVAL during precompilation + .substr fixes + many precompilation fixes + clean up error messages + Streamline some core classes + Harden Mu.Str against moving GC + JVM fixes + Simplify $*USER/$*GROUP initialization + Additions: + Ability to use a customer debugger module + $*MAIN-ALLOW-NAMED-ANYWHERE allows MAIN to be friendlier about where it accepts flags + Add richer set of comparison operators for Versions + Many improvements to precompilation - building OS packages with precomp'd code should now be possible! + Introduce .Map coercer + Implement alternate ways to call subtest + Efficiency: + Version comparisons are now 2x faster + List.minmax is about 3.5x faster + Num.perl is about 2.4x faster + Int division/modulus is about 1.5x faster + LoL accesses are about 3x faster + autothreader is about 2-3x faster + Make Any junction methods 14x faster + Make Junctions faster + Map.kv is about 10% faster New in 2016.04 + Fixes: + .combinations cleanup + "magic" inc/dec cleanup + utf8-c8 encoding crashes that occurred on random data + fix missing pre-comp store unlock + missing module error mentions line number + some JVM fixes + Additions: + Improved REPL + Add :kv to .first + Add provisional $*DEFAULT-READ-ELEMS + Efficiency: + Removed leaks associated with EVAL + Speed up .minpairs/.maxpairs + Speed up Object:D cmp Object:D + Speed up sort 3-15% New in 2016.03 + Fixes: + Buf.push|append|unshift|prepend now can take int arrays + Better error messages when trying to put illegal values into Blob|Buf + The REPL now allows statements spread over multiple lines + No longer show compilation error twice when loading module with errors + Only Bufs can now be specified as parameter to subbuf-rw + Values in %*ENV now have allomorphic semantics + Supply.Channel / Channel.Supply no longer lose exceptions + Calling .prepend on a native array no longer infiniloops + Blob.WHICH now indicates a value (immutable) type + Better error reporting for problems with sprintf() + Some obscure unicode codepoints causing segfaults no longer segfault + Directory listings now handle wrongly encoded data using utf8-c8 + Additions: + Native str arrays (my str @a) + Buf.pop, Buf.shift and Buf.splice (similar to List.*) + Blob|Buf.allocate($elems, @init-pattern) + Buf.reallocate($elems) added + &*EXIT can be set to handle exit() statements (for embedding Perl 6) + Efficiency: + Auto-generated accessors/mutators use less memory and are faster + Most Blob|Buf related options use less memory and/or are (much) faster + Same for much of the native array support and IO reading operations + Many Parameter/Signature related options are much faster + Punning a role is much faster + Modules can now be shared between rakudo versions + Reordering "use lib" statements made NativeCall tests 3x as fast New in 2016.02 + Fixes: + Many memory leaks fixed in MoarVM + Fix several issues with "require" + .perl of an iterated Seq (RT #127492) + Set.hash now returns an object hash (RT #127402) + Use the order of arguments in usage display, rather than hash order + Exception.fail now dies reliably outside of a routine + fix problem with Str.split with multiple overlapping needles + Map.Hash now correctly separates from the Map + Fix roundtrip issues of Instants + Specifying ::a now gives proper compile time error (RT #127504) + Rakudo jars are now installed in the proper location + Enums with a type object now fail with an NYI error + .first(:end) on uncached iterators no longer fails + Additions: + Buf.unshift/Buf.prepend + DateTime.new(y,mo,d,h,mi,s) fully positional candidate + Can now uninstall distributions + Date/DateTime now fully subclassable + REPL now supports multi-line statements (experimental) + Efficiency: + Str.trans can now be up to 160x faster + @a.chrs noq 3x faster, chrs(@a) now 9x faster + Many Map/Hash related functions can be up to 2x as fast + Magic increment/decrement on strings 2x as fast + Some percentages improvement in object creation, phaser handling, summing, creating failures. + Object hashes re-implemented using 1 internal hash, instead of 2. This results in about 10% less memory usage, and a few % less in CPU New in 2016.01 + Fixes: + Chained .grep calls on Supply fixed (RT #127297) + Fixed interaction with perl6-debug and precompilation that resulted in an endless loop + re-enabled warning when smart-matching against a True or False literal + Fixed internal error when reporting certain type errors (RT #127207) + Fixed rare "duplicate definition of symbol" errors (RT #127107) + Fixed interpolating of pairs with non-key strings into signatures + Fixed error when smart-matching Seq against a Set (RT #127166) + Improved error message when smart-matching against an S///-expression + Fixed bad interaction between EXPORTHOW and multiple declarations (RT #126566) + Fixed various issues regarding precompilation + Improved accuracy of Complex.sqrt + hyper now preserves order of results, as designed + Range.sum on an empty, numeric Range is now 0 + Fixed Promise.allof() with an empty list of promises (RT #127101) + Improved message on premature virtual method call (RT #127097) + Better error message for module load failures of types that are part of the setting + Support for Readline in addition to Linenoise 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 + \r\n (Carriage Return/LineFeed) is now a single (synthetic) grapheme + Unicode support adheres to Unicode Annex #29 + New IO::Handle.nl-in now allows multiple line-endings to be set + New IO::Handle.nl-out allows you to set line-ending used in IO::Handle.say + New IO::Handle.split/comb, same feature set as Str.split/comb, but lazy + IO::Handle.seek now accepts new SeekType enum values as 2nd parameter + New $?NL contains the output new-line character(s) for the current system + New 'use newline' pragma allows setting of $?NL + New List.head/tail methods for easier getting first/last N elements + New List.repeated for only getting repeated values in a list + Str.encode now allows :replacement parameter for unencodable sequences + Str.split now accepts multiple strings to split on + Str.split now accepts :v, :k, :kv, :p, :skip-empty named params + Str.comb(Int:D $n) candidate allows for combing string per $n characters + New Range.int-bounds returns first/last value for integer ranges + EVAL now passes on named params, to allow for customised EVAL subs + Auto-generated meta-ops vivified by referring to them, instead of executing + Unicode quotes are now also allowed in regular expressions + Can now coerce to generic types in parameters + Can attach adverbs to variables + Illegal assignment of different Numeric values now caught at compile time + &nextcallee implemented, which returns the routine that nextsame would invoke + Deprecated + IO::Handle.nl should either be IO::Handle.nl-in or .nl-out + IO::Handle.seek with a numerical value for 2nd parameter + Str.split( ... :all) should be written as :v + Fixes + RT #74414: the multi dispatcher now treats "is rw" parameters as tighter matches + RT #125123: improved error message for type check failures in int-typed arrays + RT #126436: improved error message for missing required attributes + multi submethods aren't inherited to subclasses + leading escape sequences representing whitespaces aren't stripped anymore from heredocs + Speedups: + [+] and sum + Blob.subbuf + List.sort + List.roll + List.rotate + List.reverse + IO::Handle.getc + Build system + New options --sdkroot and --sysroot to Configure.pl to support cross builds New in 2015.10: + Features + We are now officially in beta! + There is now an infix:<.> operator that does method calls with slightly looser precedence than the postfix unary method call. + Definite return values are now allowed, and force final statement to sink + Types with type smilies (like 'Int:D' and 'Int:U') are now first class, and supported in constraints for variables, for example + New pragmata 'use variables :D', 'use attributes :D' for defaulting type constraints to ':D' + The 'constant' declarator now supports syntactic constructs, so you can alias with 'my constant &infix: := &infix:<+>;' + New operator 'infix o' for function composition + New method 'produce' for triangle reduce + 'fc' for Unicode-correct case folding implemented + '' assertion in regexes implemented + Methods 'file' and 'line' in 'Code' point to the location of the declaration + grep now accepts :k, :v, :kv, :p attributes + first now accepts :k, :v, :p attributes + first also accepts :end attribute to indicate searching from end of list + 'is equiv<+>' as shortcut for 'is equiv(&infix:<+>)'. Same for 'tighter' and 'looser'. + 'Supply.throttle' for rate-limiting + 'Hash.append' added, now that Hash.push doesn't flatten + Internal methods ZEN-POS/ZEN-KEY added, for handling zen-slices + Promise.start now passes on any extra parameters to async block + Use of comma in sink context now distributes sink to its parts + Attribute containers may now have defaults + The new .self method is the identity method on anything + Negative integers are now allowed in the parameter slot + List associative operators can now be autoprimed, including Xop and Zop + Incompatible Changes + Array.push is now used for pushing one element (mostly); Array.append exists for pushing multiple values. Same for 'unshift'/'prepend' + Basic arithmetic operations ('+', '*', '-', '/') on Range objects that shift or scale the end points while maintaining exclusions + 'is rw' now only works on scalars (was a noop), and actually requires a writable container. Parameters of the form '\x' enable the old behavior + The v notation now allows alphabetic components: v1.2.beta. (Incompatible because method calls on a version must be protected by \ or () now.) + 'use v6b+;' notation is now recognized and enforced + Many list functions no longer flatten, or use one-arg flattening only + The sequence operator no longer flattens sublists, so you must use slip to get that effect + The precedence of infix:<.=> is now tighter to match new infix:<.> + Smartmatch with List now recursively uses smartmatch + Smartmatch with list now globs using '**' rather than '*' + callwith/nextwith no longer flatten + Speedups: + Many built-in methods that return iterables are now much faster + 'Bag' and 'Mix' are now faster + Rat addition/subtraction is now faster due to lazy reduction when consistent denominators are used ("cents stay cents") + Fixes: + Better error messages when comparing version strings with numbers + Several error messages that were lacking line numbers now include them + Anonymous types now compare correctly under 'infix:<===>' + Fixed 'once' block semantics (RT #126293) + A dying 'LEAVE' block doesn't prevent other 'LEAVE' blocks from running anymore + 'Str.tc' now does an actual Unicode title case operation + polymod had not been GLRified yet + List/Supply.squish did not properly handle single element lists/supplies + Several fixes to the REPL, e.g. with regards to completions + with/without now topicalize properly + Fix usage of match variable in replacement part of substitution + ».[1;1] (hyper on multidim subscript) now works + Methods map, push, pop, shift, unshift, append, prepend now properly marked as nodal + Attempt to smartmatch with S/// now warns + grep { /foo/ } now dwims again + Operator names now canonicalize internally to legal Perl names + Reduction ops now generalize to N-ary functions + Extra list comma is now allowed before any statement modifier + Various multisubs now report .arity more accurately + Exceptions can now correctly report the Nil type + Deprecations: + grep-index() deprecated in favour of grep(:k) + first-index() deprecated in favour of first(:k) + last-index() deprecated in fevour of first(:end,:k) New in 2015.09 + Features + Great List Refactor + New slurpy parameter, +args or +@args, to allow for one-argument style binding + New with/orwith/without conditionals allow you to check for .defined but topicalize to the actual value returned + New 'supply', 'whenever' and 'react' blocks for easy reactive programming + Mu.return implemented: allows for ".return with $foo" + Cool.indices/indices() expands on Cool.index/index() functionality + Callframes now allow easy introspection of associated Code object + Test.pm now has a 'does-ok' function for testing role conformance + '$¢' in grammars now refers to the current cursor + All Unicode digits can now be part of literal numbers + 'val()' and allomorphic types implemented + Most European quoting styles are now supported + The parser now detects and reports possible runaway quotes + New $[...] and ${...} constructs allow prefix itemization + 'dd' now displays variable type + Fixes: + Using a Range with an infinite .max now works on substr()/.substr + Parameter aliases are now handled in MAIN subroutines + Fixed typo about environment access in IO::Spec::Cygwin.tmpdir + Blocks like { .foo } are no longer considered to be a Hash constructor + Propagate ignorecase into subrules of regular expressions + eqv no longer defaults to === semantics, but snapshot (via .perl) + A constant declaration now pays more attention to its sigil + The .gist and .perl methods can now deal with self-referential structures + andthen and orelse are now topicalizers as specced + Fixed CompUnit.load, which is what use/require uses under the hood + Incompatible changes: + Creating constants with a ? twigil has become a NYI for now + No longer allowed to create dynamic constants with "my constant $*FOO" + Forbid to use the very same variable to init itself directly in declaration + Parcel is no longer a type, use List instead + 'is parcel' trait is now 'is raw' + .gist now puts brackets around lists and arrays + IO::Handle::lines no longer returns an empty last line + The 'Enum' type is gone; use 'Pair' instead. + Deprecations: + All Deprecations removed in preparation for Christmas release + NativeCall: + Added support for calling into C++ libraries and calling methods on C++ classes New in 2015.07 + Features: + Cool.substr(-rw) and &substr(-rw) now also accept a Range + Added trait "is required" on class attributes + Parameters like :n($n) are presented as :$n in .gist + &?ROUTINE and &?BLOCK + Conversion forms now understand :16(':8<377>') and such + &words implemented (to completement .words) + Numeric comparison ops (== > etc) for DateTimes + Fixes: + ENTER phaser now can be used as an r-value + Allow %{Type} as a way to say Hash[Any,Type].new + Several issues with the use of ';;' in signatures + Issues with regexen throwing an exception (RT #62086 & #72440) + samewith() now also works in subs + Calling the .clone method with alternate values no longer changes original + Various fixes and optimizations on List.splice + .grep and &grep now consume multiple elements for many-param blocks + Issues with precedence limit checking in EXPR fixed + EVAL now pays attention to languages in the compiler registry + Incompatible changes: + my Type $a is default($value) is now compile-time checked + my $a is default(Nil) only works on untyped (Mu) variables + Can no longer (roulette) assign to Whatever slice of a hash + Emit warning when \$ \@ \% \& are used to create a Capture + Now illegal to use a contextual ($*c) before declaring it in a block + EVAL :lang instead of for consistency with use :from + Deprecations: + $*PROGRAM_NAME in favor of $PROGRAM-NAME + $*EXECUTABLE_NAME in favor of $EXECUTABLE-NAME + pipe() in favor of shell() or run() with :in, :out or :err New in 2015.06 + Features: + Lexical pragma 'use trace' now outputs statements on STDERR + $=finish now contains text after first =finish/=for finish/=begin finish + __END__/__DATA__ now marked as obsolete Perl 5 features + Added :as named param to .classify / .categorize + EVALFILE added, for evalling source in a file + Implemented 'quietly' statement prefix to prevent warnings being issued + MinGW (Windows with gcc/gmake) is now also supported besides MSVC + Implemented 'has Type method' + Implemented Buf.push + Implemented S/// (returns the new string rather than in-place substitution) + Implemented X::StubCode for .../!!! code + Add :createonly to rename() + Fixes: + (10e6).pick/roll no longer build the whole list to pick a value + Regex.gist/perl return source of regex + start now takes a statement also, or a block (as before) + .push/.unshift on typed arrays now create the right type of container + Throwing a Failure counts as handling it + Incompatible changes: + DateTime default timezone format is now +HH:MM (used to be +HHMM) + "".IO / IO::Path.new("") no longer legal, use "." for current dir + next/last/redo don't allow expressions to be evaluated anymore + sign(NaN)/NaN.sign is now NaN + Stubbed-out code (via .../!!!) no longer results in X::AdHoc + Deprecations: + Using start as a sub with parentheses, e.g. start( { ... } ) + open(:p) New in 2015.05 + Features: + NFG, NFC, NFD, Uni + Implemented unicode property pairs with explicit arguments, e.g. <:NumericValue(0 .. 1)>, <:Name(/LATIN/)> etc (MoarVM only) + :m/:ignoremark implemented (now that we have NFG) + Implement <&foo: $arg>, <&foo($arg)> and my $a = "alpha"; /<::($a)>/ + List/Supply.rotor expects a list of Pairs (elems|elems => gap) + Added much faster List.pick(*,:eager) variant + Implemented CLIENT:: (nearest CALLER:: from different package) + Normal stacktraces no longer include references to code in settings + RAKUDO_BACKTRACE_SETTING to *do* include code in settings + RAKUDO_VERBOSE_STACKFRAME environment variable shows source lines + Warnings now show file/line unless the end with a newline + Implemented "is nodal" for signalling behaviour under hypers + Rudimentary tab completion available via the Linenoise module + Incompatible changes: + The readline integration that existed on the VM level has been removed; it now exists as a module. To restore readline operations in the REPL (ex. history, line control), install the Linenoise module via Panda + "unit" declaration needed for blockless packages + Various API changes for the Great List Refactor, such as... + 'for' loops not longer flatten; use 'for flat' for that + .map no longer flattens, map as a listop does. Use .flatmap to get the old behavior + Likewise other methods that used to flatten their invocant no longer do: all, any, one, none, unique, squish, min, max, minmax, classify, and categorize + Nil no longer iterates like the empty List. Use () or Empty instead. + Hashes no longer maintain insert order on Moar (on JVM they never did) + @*INC now contains strings (again), rather than CUR objects + Item seperator in INC spec is now "," + Type / info seperator in INC spec is now "#" + .pick($n)/roll($n) now always return lists, even when $n == 1 + $?FILE is now always an absolute path + Variable will init/post/compose throw NYI instead of silently doing nothing + The "is cached" trait no longer works on methods, throws a NYI instead + Deprecations: + Method .map should be used instead of .for + List/Supply.rotor now *must* have elems and gap specified + Test.pm functions are now kebab-cased (e.g. throws_like -> throws-like) + in regexes, avoid non-significant whitespace between alphanumerics + Unhandled Failure leaks are now warned about if detected by DESTROY + Fixes: + Many race conditions, specifically wrt to role specializations + Hashes use much less memory on Moar + my $a will begin/enter/leave/keep/undo/first/pre now set $_ properly + List.roll(Inf) now knows it's infinite, so is lazy + The REPL is strict by default now, that leaves only '-e' lines to be lax + Undeclared variable compile time error made clearer + IO::Handle.lines(:eager)/.words(:eager) now properly eager again + 'earliest' now handles remaining channels without specific handlers + Int/Rat ** -Int now generates a Rat if possible, else a Num + IO::Path.resolve now returns IO::Path as specced + CALLER now produces consistent results in the dynamic scope of implicit protos + A regex may now be used as the smartmatch of a sequence operator + Fix /a ~ (c) (b)/ capture order bug. + map <:alpha> in regexes etc to proper lookup on JVM + site/lib is now in the C library (.dll/.so/.dylib etc) search path + Fix scoping bugs with statement modifier for and given. + Make { 1 R=> 'a' } and { %*h } construct hashes. + Fix lexical context of regex interpolations + Various list ops now report .is-lazy correctly + Speedups: + generating backtraces is now lazy, improving the speed of e.g. warnings + Make List.pick about 3% faster, List.pick(*) about 7% faster + Implement new @*INC handling (about 30% faster startup time) (bare startup time is now below 100 ms on some machines) + NativeCall: + Implemented CUnions which map to the union C type definition + Implemented HAS declarator for attributes to mark it embedded into the CStruct or CUnion New in 2015.04 + Incompatible changes: + Installation directory layout changed: it now uses $PREFIX/share instead of $PREFIX/languages + "0" (0 as a string) is now True, no special-casing anymore + an Int() coercion type in a multi now creates two candidates: Any and Int + Fixes: + try now implies "use fatal", so failures are not leaked + "use fatal" now only works in its scope, and not in deeper ones + don't constant-fold Failures + throws_like will EVAL code in context of caller + pragma's like "strict" can now also be called with -M on the CLI + once a List is infinite, it will stay infinite (fixes several hangs) + can now slice an Infinite list into a finite slice + can now slice a finite list into an infinite slice + adverbs are now allowed inside a ternary + auto-generated accessors will not show up in backtraces anymore + $_ now defaults to Any, rather than Nil + intuited iterators no longer bypass endpoint if no exact match + intuited iterators may also skip literal values if endpoint is lower + intuited iterators beginning/ending with same length now according to spec + say now observes the .nl setting + exceptions in BEGIN blocks and constant are now handled better + binding now works again in the REPL + various other REPL fixes + \foo variables work properly in EVAL + declarations like my (Str $ing, Int $eger) correctly enforce types + detect and complain about placeholders in attribute initializers + use of | prefix in the wrong place now complains at compile time + \(...) capture constuct handles nameds and | correctly + regex interpolation now uses cursors instead of scanning + correct line numbers are reported for faling tests + Deprecations: + the RC release in September will remove *all* deprecations + "use nqp" now required for silent use of nqp::ops + Features: + native arrays + 'bit' and 'byte' native types + starts-with/substr-eq/ends-with for comparing strings inside other strings + first steps towards generic lexical pragma's (e.g. soft, strict, nqp) + basic implementation of Uni, NFC, NFD, NFKC, and NFKD on Moar backend + Uni.Str coercion produces an NFG string + chop now takes optional number of characters argument + where constraints on variable and attribute declarations + dists are installed into a database-like way by default (via panda) + 'is rw' parameters implemented for native subs (they get passed as a pointer) + complex and rat literals now work inside of a <> quote + attempting to bind a Failure now tells you what was in the Failure + reduce() now pays attention to associativity (which is now part of the op) + can now reduce ([Z]) with list infixes over an arbitrary number of lists + use Foo:from supported when Inline::Perl5 is installed + EVAL $code, :lang supported when Inline::Perl5 is installed + Speedups: + Str.codes/chars/uc/lc/tc/tclc/ord/flip about 25% faster + List.pick about 10% faster + Mu.clone about 8% faster + make xx about 1.8 times faster + several speedups in matching + numerous Num.Rat optimizations: 6.5x faster New in 2015.03 + Incompatible changes and deprecations: Any code *calling* the old method names, will be given a deprecation warning, and will continue to work. Any module that *implements* MMD candidates for any of these methods with their old name, will probably break. Please start using the new names as described below. + renamed internal hash/array/code/* methods: - OLD NEW - at_pos AT-POS - exists_pos EXISTS-POS - delete_pos DELETE-POS - assign_pos ASSIGN-POS - bind_pos BIND-POS - at_key AT-KEY - exists_key EXISTS-KEY - delete_key DELETE-KEY - assign_key ASSIGN-KEY - bind_key BIND-KEY - invoke CALL-ME - Supply.on_demand Supply.on-demand - Supply.schedule_on Supply.schedule-on + renamed traits - hidden_from_backtrace hidden-from-backtrace - hidden_from_USAGE hidden-from-USAGE + Deprecated use MONKEY_TYPING for use MONKEY-TYPING. + Incompatibility change: spaces are no longer allowed in operators. + Disallow redeclaring constants in the same scope + Throw redeclaration error for duplicate type capture + Deprecate IO::Handle.input-line-separator for .nl + Remove parrot support from Rakudo. + Don't print deprecation messages if RAKUDO_NO_DEPRECATIONS env var is set + Features + Allow Buf.AT-POS to return an l-value. + Implement method ^foo($) { ... } syntax. + Implemented PairMap (the simple case only, for now). + Implemented .antipairs (pairs with value => key). + Implemented .pairup for creating pairs from lists. + Implemented LEXICAL, OUTERS and CALLERS pseudo-packages + Implemented UInt (sub)type and coercer. + Add a array[T], usable for native int/num (MoarVM only for now) + Other native improvements, e.g. my int $a; $a++ + Smart quotes (as in “foo”, ‘bar’, ‚baz’ and „zap”) now also supported. + Improve and test support for Listy types in JVM Interop. + Hyper-infixes (like »~») are faster and have more features. + Make token prefix properly compete with term in LTM + not() and so() are functions as well as prefixes. + substr-rw() now accepts the same range of parameters as substr() + keywords now require whitespace (unless shadowed), which allows: my \if = 42; say (if) if if; # now says 42 + Implement IO::Path.resolve on r-m/POSIX + Catch P5ish use of $/ + Fixes + Catch wrong attribute usage in a regexes. + Fix compiler warnings on OS X / JVM backend + bare say now complains about no valid arg + Make .invert no longer infiniloop + Make List.kv completely flatten its values + Update error message for $] to use $*PERL.version + Fix JVM runner generation on Windows. + fix $*KERNEL.arch for raspbian, ugexe++ + Make $?TABSTOP immutable + Make CALLER::<&?ROUTINE> work + Errors like "expected Array[Str] but got Array[Str]" have been fixed. + Optimizations + Make my int/num @a = Range about 1000x faster + Make generic Str.subst between 5 - 10% faster + Make s/// up to 25% faster (for many changes) + Make Bool.pick and Bool.roll up to 2x faster + Make Bool.pick()/roll() another 10% faster + Make substr(-rw) about 10% faster + substr("foo",1) 2.5x faster + substr("foo",1,2) 6x faster + substr("foo",*-2) 1.5x faster + substr("foo",0,*-2) 1.5x faster + Make %h = 42 about 10% faster + Test.pm changes + Several improvements in Test.is() wrt to handling type objects and whitespace. + Add simple use-ok implementation + NativeCall.pm changes + 'is native' will also accept Callables to allow runtime library detection + Implemented nativesizeof(T) + Add typed Pointer type as replacement for OpaquePointer + Throw exception for wrong arity in native subs New in 2015.02 + Overriding invoke/postcircumfix:<( )> for type coercions (ex. MyType(...)) now passes the function arguments as-is, rather than just passing a Capture containing them + optimizations to slices with adverbs + improved error messages from sprintf and fmt + improved error message when trying to inherit from a class that isn't composed (like a stub) + Proc::Async polished (improved error reporting, relaxed type constraints) + LoL assignment is now autovivifying + Semicolon/"rest of file" form of the MAIN sub implemented + Parsing for infixes like "$foo !and $bar" or "$foo !&& $bar" fixed + Coercion syntax for parameters: sub foo( Str(Any) $x ) { ... } + Str(Any) as a term now parses as a coercion type + Foo() works as a coercion type shortcut for Foo(Any) + Metaop "=" now respects the precedence of the op it's meta-ing + Enable term definitions via "my", e.g., "my \term:<∞> = Inf" + Added "polymod" method on numerical values + Made simple Str.trans / tr///, Str.subst about 20x faster + File test operators now follow symlinks on systems that support them + New method Rational.base-repeating, optional precision argument for Real.base + Blob.bytes now returns actualy byte size, even for non-byte blobs + "6;" at unit start is no longer a way to say "no strict;" + Anon variables in sink context warn now correctly + Buffer types can now be passed to C functions via NativeCall + C types like "long" that depend on the architecture are now handled correctly + NativeCall is now shipped with rakudo, because it is coupled too tightly + Allow "constant" and "has" declarations to be initialized with .= + Types constructed for mixins ("does" and "but") are now cached, giving a 10x speedup on repeated mixins of the same role to the same type and cutting CORE.setting size down (by 700KB on MoarVM, for example) + Made .^can(...) aware of submethods + Fixed a pre-compilation bug when a multi-method in a subclass was installed in a cloned proto-method inherited from the base class, then called at BEGIN time New in 2015.01 + New simple way of creating an object hash: :{} + Str.substr-rw was omitted before, it isn't anymore + The loop ^1000 optimization is working again + Pair.gist has been simplified (a => 42, rather than "a" => 42) + Exporting an Enum now also exports its values + Proper error handling for a placeholder that has already been used as non-placeholder in the same scope + Sub form of 'unique' introduced, 'uniq' deprecated + Supply.for deprecated in favour of Supply.from-list + All deprecated features will be removed with 6.0.0 (sometime in 2015) + Startup on the JVM has improved by 20% + Many improvements to Java interop for the JVM backend + Several precomp issues have been solved + Better error messages for die(Failure) + Fixed CATCH/CONTROL blocks in the program mainline + Substitution now supports assignment meta-op, e.g. s[\d+] += 2 + Many memory and CPU optimizations New in 2014.12 + Flakiness on OS X has been fixed + Support for Increase/Decrease, bless(*,...) removed, were deprecated 1+ year + Method FALLBACK implemented + $str ~~ s/// now returns a Match or list of Matches + Updated List smart-matching to latest design + $*DISTRO and $*KERNEL updated ($*DISTRO now actually report the Linux dist) + Most, if not all, signals are now supported everywhere (MoarVM only) + Configure.pl: Fixed check for outdated nqp-m; warn on missing --prefix + Optimizations of integer division and Rat construction + Added Metamodel::Primitives, to open up more meta-programming possibilities (publishing method caches, completely custom meta-objects, etc.) + Support for closure parameter signatures + Implemented chained sequences + Implemented longest literal LTM tie-breaker + Calling "close" on a Supply will now close all of its taps + Added "extension" method to IO::Path + Fixed bare "slurp", it was broken in 2014.11 or before New in 2014.11 + using a constant negative subscript now dies at compile time + better wording for runtime negative index failure + force calling method for <.foo> even if sub foo exists + fix tie-breaking issues with longest literal matching + make List.last-index non-lazy (as the whole list needs to be reified anyway) + introduce IO::Handle.slurp-rest for slurping rest from handle + method 'for' as an alias for 'map'. Map will stop flattening the list eventually, 'for' remains as it is now. + method 'unique' as a successor for 'uniq' + warn about clashing enum aliases, and also poison these aliases New in 2014.10 + unstrict mode now default with -e + use strict / no strict implemented (but -Mstrict does not work) + Implemented Supply.lines/words + Implemented IO::Handle.words + Updated chdir() to spec + Implemented indir( $dir,:test,{...} ) + Implemented tmpdir($dir) and homedir($dir) + Implemented IO::Path.all: "foo".IO.all() is True for r/w file + IO::Path.modified|accessed|changed now return Instant, according to spec + Fixed ordering issue with IO::Socket::Async + Str.words is now lazy by default + Str.words no longer returns the word if there is only one word: this behaviour was unspecced and apparently used internally only. This old behaviour is still available by specifying the :autoderef named parameter. + method .exists/.delete have been removed after 1+ year of deprecation + performance improvements in Str.trans and tr/// + fixed Str.trans and tr/// for anchored regexes + Bool.pick/roll (without parameter) now ~20x faster + Numeric.round (without parameter) now ~4x faster + Supply.more has been deprecated in favour of Supply.emit (as per spec) + Deprecations will now tell when they were introduced, and will give a release version in which the deprecated feature will be removed. New in 2014.09 + ./perl6 --profile for MoarVM, generates HTML profile output, including spesh/JIT info + Workaround OS X make bug for MoarVM + Make new LOLLY syntax the default + support for submethod DESTROY (MoarVM only) + optimizations to Str.words, Str.lines, IO.lines, chomp, and return + Str.lines and IO.lines take :eager for still faster performance + added experimental support for Proc::Async, MoarVM only for now + Promise.keep/break now default to True/False + support for S26-style declarative (#| and #=) comments + expectations are reported before result in test failures + bare 'say' is now a parse error + range *..* is now allowed (and means -Inf..Inf) + AST.Str now prints the correct source for operand ASTs + 'π' implemented as synonym for 'pi' + support for :temp/:let declarators in regexes + Reduced memory size of CORE.setting, improved startup time + startup (on Moar) 15% faster than p5 w/ Moose + fix issue with $*EXECUTABLE pointing to an non-existing interpreter on parrot New in 2014.08 + print file/line annotations for warnings also on moar and jvm + fixed reduce/infix function syntax [[&foo]] LIST and ITEM [&foo] ITEM + can now call exit() in END blocks without hanging or affecting END block execution + remove speed penalty of large ranges in character classes + make LF, FF, CR and NEL available as character names + fixed negated character lookup in regexes \C[...] + quote words syntax splits on breakable space only + duplicates in character classes warn now, like in accidently quoted items <[ '/' ]> + fixed (s)printf regression with "+" and " " flags + allow a DateTime to smartmatch against a Date + fix %a{5}:delete anomaly, "as Str" is your friend + die / note now say "Died" / "Noted" when not given anything + ∅ is finally recognized as the empty set + more work under the hood to get in line with S11 / S22 + Str.indent() now treats its arg as an Int where appropriate + Restructure the QAST classes + Add LoL candidates for postcircumfix:<[ ]> and postcircumfix:<{ }> + Pass --moar-options configuration to NQP's Configure + Add .new candidate for creating a Date from an Instant + Fail when a Boolean is used as the matcher for &grep, &grep-index, &first, &first-index, &last-index, and the corresponding methods + Implement cmp_ok in Test.pm + Add HyperWhatever / ** + Add method invoke as the preferred way to write what was method postcircumfix:<( )> + Warn when a Code object is coerced to Str + If the LOLLY envar is set, have (;;), [;;], etc., turn into LoLs. Otherwise, parsefail + Add SEQ(a; b) to emulate the old behavior of (a; b) + Make &infix: many times faster + NaN === NaN (but still NaN != NaN) + fix multi-dimensional slice assignment + Add .note() method to Mu New in 2014.07 + require and build parrot 6.6.0 + Cool.eval and eval() are now removed + assigning a single itemized hash to a hash is now DEPRECATED (my %h = {...}) + .hash now turns an itemized hash into a hash + added unpack directives "a" and "Z" + subbuf-rw specced and implemented + Supply.zip-latest specced and implemented + minute value is optional in Timezone offsets in DateTime.new(), also a colon to delimit hours/minutes is now optional + file copy and creation operations on the MoarVM now give default file permissions of 0666 + the tr/// operator is implemented and has the proper return value + improved string handling for MoarVM backend + fixed class A { my $.x = 42 } scoping on MoarVM + removed hack that kept (|)= & co from working + re-arranged infixish actions to support [[*]]= etc + optimized CompUnitRepo::Local::File + optimized takedispatcher to cleardispatcher + all backends now allow C pointer arithmetic and casting of pointers to Perl 6 types (this functionality is exposed by NativeCall) + made block inlining a level 2 optimization + small optimizations to number parsing + fixed Label.gist + fixed 'fail' so it also prints a backtrace + fixed a repeat until code-gen bug + added CompUnit.name and fixed .perl + removed hack for $Inf/$NaN: constants Inf/NaN are exposed since a while + made initial/max threads introspectable + naive implementation of IO.umask + make .WHICH also work on type objects + throw a X::Subscript::FromEnd for @foo[-1] + throw X::TypeCheck::Binding on all backends (was MoarVM only) New in 2014.06 + say/note now a little faster for single Str (which is most common) + an initial implementation of S11 (Compilation Units) is now available + .IO.{d|s|z} are now about 40% faster and return Failure if path doesn't exist + $*DISTRO now works correctly on OS X (with name "macosx") + $*KERNEL now works correctly on OS X (with name "darwin") + initial implementation of $*USER and $*GROUP + initial implementation of Supply.zip-latest + implement dummy Lock (for $lock.protect( {...} ) ) on parrot + @*INC now only contains elements for actually existing paths + more work on allowing slangs transparently (such as "v5") + IO::Socket::Async now also works on JVM + can close tap to stop listening on a socket + implement Supply.on_demand, for making on-demand supplies + fix race condition in async socket reading + can now also bind to dynamic variables + LAST phaser used to fire when not actually iterating, now fixed + (Set|Bag|Mix).pairs now return immutable Enums + (Set|Bag|Mix)Hash.pairs no longer allow changes feeding back + optimize :a(:$b) and attributive binding + optimize IO::Path.contents + optimize push, unshift, and comb + assorted optimizations to Junction construction and dispatch + optimize no-args case of @foo>>.bar + implement :42nd colonpair syntax + include correct version information in perl6-debug New in 2014.05 + asynchronous timers on MoarVM backend + added or updated many Supply methods: act, batch, categorize, Channel, classify, delay, elems, flat, grab, last, live, max, min, minmax, merge, migrate, Promise, reduce, reverse, rotor, sort, squish, stable, start, uniq, wait, zip + add list functionality to 'on', as with new S17 spec + added .Supply coercer + added IO::Notification.watch_path / IO::Path::watch which return a Supply of file system changes + added signal() which returns a Supply of Signals (such as SIG_HUP) + added IO::Socket::Async.connect, returns a Promise with a IO::Socket::Async + added IO::Socket::Async.send, returns a Promise with success / failure + added IO::Socket::Async.chars_supply, returns a Supply with chunks + added first-index, last-index, grep-index subs/methods + Pair.key was erroneously implemented "is rw" + added "subtest code, desc" to Test.pm (inspired by P5's Test::More) + added "throws_like" to Test.pm (formerly of Test::Util) + Test::Tap::tap_ok and throws_like are now 1 test (using subtest) + BagHash-- on non-existing key no longer fails (as per S02 spec change) + (Set|Bag|Mix)(|Hash) now have a .fmt method + deprecate $*OS, $*OSVER, $*VM, $*VM, $*PERL $*PERL... + added $*KERNEL, $*DISTRO, $*VM, $*PERL as full blown objects + .delta (by recent spec change) in Date/DateTime now instead spelled .later and .earlier + TimeUnit enum removed; string named and positional arguments used instead + optimized grep,grep-index,first,first-index,last-index with seperate candidates for Regex and Callable. + "use v5" is no longer a noop, but actually tries to load the "v5" module (soon available as part of Rakudo*) + implemented labeled loops and throwing of labels as payload + added various optimizations, like optimizing out %_ when unused New in 2014.04 + significant performance enhancement for MoarVM, spectest running 20%+ faster + S17 (concurrency) now in MoarVM (except timing related features) + winner { more @channels { ... } } now works + fixed pb with Parcelness of single element array slices with adverbs + implemented univals(), .unival and .univals (on MoarVM) + make .pick/.roll behave sanely on Enums + fixed Str.samespace and ss// + added .minpairs/.maxpairs on (Set|Bag|Mix)Hash + added Bag.kxxv + Capture.WHICH implemented so that identical Captures have the same .WHICH + Naive implementation of "is cached" trait on Routines + Hash.perl now randomizes key order, while Hash.gist sorts + NativeCall passes all its tests on all backends New in 2014.03 + Fix suggestions for unknown routines when specified with '&' + Match sigil in suggestions for unknown routines depending on specification + Improve suggestions for 'length' and 'bytes' being banned in Perl 6 + fixed for-loops to be properly lazy + Zop= now works + numerous Pod parsing and formatting improvements + uniname, uniprop, and unival implemented on MoarVM backend + @ as shortcut for @$, % as shortcut for %$ + improved "unable to deduce sequence" error message + duckmap, deepmap implemented + list infix reductions no longer flatten + X and Z meta ops treat [] as items + unary hyper subscripts (@array>>.[0]) now work + fixed problem with .=uniq and .=squish New in 2014.02 + $*INITTIME implemented + improved code generation for loops on the JVM backend + eager and lazy statement prefixes + statementlist-level for-loops are now assumed to be in sink context + improved unspace parsing + don't itemize make's ast argument + allow definition of custom postcircumfix operators + :allow in pod code blocks works now + Configure: git protocol is now configurable + smartmatching against an IO::Path does the right thing now + perl6-debug-* is now installed by rakudo; the user interface is still a module available from the ecosystem + lots of improvements for moarvm, such as client and server socket support and opening pipes/subprocesses + finished NativeCall support on the JVM New in 2014.01 + Use .narrow on Numeric to coerce to narrowest Type possible + Can now supply blocks with multiple arguments as sequence endpoints + rule no longer exists + The eval sub and method are now spelled EVAL + Method calls and hash/list access on Nil give Nil + No longer need to separate adverbs with comma in argument lists + div on parrot will now always round towards -Inf + Added support for MoarVM; passes >99% of the spectests that Rakudo JVM does + Fixed gather/take stack overflow bug in JVM backend + Fixed closure in regex bug on JVM + Fixed some line number reporting bugs on JVM + Optimized Enum($value) coercion + Regexes: Aliased assertions now properly create sub-captures + Regexes: Improved detection/reporting of null patterns + Implemented IO::Async::File.spurt (JVM only) + Implemented Setty.kv and Baggy.kv + Use a global ByteClassLoader rather than one per class. (JVM only) + Implement more parts of NativeCall for the JVM New in 2013.12 + The Whatever Star now works inside chain operators like comparisons + Private attributes from roles are now visible in the classes they apply to + Use invokedynamic in some places on the JVM. + Memory improvements in ListIter + Faster method List.combinations + Simple lookahead assertions in regexes are optimized + Regexes do less superfluous scanning New in 2013.11 + Many concurrency primitives harmonized with new S17, but still pretty fluid + Refactored build system that allows building rakudo on both backends in the same place + Order::Increase/Decrease are deprecated. Please use Order::Less/More. + Leading whitespace is ignored for :sigspace + Better null pattern detection in regexes + The "gethostname" function implemented + Warn when private attributes are a marked rw or readonly + "is DEPRECATED" trait now produces report when process finished + Parcel.rotate implemented + Performance optimization: unfold junctions in 'when' clauses + capitalize/.capitalize have been removed, as per docs/deprecations + improved run()/shell(), these return Proc::Status-objects now + The ... range operator can now be chained: 1,2,3 ... 10,15,20 ... 100 + various other bug fixes, optimisations and additional tests New in 2013.10 + postcircumfix {} and [] are now implemented as multi subs rather than multi methods. This should allow for better optimization in the future. + Add support for "is DEPRECATED", making it easy for early adopters to stay current. + Track multiple spec changes for various container classes. + Greatly reduce object creation during Regex parsing. + Various portability fixes. + qx// and run() now auto-quote correctly + Allow #`[...]-style comments in regexes + unlink() behaves like P5's, it deletes write-protected files on windows New in 2013.09 + candidate argument to bless removed (per spec change) + @a.VAR.name and %h.VAR.name implemented + The $var.++ and $var.() syntaxes work + Lots of improvements on the Set and Bag types + [op]() with relational operators vacuously return True + tr/// implemented + Sockets on JVM implemented + sleep(), sleep-time() and sleep-till() updated to spec New in 2013.08 + "is default" traits on variables, $/, $!, $_ are default Nil + "is dynamic" traits on variables, $/, $!, $_ are dynamic + "of TypeObject" trait on variables + .VAR.default/dynamic/of return the state of these traits + Assigning Nil, calling undefine() restores the default value + .WHAT more accurately returns a type object for specifically typed cases + Option --gen-nqp for ConfigureJVM.pl + Include file name in parser errors + Parse labels, tr/// (both don't do anything useful under the hood yet) + CALLER::<$var> now only works on dynamic variables, as per spec. + Improvements to Threads, including Channel and KeyReducer (JVM only) + Asynchronous file reading (JVM only) + Improved JVM interop, including 'use :from' (JVM only) + Fixed subroutine inlining on JVM + Fixed %*CUSTOM_LIB on JVM * Fixed sink context handling on JVM + Reimplementation of Buf as a role + Implemented Blob role + Implemented sized/encoded Buf/Blob types (buf8, blob8, utf8, etc.) + Str.encode now returns most specific appropriate type + "once" phaser fully implemented + Named parameters "with" and "as" on uniq/squish + "samewith()" for calling method on same dispatcher again + "will" variable trait partially implemented ($_ not set yet) + Interpolating strings into heredocs now dedents properly + Solved a slowdown when declaring custom operators + Improved P5-regexes (backslash sequences, code blocks) + Make type objects appear as Nil in non-scalar contexts + Placeholder variables $^A .. $^Z no longer allowed, as per spec + printf %d now supports bigints also on Parrot + my and our scoped methods no longer go into the method table + Implemented keybag(), KeyBag.push, KeyBag.categorize + Re-implemented hash iteration for a performance win + Various optimizations, code cleanups and error message enhancements New in 2013.07 + Huge progress in JVM backend (feature-wise almost on par with Parrot) + List.first is now lazy + unspace before argument lists is now supported + fixed handling of indented heredocs + basic support for threads and promises (JVM only) + improved sprintf and other formatting routines + keyof method for typed hashes to get key type + Hash.perl nows works for typed hashes + 'is parcel' and 'is default' traits (work in progress) + Parcel.new now works + slight optimization to join of many items + implemented canonpath for Win32 IO::Spec + implemented squish + made []:(kv|p|k|v) work according to spec + properly parse Pod formatting codes with brackets other than <...> + the POD_TO_TEXT_ANSI environment variable now leads to some formatting being applied by Pod::To::Text + declaration of multiple operators in a scope now generates much smaller serialized output + Int.round method now takes a scale argument + implemented Complex.ceiling, Complex.floor, Complex.round New in 2013.06 + JVM backend added - passes initial sanity tests + type captures in signature binder implemented + IO::Spec::Unix.canonpath made more efficient + IO::Handle methods gist, perl, path added + Int.msb and Int.lsb implemented + dir() is now lazy + lines($limit) now doesn't read an extra line + .^mro methods added to a few role metaclasses + $/ and $! now visible in eval/REPL + IO::Handle.copy moved to IO::Path.copy + .{} adverb combinations all implemented + :$ colonpair syntax implemented + 'my &foo; multi foo() { }' gives better error message + reduce() more aware of fiddliness + &first now returns Nil instead of failing + $*CWD and $*TMPDIR now contain IO::Path objects + REPL bug fixed when same line issued twice + pick/pop/push/roll/reverse/rotate/sort/classify/categorize now fail immediately if the list is infinite + categorize now returns a Hash, not a Parcel of Pairs + "undef" warning now refers to Any, not Mu + improved error messages for hash shapes + Hash.(classify|categorize) implemented + IO::Path.chmod implemented + IO::Path.succ and .pred implemented + syntax parser now allows a dot before hyper postfix + Str.succ added for codepoints \x2581..\x2588 + Cool.path implemented + sequences between 1-codepoint strings implemented + div and / fail with X::Numeric::DivisionByZero (rather than dying) + doing .perl on Rat with denominator 0 doesn't go into an infinite loop anymore + Capture.exists implemented New in 2013.05 + IO::Spec, a port of Perl 5's File::Spec + support for exporting things form EXPORT subroutine + ?-quantifier in regexes doesn't create arrays in the Match object anymore + speedup of repeated shifts of large lists and arrays by 70%+ + implemented Cool.lines + renamed IO to IO::Handle; IO is now a tag role, as per spec + simplify timezone handling + .Set and .Bag methods for List and Parcel + regex special characters can be used as delimiters + allow slice with :exists adverb on hashes … + .hash now accepts optional :type and :of named parameters + Make :exists and :delete up to spec … + fix for autoviv Typed hash problem + constant-fold infix:<~> + make decl and init of our-scoped arrays/hashes work + fix regex interpolation slowdown + fix exporting of subroutines + fix slurpy is-rw array-parameters + failed regex matches return Nil + add support for IO::Path:: + fix reporting of errors in gather/take. + added 125 extra opening/closing bracket-pairs + fix build failure on SPARC and PowerPC + underlying nqp layer supports parrot and JVM as backend, in preparation for JVM support in a future Rakudo release > more than 100 not listed changes New in 2013.04 + add Capture.Bool() + optimize getting size of numeric Range + for loops are eager again + improvements to DUMP() + wrap NQP objects in ForeignCode, allowing perl6 OO calls on them + improve some messages on parsefail. + add link and symlink to IO + reduce compile-time autothreading to avoid issues with !== + improve optimizer - caching, constants + fix List.ACCEPTS() for Whatever special case + bring 'require' closer to spec, esp. by taking paths + bring 'IO::Path' closer to spec + remove parrot dynops already provided as nqp ops + translate a dynop to nqp code + update from pir:: calls to nqp:: New in 2013.03 + Type names now gist as (Any) rather than Any() + Warn when pure expressions are used in sink context + Cool.substr(...) now correctly accepts whatever-star closures + Fix character class subtraction bugs + Correctly detect undeclared variables in regex assertions + :i now respected in character classes + Improved output of Rat.perl + Implemented shellwords postcircumfix (%h<< $x 'foo bar' >>) + User-defined circumfixes now parse a semilist rather than just an expression and handle whitespace correctly + Forbid null operators + Warn about leading 0 not indicating octal in Perl 6 + Fix some automatic end of statement on "}" parse bugs + Better error message on for(...) {} being interpreted as a function call + Array interpolations now properly do LTM + Respect :i in constructs like /:i <$var>/ + Autothread "none" and "all" junctions before "any" and "one" + Helpful error if you write "else if"/"elif" instead of "elsif" + Throw exception if a Range is used as a Range endpoint + Corrected argument order in IO.seek + Multi-dispatch now mostly implemented in NQP, not C + Fixed LEAVE (and thus UNDO/KEEP/temp) not firing in multis or upon 'next' in a for loop New in 2013.02 + "Did you mean ..." suggestions for symbol-not-found errors + Compile-time optimization of some cases of junctions in boolean context + Date and DateTime now support a .delta method + IO::Socket.get now works again with non-Unicode characters + $() now takes $/.ast into account + proper return value for smartmatching against a substitution + better error reporting when a parent class does not exist + constant folding for routines marked as 'is pure' + natively typed variables now work in the REPL + better error reporting in the REPL + writable $_ in -p and -e one-liner + speed up eqv-comparison of Bufs + warnings for useless use of (some) literals, variables and constant expressions in sink context + /../ and rx/.../ literals match against $_ in sink context + array variable interpolation into regexes New in 2013.01 + sink context; for-loops are now lazy by default + first mentioning a variable from outer scope and then redeclaring it in the same scope (my $a; { $a; my $a }) is now an error. + the long-deprecated "SAFE" setting has been removed + 'require' now works with indirect module names + restored socket read semantics to returning the requested number of bytes + $obj.Some::Role::meth() now passes the correct $obj + try/CATCH now returns Nil when the CATCH is triggered, rather than the exception; this brings it in line with try without a CATCH + whatever-star cases of splice now implemented + sequences with Junction endpoints now work + corrected precedence of various set operators + fixed binding of non-Any things into hashes and arrays + can now import multis with the same name from different modules, provided all dispatchers are onlystar New in 2012.12 + ~/.perl6/lib is gone from the default include path + fixed indent method's handling of empty lines + fixed .indent(*) + parse errors now formatted like in STD, with color + location of parse error now indicated with context + highwater algorithm implemented, greatly improving accuracy of parse error line numbers and locations in a range of cases + some parse errors now report what the parser was looking for at the time the parse failed + better errors for unmatched closing brackets and two terms in a row + uniq now has === semantics as specified, not eq semantics + junction auto-threader optimized and is an order of magnitude faster + implemented sub term: + implemented texas versions of the Set and Bag operators + good error for use of . to concatenate strings + flattening large lists of Parcels now happens in about half the time + adopted STD panic/sorry/worry model, meaning that we now keep parsing further and can report multiple issues in a range of cases + we now catch and complain about post-declared type names + variable redeclarations are now just a warning, not an error + a mention of an &foo that is never defined is now an error + fixed .perl output for a Pair with a Pair key + interpolation of undeclared arrays, hashes and functions now detected + { a => $_ } now correctly considered a block, not a hash as before New in 2012.11 + user-defined operators only affect the parser in the scope they are declared in + fixed pre-compilation of modules containing user-defined operators + implemented precedence related traits (equiv, looser, tighter, assoc) + Perl 6 grammar NFAs are pre-computed, saving some work on each invocation; this shaved around 10% off the time needed to run the spectests + redeclaring a class as a role now gives a better error + the < foo bar > syntax in regexes now respects :i + << ... >> now interpolates, respecting quoting and pairs + fix error reporting for not-found dynamic variables + many protos now have much narrower signatures + quote parsing implementation aligned with the approach STD uses + regexes and quotes have better support for user-selected delimiters + quote adverbs + heredocs + carry out IO::Path.dir deprecation + implement infix: + macro arguments now carry their lexical environment properly + postfix operators of the form '.FOO' take precedence over method calls + version control markers detected and gracefully complained over + INIT phasers now work as r-values + our ($x, $y) style declarations fixed + take and take-rw now evaluate to the taken value + implemented cando method on Routine + FIRST/NEXT/LAST can now be used in all types of loop (previously limited to for) + implemented operator adverbs + implemented :exists and :delete subscript adverbs and on hashes + implemented :p, :k, :v and :kv subscript adverbs on arrays and hashes + fixed shell words post-processing like << foo "bar $baz" >> + byte-order mark at the beginning of a file is now ignored + fixed bug that could lead to disappearing symbols when loading pre-compiled modules + Configure no longer passes --optimize to Parrot if --parrot-option is specified + deprecated current &foo semantics + fixed #`foo and friends at start of statementlist + simplify setting line number of compile-time exceptions + made :($a, $b) := \(1, 2) update $a and $b New in 2012.10 + :60[24, 59, 59] radix form + delegation to methods using the handles trait + fixed serialization of Buf + improved handling of :P5 regexes (more features, less bugs) + determining that an object lacks a method is usually now much faster + reduced memory usage of Match objects and optimized their construction a little + some code-generation improvements related to void context + implemented :dba('...') modifier in regexes + various error messages improved through use of :dba('...') in the Perl 6 grammar + implemented 'x' in pack + added $*CUSTOM-LIB + eval in a method can now see self, attributes and $?PACKAGE + each REPL line no longer implies a fresh GLOBAL + fixed some Pod parsing issues with Windows newlines + fixed interaction of :i and LTM (alternations and protoregexes now respect it) + import of custom meta-objects only affects the scope they are imported into + made <-> lambdas work + can now parse nested pairs of quote delimeters, like q{ foo q{ bar } baz } New in 2012.09.1 + is-prime and expmod + smart matching against Signature literals + binding to signatures in declarators + the is hidden and base traits + ability to set encoding on sockets temporarily removed (reverts to 2012.08 behavior) New in 2012.09 + class Iterable does not inherit from class Cool anymore + basic macro unquoting + basic support for m:P5/.../ regexes + support for indirect type names in routine and type declarations + compiler now built with QAST-based NQP, which generates better code, thus making the compiler a little faster + support for "is export" traits on constants + implemented Str.wordcase + can now write more complex proto subs and methods, using {*} to enter the dispatcher + tie-breaking with constraints now picks the first matching one rather than demanding they be mutually exclusive New in 2012.08 + tclc implemented + --> ReturnType in signatures and prefix type constraints of routine return types are honored + reduced memory usage at build time by around 35% - 40% + the argument to IO::Socket.recv is now interpreted as a number of characters + enum lists and arguments to parametric roles are now evaluated at compile time + switched to new internal AST and backend representations (QAST and PIRT) + removed deprecated routines Str.bytes and Str.lcfirst/&lcfirst + errors from traits now contain file name and line number + IO::File and IO::Dir have been removed + inliner has been improved and can inline a wider range of routines + simple implementation of the 'soft' pragma + fixed over-eager treatment of numeric literals as int rather than Int in cases where they appeared each side of an infix operator + detect circularities in module loading + sigilless variables in signatures when proeceed by | or \ + prevented blocks that declare variables turning into hash constructors + made pre-compilation complain if dependencies are not pre-compiled yet + fixed interpolation of double-quoted strings in regexes + fixed issue with Num.new not being friendly to subclassing + implemented handling of complex numbers in Str.Numeric New in 2012.07 + Deprecated SAFE.setting in favor of RESTRICTED.setting + Ranges can now interpolate in argument lists + The built-in meta-objects (such as Metamodel::ClassHOW) now inherit from Any + &open now supports :enc/:encoding + Exception.fail, .resumable and .resume + Changed &dir to return IO::Path objects, not strings + Deprecated .bytes, .ucfirst, and .lcfirst + &slurp now supports :bin + &spurt implemented + cleaned up Version implementation + fixed :s file test + recognize obosolete rand() and rand(N) forms at compile time + anonymous subset types 'subset :: of Int where { $_ > 0 }' New in 2012.06 + Rakudo is now compiled with the same regex engine as user-space regexes use + transitive longest-token matching in protoregexes + changed the output of Match.gist + string to number conversion now fails for non-numbers + string to number conversion now recognizes radix notation + string incrementation is now aware of more scripts + <|w> word boundary in regexes implemented + more errors from within the meta model now contain line number and file name + &push and &unshift functions can now autovivify + user-defined operators properly participate in LTM + Rakudo's C code is now compiled with optimization switches turned on + basic module loading tracing with the RAKUDO_MODULE_DEBUG=1 env variable + longest token matching with alternations + require with argument list + compile time errors in loaded modules now show a module loading backtrace + improved list and .map handling + can now use | to flatten a pair into an argument list as a named argument New in 2012.05 + meta ops //=, ||= and &&= now short-circuit properly + Failure objects don't blow up the REPL anymore + allow case insensitive regex matches without ICU in limited cases + %*ENV now propagates into subprocesses + RAKUDOLIB env variable supported in addition to PERL6LIB + -I and -M command line options + $?LINE and $?FILE variables + warnings now include line number from program, not from CORE.setting + reduction meta-operator on list-associative ops now has correct semantics + now have :th alias for :nth in Str.match + import collisions now report the name of the module that is to blame + ms// fixed + <$x> in regexes caches the compiled regex, which can be a big performance win + implemented temp and let + 'use' can now import by tag name + 'use' with positional arguments + lib.pm + updated calling conventions for traits + implemented fff flip-flop operator; improvements to ff form also + removed current directory from default library search path + 'import' works + symbols installed in EXPORT in all nested packages, not just UNIT::EXPORT + enumeration types can be used as roles + END phasers now run when program ends with exit or an exception + fix Rat.floor and .ceiling to work for large numbers + improved Rat stringification + Real is now a role, as it should be + implemented < foo bar baz > syntax for alternations in regexes + implemented <( and )> syntax for setting from/to of match in regexes + support for non-Int enums + basic support for Version literals + chmod now available as a function + roundrobin implemented + fixed a bug in precompilation of modules that use roles from other modules + basic implementation of pack and unpack + implemented substr-rw, which provides an l-value (assignable) substring + implemented <~~> (recursive call into self) syntax in regexes + 'LAZY' statement prefix New in 2012.04.1 + autvivification for arrays and hashes + more robust module precompilation + improved infrastructure for calling C code + $.foo style calls now contextualize correctly + &infix: now return members of the Order enum in all cases + --doc=format now loads Pod::To::format and uses it for rendering + 'lib/' is no longer in the default include path + improved Parameter.perl + add .changed, .modified and .accessed methods to IO + improved --help output + install precompiled test module for speedup + fixed printing of backtraces when regexes are in the call chain + case insensitive regex matches now also work for interpolated variables New in 2012.04 + 'defined' is now a listop instead of a prefix op + fixed :16('0d...') + implemented simple interpolation in names in type declarations (class ::(const) { }) + $=POD renamed to $=pod + fixed slicing of non-lists with infinite ranges + fixed accidental over-serialization, cutting ~300KB off each pre-compiled module + scalar positionals no longer treated as slices + implemented Routine.package + join will now always reify at least 4 elements of a list if possible + warnings now have line numbers + brought back Str.indent + ban declaring pseudo-packages, with a helpful error + a name followed by :: now returns .WHO, so Foo::<&bar> style lookups work + Exception.Bool now returns true + avoided re-parsing of longname, which speeds up the parse a bit overall + implemented MY, CALLER, OUTER, UNIT, CORE, SETTING and DYNAMIC pseudo-packages + implemented ::<$x> and ::{'$x'} style lookups + some small optimizations to various Str built-ins and MapIter + improved --doc output + added $*PERL + implemented IO::ArgFiles.slurp New in 2012.03 + updated to dyncall 0.7 + infix: now autothreads over junctions + more typed exceptions + pre-compiled modules/settings are now serialized, not re-built on load + startup time is now about 25% of what it once was + significant memory and time reduction (~40%) when pre-compiling modules/settings + BEGIN and CHECK now work in r-value context + constant declarator now works with non-literals on the RHS + implemented Set, Bag, KeySet and KeyBag types + implemented :exhaustive and :nth match adverbs + implemented ENTER, LEAVE, KEEP and UNDO phasers + implemented FIRST, NEXT and LAST phasers in for loops + implemented START phaser, including use of it in r-value context + implemented also syntax for adding traits inside a block/package + implemented macro declarations and quasi quotes (sans placeholders) + implemented anonymous enums + 'our multi' now dies (used to ignore the 'our') + implemented PRE and POST phasers + ~25% performance improvement to array indexing New in 2012.02 + catch duplicate accessor generation required of "has $.x; has @.x;" + many more typed exceptions thrown + undeclared attributes mentioned in signatures now caught at compile time + empty Buf is now False in boolean context + implemented + implemented // syntax + // can call a predeclared lexical regex x + conjugate is now called conj + enumeration values .gist to just the key, not the full name + in regexes fixed + implemented Match.make(...) method + better error reporting for improper use of nextsame and friends + initializers now parsed as part of a variable declarator + trailing whitespace now removed from Pod declarator blocks + List.tree made more useful + implemented rename and copy functions + ().pick and ().roll now return Nil + default MAIN usage message includes .WHY of the candidates + X::Base eliminated in favor of Exception + various range iteration fixes; Num ranges now produce Num lists + LHS of the xx operator is now thunked + can now declare state/constant/our in regexes (before, only :my worked) + improved backtraces + catch constructs that require an invocant but don't have one + catch uses of virtual method calls in submethods and attribute initializers + improved parsing and performance of reduction meta operators + Rat arithmetic now properly defaults to Num if the denominator is too big + FatRat implemented + implemented long forms of regex adverbs (e.g. "ignorecase" maps to "i") + fixed "but True" and "but False" + object hashes, with the my %h{SomeObjectType} syntax + implemented Int($x) style coercions + implemented Capture.perl New in 2012.01 + -c command line option re-implemented + take flattening bug fixed + duplicate named parameter names detected + fixed clone being too shallow with regard to containers + fixed negative modulo for bigint + better Routine.perl + .DEFINITE macro implemented + .^methods, .^attributes and .^parents now support :excl (the new default) and :all + Array.delete implemented + restored basic -n and -p functionality + improved parameter introspection + fixed operations on bigints when the first operand had been mixed in to + fixed multi-dispatch narrowness calculation for native types + binding to array and hash elements + added Order enumeration, and updated cmp and <=> to use it + adding various missing magicals, such as &?ROUTINE and ::?ROLE + accessor generation for my $.x and our $.x cases + fixed @x>>.() (hyper-invocation) + updated Complex.Str to match current spec + fixed eval to see GLOBAL properly + implemented 0 but Answer(42) style mix-ins + fixed various issues in scoping/handling of $/ + fixed usage of make in a regex (previously, only worked in action methods) + optimized Range.roll and Range.pick for large ranges + fixed non-numeric, no-Str ranges + fixed build on Cygwin + fixed regex backtracking into subrules and captures New in 2011.12 + improved protoregex support, including NFA caching + and (lookahead and lookbehind) + backslash sequences in character classes + fixed quantified captures and :r interaction bug + optimized match object construction, ListIter, substr and chomp + improved performance of send/get on sockets + optimizer detects missing private methods and simplifies calls (level 3 only) + fixed some issues when an array was assigned to itself, maybe using .= + implemented .wrap and .unwrap, plus wrap handles with a .restore method + implemented .trans on strings + unicode properties can be matched against in regexes + binding to @, % and & sigils now checks for the appropriate role + assignments to variables declared with the & sigil now checked for Callable + typed hashes, partial support for typed arrays + some parametric role fixes + can now use but operator with a type object + smartmatching of regexes against arrays and hashes + socket IO now implements .write and custom input line separators + implemented getc + implemented .WALK + implemented ff, ^ff, ff^ and ^ff^ + implemented .REPR macro + implemented Proxy class + some typed errors are now thrown from within the compiler + stubbed methods from roles now require those methods to be implemented + updated docs/ROADMAP + .WHICH now returns ObjAt objects + defining new operators New in 2011.11 + CATCH blocks are now much closer to spec + big integer support + basic protoregex support with NFA-driven LTM for some declarative constructs + correct default values for natively typed variables + fixed initialization of state variables + improved support for natively typed variables + catch more uses of undeclared variables + splice() is now implemented + uniq() is now implemented + several runtime errors now throw properly typed error objects + various performance improvements, for example to the X meta op and Str.succ + improved support for MAIN argument parsing + fixed lexicals/recursion bug + IO.copy is now implemented New in 2011.10 + operators and functions with native type arguments + detection of call to undefined routines at CHECK time + various optimizations: inlining of operators, CHECK time dispatch decisions + performance improvements of MapIter + support @$foo style derefencing/coercion + Exception.backtrace + eval() has stopped to catch exceptions New in 2011.09 + Rewritten meta object protocol and object storage + many speedups + Int, Num and Str are now far more lightweight + much more robust handling of infinite list + basic LoL (List of Lists) support + :U and :D type modifiers + protos and multis now conform to the new spec + improved enum support + basic 'constant' declarator + .WHAT and friends as macros + chrs sub and method + support for .gist + run() has been renamed to shell() to conform to current spec + hyper methods now descend into nested data structures + basic safe mode (through --seting=SAFE) + recording and reporting of test timings (tools/test_summary.pl) + Pod parsing and --pod=text option + basic support for .WHY + greatly improved BEGIN-time support + traits applied at BEGIN time for packages, routines and attributes + parametric roles reify types properly, fixing many bugs + better handling of type variables + support $?CLASS, which is generic in roles + support import/export of custom meta-objects for built in package declarators + custom meta-objects can override method dispatch + faster, allocation-free multi-dispatch cache + a custom BUILD does not suppress default values + undeclared attributes detected and reported at compile time + basic support for native int/num types on lexical variables + int/num as attributes are stored compactly in the object body New in 2011.07 + fractional powers of negative numbers now result in Complex numbers + obtain spectests from a specific branch of the 'roast' repo + fix bug that prevented build on systems with little RAM New in 2011.06 + added take-rw built-in + numerous build system improvements + assignment now evaluates arguments right-to-left New in 2011.05 release + added a call counter for builtins in Perl 6-level subroutines + gcd (greatest common divisor) and lcm (largest common multiple) operators + build system improvements + added --ignore-parrot-rev option to Configure.pl + Configure.pl now creates "config.status" file + fixed relational operators when used with NaN + implemented Int.base + speedup smart-matching against numbers and Str.comb with default arguments + added RAKUDO_SUBLOG environment var for tracking subroutine calls + overall performance speedups New in 2011.04 release + implemented Str.indent + A new, much simpler API and implemention of IO::Socket::INET + Unified error messages to use "Cannot" New in 2011.03 release + improved error message on type check failure in assignment + -n and -p command line options + Test.pm's skip() now has argument ordering consistent with todo() + implemented complex conjugation + more IO methods related to stat New in 2011.02 release + IPv6 support + more robust numeric exponentation + --ll-backtrace command line option for PIR level stack traces + future-proof for upcoming generational garbage collector in parrot + various constructs now return Nil + infix: implemented + infix:<^^> and infix: improved + negation metaoperator is now restricted to operators that return Bool New in 2011.01 release + faster subroutine calls (type cache) + 'handles RoleName' now works + Test.pm: s/done_testing/done/ + non-spec debugging pragma Devel::Trace + improved parsing of keyword boundaries + sped up .comb New in 2010.12 release + new .trans algorithm + fixed $*PID on MacOS X + don't register names of anon types + configuration improvements + updated Any functions + fix $*IN_DECL leakage + implemented Hash.hash + Temporal updates + Buf.decode fixed + open() fixed for binary flag New in 2010.11 release + now works with parrot on git + implemented qw// + 5x speedup of .trans + various improvements to Set + don't use deprecated charset ops anymore + Bool.Bool and Bool.so now return False + implemented &elems + improved error for Date.new(Str) + improvement on hyperoperators + indexings like .[0 .. *-1] work now New in 2010.10 release + True and False now stringify according to the specification + basic form of 'require' for run time module loading + warnings from the setting now produce line numbers in the users' program + local time zone available as $*TZ + more consistent line numbers from warnings + getting and setting attributes via introspection + implement samespace, ms// and ss/// + hyper operator invoving = can now modify their arguments + speed up Str.flip by over a factor of 100 New in 2010.09 release + new methods on IO concerning the modify and access time of files + S32::Temporal now completely implemented + Instants and Durations + speedup for slurp() and .reverse built-ins + various improvements to the Set type + revamp of series operator code, and adaption to new spec + implement ...^ up-to-but-excluding-series operator + allow :r and :ratchet modifiers on regex quoting constructs + Bool.pick + significantly improved enum implementation New in 2010.08 release + syntactic adverbs on substitutions, rx quotes and m//, e.g. '$x ~~ s:2nd/a/b/' + updated ROADMAP + speedups for integer operations + the Match class's .perl method now produces useful, roundtrippable Perl code + the MAIN subroutine can now parse short arguments + the cmp and <=> operators now work on more numeric types + the Buf class now has .pack and .unpack methods with partial functionality + numeric bitshift operators now have the correct precedence + smartmatch against True or False is now an error New in 2010.07 release + support for delegation via 'handles' + implemented binding with := and read-only binding with ::= + implement OS related built-ins like mkdir, cwd + improved diagnostics in Test.pm + basic binary IO, buffer encoding and decoding + magic $*ARGFILE file handle + more robust closures + multi-level Array and Hash element autovivification + perl6 --version now identifies the exact git sha1 and parrot version + implemented 'is rw' trait on classes + file tests now work through IO, ie. 'README'.IO ~~ :e + generic, multi-level Whatever-currying (eg grep !(* % 2), @list) + improved error reporting in many cases, especially multi-method dispatch + implemented backtracking into capturing groups and subrules + phasers refactored, they can now return results and see the setting + custom circumfix operators + basic .wrap and .unwrap implementation + weighted Hash.pick + .perl on custom classes now dumps attributes + Basic implementation of the ==> and <== feed operators + Int ~~ Num is no longer true, as per spec; use Numeric instead + Improvements to enumerations New in 2010.06 release + new list model with immutable iterators, lots of fixes to lists and arrays + variable interpolation into regexes + compile time Whatever currying for infix, prefix and postfix operators + autoprinting in the REPL shell + in @*INC, the current directory '.' now comes at the end, as in Perl 5 + basic Buf implementation: Str.encode/Buf.decode work for UTF-8 + proper Perl 6 match objects + Backtraces with Perl 6 subroutine names and line numbers + MAIN and USAGE subs + basic version of Str.trans + mix-ins with non-roles (5 but 'string') + @*ARGS is now read-write + IO::Socket::INET again works in CORE + hash and array slices have been greatly improved + basic support for callframe() and CallFrame type New in 2010.05 release + implemented lexical and anonymous classes and roles + manual pages are now installed + the .match method now understand the adverbs :c; :p, :nth, :x, :g, :ov + test reports with tools/test_summary.pl now record detailed timing information + many improvements to numeric handling + implemented S (sequential) meta operator + fixed placeholder parameters ($^a, $^b) + basic enum implementation + implemented List.classify + turned on an additional 47 test files + further improved error messages + implement zero-argument versions of many binary operators + basic interoperation with Perl 5 through the external Blizkost project New in 2010.04 release + interpolation of expression ending in postcircumfixes into double-quoted strings (for example "cards: @cards.sort()") + prefix and postfix hyper operators + multi subs now work properly when lexically scoped + implemented item assignment with tighter precedence than the comma operator + loading of .pm6 modules + Basic implementation of Numeric and Real roles + implementation of DateTime and Date built-in types + named regexes can be declared outside of grammars again + support for numbers with arbitrary radix, including fractional numbers (:16) + implemented fmt(), printf() note() and IO.getc built-in routines + infix meta operators now inherit the precedence of the modified operator + &[+] short name for infix operators + hash slices + signature literals + smart-matching against signatures + more consistent implementation of prefix:<|> for interpolating things into signatures + better error message on accidental usa of Perl 5 features such as << as bit shift operators, and catch many perl 5 magic variables + implemented type Cool + implemented anonymous classes and roles + implemented $*PID + method introspection works again + better error message for calling non-existent routine in a namespace + now run programs with the setting as an outer lexical scope, as per spec New in 2010.03 release + The trigonometric functions and the Rat class have received numerous updates, making them faster and more complete + .^parent now works again + The invocation logic has received various speedups + Hash creation has been optimized + Various improvement related to constant internal strings have led to slight speedups + .pick, .sort, .keys, .values, .kv, sprintf were reimplemented, ported from the old 'alpha' branch + The statement modifier for loop works again + Various parsing bugs have been sorted out; one having to do with closing curly braces at the end of a line not terminating the statement + .CREATE, .BUILDALL and .can in the OO system have received attention, some of it leading to mild speedups + $*PROGRAM_NAME and @*ARGS now work + Deferral works again (nextsame/nextwith/callsame/callwith) + Array.delete works again + Fixed .?, .+ and .* along with matching latest spec on .? + Switch untyped variables to default to Any instead of Mu + &foo lookup syntax works again (including for operators) + Various cases of eqv operator implemented + Make overriding postcircumfix:<( )> work again, this time per spec + Make junctions of code objects invokable again + Lazy implementation of the Z operator + Added back @*INC + Read-only %*ENV support + Grammars work again + Implemented regexes taking parameters + Implemented proto-regex declarations + Initial work on getting subset types working again + Add back many of the file test methods + Added docs/S11-Modules-proposal.pod documenting how we intend to handle modules through Rakudo * + First cut of locating and loading modules with a given version and/or authority, and in absence of a requirement selection of the latest version by default if multiple are available. + Many improvements to the series operator + Implemented 'need' and a first cut of 'import'; 'use' works in terms of them + Import is now into the lexical scope by default, as per spec + Removed requirement to hand-pre-compile .pm to .pir for use with 'use' + Improved multi-dispatch candidate not found errors to include details of the available candidates + Implemented 'use MONKEY_TYPING' + Many cases of smart-match work again + $x.Foo::bar() and $x.$y() work again + $.foo(1,2,3) works again + !, R, X and Z meta-operators work, albeit with some caveats + s/foo/bar/ and s[foo] = 'bar' substitution syntax implemented + Array.rotate added back + User defined operators (prefix, postfix, infix) working again + Many more small but important improvements to built-in types and functions + Various other bug fixes + ROADMAP updates New in 2010.02 release + The branch formerly known as 'ng' becomes the new master branch + The previous master branch is now Rakudo/alpha + NQP-RX replaces NQP in the Parrot Compiler Toolkit, enabling the source code of the compiler to be written in a subset of Perl 6 that is much more powerful, most importantly with regexes, as the name suggests + The revised Perl6/Grammar.pm is much closer to the canonical STD.pm + Regexes may declare contextual and lexical variables + Lazy lists and arrays are partly implemented + The object metamodel is largely written in NQP-RX instead of PIR + The name of the root of the object hierarchy is now Mu + The term 'undef' is gone, replaced by Nil, Mu or *.notdef depending on context + Builtin classes derive from Cool which derives from Any + The refactored source code is more compact and more easily extended + The number of spectests passed has reduced from a peak of 32731 in alpha to 24221, because porting the functionality to the new master is still ongoing + Release numbering changes from 'dash' to 'dot' delimiter to get on better with various package management systems New in 2010-01 release + Added method form of eval. + Implemented :s and :l file operators + Added functions for logarithms using $base + Refactored subroutine calls to use new Context structures in Parrot 2.0.0 New in 2009-12 release + Only minor maintenance was done because all attention was being given to the Rakudo/ng branch, bringing in the new nqp-rx bootstrap compiler New in 2009-11 release + Rakudo now uses Parrot's updated calling convention features + support unpacking of arrays, hashes and objects in signatures + changed .pick to use :replace instead of :repl + many core setting optimizations and bugfixes + IO::Socket.recv() has been extended to accept a parameter specifying the number of bytes which will be received + Rakudo now looks up %INC in the right namespace when loading libraries for foreign languages New in 2009-10 release + smolder reports for spectest runs + more Complex trig functions + pure Perl 6 implementation of the Complex type + some variants of the new series operator + correct construction of twigilled colonpairs + infix:, .pred and .succ for the Rat type + when configuring with --gen-parrot, pass --optimize to parrot's Configure.pl + moved more operators to the setting and thus made them overloadable + { %hash } now correctly constructs a hash, not a closure + new, faster low level Signature type + improved Signature introspection + new, much faster signature binder + improved various error messages related to signature binding + signature literals now supported + binding of named arguments to positional parameters + attributive parameters implemented + package blocks now run as immediate blocks, as per the spec + lexical variables declared outside of packages now visible inside them New in 2009-09 release + updates to numeric operators: infix(Int, Int) creates a Rat + Rat (rational) numbers + overloadable builtin operators + contextual variables + setting values in %*ENV now works + partial support for trigonometric functions of complex numbers + better handling of custom traits, many builtin traits moved to core setting + improved type dispatch for builtin operators, type coercions New in 2009-08 release + Rakudo must now be built from an installed parrot, and can be installed itself + separate Perl 6 meta class + introspection on roles + declaration of methods in the meta class by writing method ^newmethod($obj) + :tree options for parent class, attribute and role introspection + allow some custom postcircumfix:<( )> methods + moved more built-ins into the setting + implement operators infix: (divisibility test) and prefix [||] and [//] + updated ROADMAP in preparation for the Rakudo Star release + instead of throwing nasty parse errors, Rakudo now informs you that feed operators are not yet implemented + improved testing: planless testing with done_testing(); better diagnostic output from is() + the syntax for embedded comments has changed + embedded Pod comments are now recognized + support for defining traits and applying them to routines, classes and roles + "hides" trait (class A hides B { ... }), and "is hidden" + better handling of slurpy and optional in multi-dispatch + use of .?, .+ and .* with indirect calling form ($obj.+@cands) + .can improved; now returns something usable as an iterator + lastcall implemented New in 2009-07 release + extensive refactor of the multi dispatch code to get closer to the spec + better handling of named arguments in multi dispatch + operators and traits can be defined in the setting + basic implementation of the series and eqv operators + refatored trait code to match updated specification + implemented more cases of smartmatching against hashes + fixed state variables to work with //= and ||= initialization + improved testing: when Rakudo dies with 'Null PMC Access' it is never considered a success + implemented the :all flag to split which keeps captures + added List.rotate builtin + nextwith and callwith now also work properly with methods + take() without outer gather now merely warns + introspection of roles and attributes New in 2009-06 release + refactored and corrected object initialization (BUILD/CREATE) + attributes initilizations can now use attributes defined earlier + method calls are now faster + basic safe mode that forbids IO and execution of external programs + implemented meta operators for user defined operators + initial implementation of Temporal (date/time related objects) + type checking of implicit return values + improved introspection methods + cleaned up IO methods + improved "is export" handling for modules and setting + automatically transcode to iso-8859-1 for faster parsing when possible + refactored and corrected assignment, .succ, .pred, C<++>, C<-->, postcircumfix:<[ ]>, Whatever + "module Foo;" now allows statements before it + improved Unicode string handling + better support for Str increment/decrement in Unicode ranges + many performance improvements New in 2009-05 release + updated docs/ROADMAP + basic support for custom operators + operators can now be referenced as &infix:<+> + meta operator support for custom operators + cross-language library loading + stack traces now include source file name and line number + implemented Regex type + .WALK (parent classes in configurable order) + .name method on routines + refactored enums, thereby fixing many enum related bugs + fixed namespace of eval()ed code + implemented parallel dispatch (@objects>>.methods) + initial support for «...» quotes + text files now default to utf8 encoding + fixes to Match.perl and Match.chunks + implemented 'constant name = $value' + documented build dependencies + grep() accepts general matcher, things like @list.grep(Int) work + trigonometric functions (sin, cos, ...) now available via 'use Num :Trig' + qx{} quotes now work (except on Windows) + hyper-operators on hashes now work (%a >>+<< %b) + initial implementation of $foo.@bar + refactored wrap and unwrap to work with candidate lists; fixes some bugs + refactored/improved callsame and callwith, and added nextsame and nextwith (only work for dispatches of the form $foo.@bar and with wrap so far) + partial implementation of .^parents and .^methods + can initialize attributes in terms of others + many other bug fixes and performance enhancements New in 2009-04 release (#16, "Bratislava") + wrap and unwrap for subroutines + calling a method on a Whatever star generates a closure + 1+*, *+1 and others generate closures (*-1 missing) + Associative, Positional and Callable are now parametric roles + typed arrays and hashes + parametric role subtyping (R[T1] ~~ R[T2] where T1 ~~ T2) + .invert and .push on Hashes + enforce return types of subroutines (partial implementation) + parallel testing + Configure.pl now supports passing options to parrot's Configure + support for lexical subroutines and multis + implemented \c[character name] in double quoted strings and regexes + implemented Perl 5 regexes + rx/.../ regex quoting + sockets support has been added (IO::Socket) + regex patterns may now be quantified by a separator regex + moved many methods to the setting + exporting and importing by tags, support :DEFAULT export tag + implemented START blocks + implemented roots builtin + implemented .ast on Match objects + added Match.caps and Match.chunks + split() now supports limits in all cases + prefix:<=> and the "fish operator" ( =<> ) are now gone + .readline is now .get + roles are now punned on any method call on the role + many other bug fixes New in 2009-03 release (#15, "Oslo") + implemented $*PROGRAM_NAME magical variable + outer lexicals are now visible in eval() + next, last etc. work in grep() + added R metaoperator + add an initial draft of Match.perl + refactor Grammar and Match class hierarchy + fix if/unless/while/until/for/... on line after close curlies + add Q quoting, including Q:PIR + added "state" variables + //= fixed to short-circuit, and added short-circuiting &&= and ||= + multi-subs now have the Multi type and have a .candidates method + multi-method dispatch now looks up the class hierarchy + various fixes to using roles as type constraints + support bare sigils in signatures + more methods and functions moved to (Perl 6) setting + many other bug fixes New in 2009-02 release (#14, "Vienna") + first release independent of Parrot releases + passing 7076 spectests (+796 since 2009-01 release) + build and use fakecutable (perl6.exe) by default + redesigned build, configuration, and test subsystems + add settings/ directory for builtins written in Perl 6 (was "prelude") + improve diagnostics in Test.pm + allow anonymous classes via C<::> + re-use existing parameterized roles instead of creating new ones + roles now pun classes when .new is called on them + 'proto' now marks all same-named routines as 'multi' + XopX is now Xop + implement <-> (rw) pointy blocks + added min= and max= metaoperators + many many bugfixes + publish release schedule + documentation improvements rakudo-2018.03/docs/compiler_overview.pod0000644000175000017500000003026113253717231017022 0ustar alexalex## $Id$ =head1 RAKUDO COMPILER OVERVIEW F =head2 How the Rakudo Perl 6 compiler works This document describes the architecture and operation of the Rakudo Perl 6 (or simply Rakudo) compiler. The F describes how to build and run Rakudo. Rakudo has six main parts summarized below. Source code paths are relative to Rakudo's F directory, and platform specific filename extensions such as F<.exe> are sometimes omitted for brevity. =over 4 =item 1. Not Quite Perl builds Perl 6 source code parts into Rakudo =item 2. A main program drives parsing, code generation and runtime execution (F) =item 3. A grammar parses user programs (F) =item 4. Action methods build a Parrot Abstract Syntax Tree (F) =item 5. Parrot extensions provide Perl 6 run time behavior (F, F, F) =item 6. Libraries provide functions at run time (F, F, F, F, F) =back The F (generated from F<../tools/build/Makefile.in> by F<../Configure.pl>) compiles all the parts to form the F executable and the F or F "fake executable". We call it fake because it has only a small stub of code to start the Parrot virtual machine, and passes itself as a chunk of bytecode for Parrot to execute. The source code of the "fakecutable" is generated as F with the stub at the very end. The entire contents of F are represented as escaped octal characters in one huge string called C. What a hack! =head2 1. NQP The source files of Rakudo are preferably and increasingly written in Perl 6, the remainder in Parrot Intermediate Representation (PIR) or C. Not Quite Perl (nqp) provides the bootstrap step of compiling compiler code (yes!) written in a subset of Perl 6, into PIR. The latest version of NQP includes the I<6model> library, which is the building block for all Perl 6 object. It also comes with a regex engine that Rakudo uses. NQP is a bootstrapped compiler, it is mostly written in NQP. The source code of NQP is in a separate repository at L. Note, NQPx only I the Rakudo compiler, and does not compile or run user programs. =head3 Stages NQP compiles us a compiler in F<../perl6.pbc> and then F<../perl6> or F<../perl6>. NQP also compiles the I found in F. This is a library that controls how classes, methods, roles and so on work. The bare-bones compiler then loads the compiled metamodel, and compiles the I found in F. Those core files provide the runtime library (like the C and C classes). But note that many of these classes are also used when the final compiler processes your Perl 6 scripts. =head2 2. Compiler main program A subroutine called C<'MAIN'>, in F, starts the source parsing and bytecode generation work. It creates a C object for the C<'perl6'> source type. Before tracing Rakudo's execution further, a few words about Parrot process and library initialization. Parrot execution does not simply begin with 'main'. When Parrot executes a bytecode file, it first calls all subroutines in it that are marked with the C<:init> modifier. Rakudo has over 50 such subroutines, brought in by C<.include> directives in F, to create classes and objects in Parrot's memory. Similarly, when the executable loads libraries, Parrot automatically calls subs having the C<:load> modifier. The Rakudo C<:init> subs are usually also C<:load>, so that the same startup sequence occurs whether Rakudo is run as an executable or loaded as a library. So, that Rakudo 'main' subroutine had created a C object. Next, 'main' invokes the C<'command_line'> method on this object, passing the command line arguments in a PMC called C. The C<'command_line'> method is inherited from the C parent class (part of the PCT, remember). And that's it, apart from a C<'!fire_phasers'('END')> and an C. Well, as far a C<'main'> is concerned. The remaining work is divided between PCT, grammar and actions. =head2 3. Grammar Using C, C target C uses F to compile F to F. The compiler works by calling C method in F. After some initialization, TOP matches the user program to the comp_unit (meaning compilation unit) token. That triggers a series of matches to other tokens and rules (two kinds of regex) depending on the source in the user program. For example, here's the parse rule for Rakudo's C statement (in F): token statement_control:sym { :s [ || <.panic: 'unless does not take "else", please rewrite using "if"'> ] } This token says that an C statement consists of the word "unless" (captured into C<< $ >>), and then an expression followed by a block. The C<.panic:> is a typical "Awesome" error message and the syntax is almost exactly the same as in F, described below. Remember that for a match, not only must the C<< >> match the word C, the C<< >> must also match the C token. If you read more of F, you will learn that C in turn tries to match an C<< >> and a C<< >>, which in turn tries to match ..... That is why this parsing algorithm is called Recursive Descent. The top-level portion of the grammar is written using Perl 6 rules (Synopsis 5) and is based on the STD.pm grammar in the C repository (L). There are a few places where Rakudo's grammar deviates from STD.pm, but the ultimate goal is for the two to converge. Rakudo's grammar inherits from PCT's C, which provides the C<< <.panic> >> rule to throw exceptions for syntax errors. =head2 4. Actions The F file defines the code that the compiler generates when it matches each token or rule. The output is a tree hierarchy of objects representing language syntax elements, such as a statement. The tree is called a Parrot Abstract Syntax Tree (PAST). The C class inherits from C, another part of the Parrot Compiler Toolkit. Look in F<../parrot/ext/nqp-rx/stage0/src/HLL-s0.pir> for several instances of C<.namespace ["HLL";"Actions"]>. When the PCT calls the C<'parse'> method on a grammar, it passes not only the program source code, but also a pointer to a parseactions class such as our compiled C. Then, each time the parser matches a named regex in the grammar, it automatically invokes the same named method in the actions class. Back to the C example, here's the action method for the C statement (from F): method statement_control:sym($/) { my $past := xblock_immediate( $.ast ); $past.pasttype('unless'); make $past; } When the parser invokes this action method, the current match object containing the parsed statement is passed into the method as C<$/>. In Perl 6, this means that the expression C<< $ >> refers to whatever the parser matched to the C token. Similarly there are C<< $ >> and C<< $ >> objects etc until the end of the recursive descent. By the way, C<< $ >> is Perl 6 syntactic sugar for C< $/{'xblock'} >. The magic occurs in the C<< $.ast >> and C expressions in the method body. The C<.ast> method retrieves the PAST made already for the C subtree. Thus C<$past> becomes a node object describing code to conditionally execute the block in the subtree. The C statement at the end of the method sets the newly created C node as the PAST representation of the unless statement that was just parsed. The Parrot Compiler Toolkit provides a wide variety of PAST node types for representing the various components of a HLL program -- for more details about the available node types, see PDD 26 ( L ). The PAST representation is the final stage of processing in Rakudo itself, and is given to Parrot directly. Parrot does the remainder of the work translating from PAST to PIR and then to bytecode. =head2 5. Parrot extensions Rakudo extends the Parrot virtual machine dynamically (i.e. at run time), adding 14 dynamic opcodes ("dynops") which are additional virtual machine code instructions, and 9 dynamic PMCs ("dynpmcs") (PolyMorphic Container, remember?) which are are Parrot's equivalent of class definitions. The dynops source is in F, which looks like C, apart from some Perlish syntactic sugar. A F<../parrot_install/bin/ops2c> desugars that to F which your C compiler turns into a library. For this overview, the opcode names and parameters might give a vague idea what they're about: rakudo_dynop_setup() rebless_subclass(in PMC, in PMC) find_lex_skip_current(out PMC, in STR) x_is_uprop(out INT, in STR, in STR, in INT) get_next_candidate_info(out PMC, out PMC, out PMC) transform_to_p6opaque(inout PMC) deobjectref(out PMC, in PMC) descalarref(out PMC, in PMC) allocate_signature(out PMC, in INT) get_signature_size(out INT, in PMC) set_signature_elem(in PMC, in INT, in STR, in INT, inout PMC, inout PMC, inout PMC, inout PMC, inout PMC, inout PMC, in STR) get_signature_elem(in PMC, in INT, out STR, out INT, out PMC, out PMC, out PMC, out PMC, out PMC, out PMC, out STR) bind_signature(in PMC) x_setprophash(in PMC, in PMC) The dynamic PMCs are in F, one file per class. The language is again almost C, but with other sugary differences this time, for example definitions like C whose purpose will appear shortly. A F<../parrot_install/lib/x.y.z-devel/tools/build/pmc2c.pl> converts the sugar to something your C compiler understands. For a rough idea what these classes are for, here are the names: P6Invocation P6LowLevelSig MutableVAR Perl6Scalar ObjectRef P6role Perl6MultiSub Perl6Str and P6Opaque. =head3 Binder The dynops and the dynpmcs call a utility routine called a signature binder, via a function pointer called C. A binder matches parameters passed by callers of subs, methods and other code blocks, to the lexical names used internally. Parrot has a flexible set of calling conventions, but the Perl 6 permutations of arity, multiple dispatch, positional and named parameters, with constraints, defaults, flattening and slurping needs a higher level of operation. The answer lies in F which is compiled into C and C libraries. Read L for a more detailed explanation of the binder. F has three C<.loadlib> commands early on. The C loads the 9 PMCs, the C does the 14 dynops, and the C adds over 30 mathematical operators such as C, C, C, C
, C, C, C, C etc. (source in F) =head2 6. Builtin functions and runtime support The last component of the compiler are the various builtin functions and libraries that a Perl 6 program expects to have available when it is running. These include functions for the basic operations (C<< infix:<+> >>, C<< prefix: >>) as well as common global functions such as C and C. The stage-1 compiler compiles these all and they become part of the final F. The source code is in F, F, F, F and F. =head2 Still to be documented * Rakudo PMCs * The relationship between Parrot classes and Rakudo classes * Protoobject implementation and basic class hierarchy =head1 AUTHORS Patrick Michaud is the primary author and maintainer of Rakudo. The other contributors and named in F. =head1 COPYRIGHT Copyright (C) 2007-2010, The Perl Foundation. =cut # Local Variables: # fill-column: 100 # End: # vim: expandtab shiftwidth=4: rakudo-2018.03/docs/deprecations0000644000175000017500000000631513253717231015164 0ustar alexalexDeprecations in 2013.12 eval is now spelled EVAL Deprecations in 2013.11 Order::Increase and Order::Decrease are now called Order::Less and Order::More. Using "Increase" or "Decrease" will now generate "is DEPRECATED" warnings at the end of execution. Deprecations in 2012.12 'for'-loops will be lazy (just like map), and only be automatically run in sink (void) or list context. This causes problems if the last statement in a block is a for-loop that either calls return(), or is inside a try { } block. Since such code is now run after the block exits, it is not in the dynamic scope of the routine or the try block. As a fix, you can force eager execution of the for-loop by adding another statement after it, or by writing 'eager do for LIST BLOCK'. This change will take effect in 2013.01. Warnings will start being issued for unused parameters to pointy blocks and routines. At present, they do not warn at all. Planned for 2013.01. Constructs like "my $a; { $a; my $a; }", where the meaning of the first mention of $a in the block would create confusion as to what was being referred to, will become an error as in STD. This change will take effect in 2013.01. Deprecations in 2012.11 At present, a reference to an &foo that does not exist evaluates to Nil. This will become a CHECK-time failure, in line with STD. Planned for the 2012.12 release. Deprecations in 2012.10 Protos for built-in routines are now mostly as generic as possible, and will be changed to be specific to the arity of the routine. For example 'proto sub chr(|) {*}' will become 'proto sub chr($) {*}' This affects everybody who adds multis with unusual arity to built-in subs. Planned for the 2012.11 release. Unary hyper ops currently descend into nested arrays and hashes. This will change to make them equivalent to a one-level map. Planned for the 2012.11 release. ~/.perl6/lib will go away from the default include path (@*INC). Instead %*CUSTOM_LIB now holds paths to four library locations: perl Rakudo installs its core modules here vendor OS-level package managers should install their modules here site for local module installations (e.g. with panda or ufo) home like site, but always under the user's home directory. fallback if site isn't writable. Removal of ~/.perl6/lib from @*INC planned for the 2012.11 release Deprecations in 2012.09 Str.capitalize and &capitalize are deprecated in favor of the Str.wordcase and &wordcase routines. They will uncondtionally warn in 2012.10, and be removed in 2012.11. Deprecations in 2012.08 Parameters preceded by a | or \ may not have a sigil anymore. sub f(\$x) { say $x } must be changed to sub f(\x) { say x } Usage of \$x will unconditionally warn in 2012.09 and be removed in 2012.10 IO::Path.dir (which returns the directory part of the path) has been renamed to IO::Path.directory. IO::Path.dir will be removed or re-purposed in 2012.09 The LAZY statement prefix will be removed in 2012.09. It was a non-specced experiment and did not work out well. rakudo-2018.03/docs/guide_to_setting.pod0000644000175000017500000000404213253717231016614 0ustar alexalex=encoding utf-8 =head1 NAME Guide to the C setting. =head1 DESCRIPTION Notes about writing code to go in Rakudo's setting. =over 4 =item Think of laziness Avoid anything that forces eager evaluation of arrays, like querying their length. This is bad: while $i < self.elems { ... } Better use a C loop, which will respect laziness for self.list { ... } If you assemble multiple items into a potentially lazy list, C is a very good construct to remember. =item Take care with type constraints Some of the Synopsis documents list type constraints for some of the arguments, including the invocant. They are not always correct, when in doubt leave them out. =item When adding a new file in src/core/ ... remember to add it to L to the C variable and re-generate the Makefile using L. =item Prefer C to explicit invocant variables. Many of the method specifications in the synopses list explicit invocant variables. Using them often makes the code less clear, and can sometimes be incorrect (for example, an invocant of C<@values> will restrict the method to invocants that have the C role). Better is to use C, or if invoking a method on C then you can use C<$.foo> or C<@.bar> directly. =item All subs and methods are really multis All built-in methods or subroutines should be declared as C. =item Use explicit empty signatures If a method doesn't take any arguments, give it an explicit empty signature C<()>. That's very different from omitting the signature altogether (which would be an implicit catch-all signature). =item Use implicit return at the end of routines If no C statement is executed in a routine, the value of the last evaluated expression is returned. So if a C is the last statement in a routine, omit the C - currently explicit returns take much more time than implicit ones. =back =head1 SEE ALSO L =for editor vim: ft=pod tw=70 rakudo-2018.03/docs/language_versions.md0000644000175000017500000001554713253717231016625 0ustar alexalex# Proposal for 6.c release and beyond For review, nothing set in sand yet (and these things should never be set in stone; we need to keep learning and adapting them over time). ## Rakudo branches We want to provide a little more stability than we attain today in terms of releases, but at the same time don't want to slow down development notably. Therefore: * Development work will continue on the master branch * Commit policy on "master" is pretty much as today * The camelia bot will build from "master" * Some other branch will be created and will become the default branch people pull, that things like rakudobrew build if asked to get the latest non-release, and that we release from * An automated process will fast-forward master to catch up with master at regular intervals, provided it meets a bunch of automated quality checks These automated quality checks are as follows: * Clean test/spectest on Moar * Clean test/spectest on JVM * Panda bootstrap works * We'll identify and snapshot a selection of modules (around 100) that have passing tests. We should be able to build and pass tests on this selection (showing we didn't regress on a bunch of ecosystem things). Note that we snapshot them so as to avoid issues with changes in the modules themselves that cause failures that are not Rakudo bugs. We'll revise this set every so often to remain representative. GitHub doesn't let us configure per-branch permissions, so we can't prevent pushes to master that way. But we can have a pre-push hook to try and prevent mistakes. ## Releases Releases will be cut from some branch. The release manager will have the advantage of knowing they are releasing something that has already passed a bunch of automated quality checks. The release process will be something like: * Create a release branch based off some branch * Do release-related commits in the branch (announcement, last change log updates, bump VERSION, etc.) * Cut the release (produce the tarball, etc.) * Tag the released commit * Merge the release branch into master (so it will end up merged into some branch also later) We can script some of this (the branch creation, stubbing announcement, bumping VERSION, and then another script to do the merge back into nom afterwards). ## Spectests The Perl 6 language is defined by its test suite. A particular release of the language is, therefore, a release of the test suite. To make sure we don't regress on things that we decided are part of the 6.c language, we need to make sure that we don't unknowingly change such tests. One way to do this is: 1. Create a 6c directory in roast. 2. Create a speculation directory in roast. 3. Look through spectest.data for tests we run, but that we don't think are part of 6.c (the macros tests are such an example: we know we do not want to commit to the current implementation.) Move those tests into the speculation directory (retaining the Snn-foo directory structure). 4. Move all remaining unfudged test files that we run in t/spectest.data on Moar into the 6c directory (again, retaining Snn-foo structure). 5. Split the Moar-fudged test files up into the fudged tests (which go in speculation) and the passing ones (which go into 6c). Then, it will be really, really obvious is we go modifying a test that was in the 6.c release (which we almost certainly shouldn't do most of the time; at most we may add a deprecated marker if we decided that, say, 6.f is not going to pass this test any more). ## Language versioning The Perl 6 language has version numbers v6.c, v6.d, v6.e, and so forth. These are very much like C has C89, C99, and C11. Each language version is defined by its test suite. Rakudo is a Perl 6 implementation, as GCC, Clang, and MSVC are implementations of the C language. Rakudo has monthly releases (2015.12, 2016.01, etc.) For the moment, we don't make any distinction between these releases; they are all equally "supported". Each Rakudo release must indicate the maximum version of Perl 6 it supports, and this should be included prominently in the release announcement, for example in the title, such as: "Rakudo 2016.01 (implements Perl 6.c)". A Perl 6 source file without a "use v???" line will be run at the latest language version that the current implementation supports (as will -e and the REPL). A source file with "use v6.X" (where X is meta) should be treated as follows: * If X is higher than the implementation currently supports, then it should refuse to go any further. * If X is lower than the implementation supports, it should also refuse to go any further. * Otherwise, it enables everything that should be available at that language version. * A straight "use v6" at the top level is equivalent to "use v6.c". However, a "use v6" after a "use v6.d" implies 6.d. This is to facilitate language version switching between 5/6 ala. the v5 module. * The spectests for 6.c should all "use v6.c" The way we choose to support different versions will evolve over time, as we (hopefully) get collectively smart enough to figure it out. :-) But roughly, we'll do something like this: * For added syntax, the grammar should check the language version in an assertion * Additions to the setting will be made in a "nested" setting. That is, a "use v6.d" will load CORE.d.setting or so. It can use augment and supercede in order to effect changes. To facilitate this, for now at least, we'll require that a "use v6.X" is the first non-comment, non-whitespace declaration in a file. Anything later will trigger a "too late to switch Perl 6 language version". ## Experimental features Experimental features can be turned on with a pragma: use experimental :macros; These are implementation specific and can go away at any time, though we'll likely be kind enough to give deprecation cycles. ## Trying out the "next version" To try out v6.d before the compiler officialy supports it, you can write: use v6.d.PREVIEW; ## If anyone asks about 6.d and beyond... About Perl 6.d, expect an incremental update. * It'll focus heavily on broadening test coverage to tighten up the language definition * It will include various small things we wished we could have done in 6.c, but just didn't have time: the missing regex backtracking controls, the sub-byte int types, non-parameter cases of coercion types, things we discover people miss especially in IO, etc. * Goal is sometime in 2017; we'll judge it based upon what we see (like, if there is a strong desire to get an incremental update out the door to cover things people really block on not having, we can do so) A lot of effort in 2016 was focused on performance engineering and making things more robust. This work will continue until the eventual feature freeze and release. Macros and slangs are the biggest post-6.c project language wise; if they happen to be in great shape by 6.d then they can make it in, but if not they'd be a reasonable target for 6.e. rakudo-2018.03/docs/line-editor.pod0000644000175000017500000000225713253717231015501 0ustar alexalex=head1 REPL LINE EDITOR The read-eval-print-loop (aka. the REPL) has the abilty to load a line editor module if one is available. This makes facilities such as line editing, persistent history, and symbol completion. If you don't have any line editing modules installed, you may use C to provide much of the same functionality. =head2 AVAILABLE EDITORS Right now, there are new line editor modules available: C and C. They have roughly the same functionality, but C provides tab completion, and C has an easier time with multibyte input. =head2 ENVIRONMENT VARIABLES The line editor used by the REPL can be configured via various environment variables, listed here. =over 4 =item RAKUDO_DISABLE_MULTILINE This disables multi-line input for the REPL if truthy. =item RAKUDO_HIST This specifies the location of the history file used by the line editor; the default is C<~/.perl6/rakudo-history>. =item RAKUDO_LINE_EDITOR This specifies the preferred line editor to use; valid values are C, C, and C. A value of C is useful if you want to avoid the recommendation message upon REPL startup. =back =cut rakudo-2018.03/docs/metamodel.pod0000644000175000017500000003207213253717231015233 0ustar alexalex=head1 The Rakudo Metamodel =head2 Warning What follows is the current way this works in Rakudo. Parts of it may one day become spec, other bits likely never will. All of it is liable to change as we work out what should be spec and what shouldn't be, and also co-ordinate with other implementations and interested parties to make sure those bits that we determine should be specification are spec'd in a way that matches our shared desires and needs, so far as that's possible. It goes without saying that in doing the things described in this document, you're walking barefoot through a construction site. For now, tread carefully, and be prepared to patch up in response to changes. =head2 Overview Meta-objects are simply objects that describe parts of the object model. The metamodel lays down the interface that these objects should provide. In Rakudo we have several types of meta-object, all of which have an associated API (sometimes known as a Meta-object Protocol, just to make sure the whole topic appears to be sufficiently scary to outsiders, or something). This document defines the API for: =over 4 =item Packages meta-objects (representing classes, grammars, roles, etc); ones included in Rakudo include ClassHOW, GrammarHOW and RoleHOW. =item Attribute meta-objects (representing attributes); the default one of these is simply called Attribute. =item Composition meta-objects (e.g. specifying role composition algorithms) =back The composition model warrants a little explanation, since it is broken into a couple of parts. We'll stick with classes and roles for now, but we define the interface in the expectation that one day we might want to have things that are composed into a class following some composition algorithm that may be given a different name. Thus we talk in terms of "composables". There are two important things. First, the actual composer - implementing the composition algorithm - is not a part of the thing we're composing or the thing we're composing into (that is, it is independent of the class and the role). Second, it is up to the thing being composed (e.g. the role in the case of composing a role into a class) to supply the composer. =head2 Package meta-object API (aka HOW API) This is the API for packages. When we compile something like: class Town is Place { method bar() { say "mmm beer" } } Then it results in a set of calls like: my $temp = ClassHOW.new('Town'); &trait_mod:($temp, Place); $temp.^add_method('bar', anon method bar() { say "mmm beer" }); ::Town := $temp.^compose(); Most of these are calls on the meta-class to methods that give meaning to the keywords the user wrote in their code. The following methods are supported as a minimum. =over 4 =item method new($name?) Creates something that knows how to provide its metaclass, e.g. through the same mechanism as C<.HOW> obtains it. It need not be the final type-object that may be installed in a namespace or lexpad - that is for compose to return. However, there's nothing to stop it being. Whether a new instance of the meta-class is created or not is totally up to the implementation of the C method. For the standard Perl 6 C keyword in Rakudo, we create an instance of the meta-class and a temporary object that only knows how to reference the meta-class instance. However, if you were doing a more prototype-OO implementation, then you could instead have the meta-class be a singleton and return a new object, and the object itself knows completely about its methods, attributes and so forth, rather than this knowledge belonging to the meta-class. =item add_method($meta, $name, &code_ref) Adds a method to the methods table of C<$meta> under the given C<$name> and with the given implementation. =item add_attribute($meta, $name) Adds an attribute of the given C<$name> to C<$meta>. =item add_parent($meta, $parent) Adds the given parent to C<$meta>. =item add_composable($meta, $composee) Takes something that we are able to compose (for example, a role) and adds it to the composition list. Certainly, none of the built-in implementations of add_composable immediately perform any composition at this point. Instead, they add the composable to a "to do" list, and at the point we call "compose" to finish the composition of the package, and the application of all the composables takes place. You probably want to do something similar. =item applier_for($meta, $target) For non-composables (that is, packages that cannot be composed into others), this is an error. Otherwise, it returns something that we can use to apply the current package to the target. The thing returned should implement the composer API. It may be convenient to implement this is a set of multi subs. =item compose($meta) Finalizes the creation of the package. It can do any other composition-time operations, such as role composition and calling the composition hook on all attributes added to the package. Returns the type object that we're going to actually install into the namespace or lexical pad, or just return if it's an anonymous declaration. =back This is the declarational part of the API, however the introspection part should also be implemented. Please see the Introspection section of S12 for details on this. =head2 Attribute meta-object API This is the API that objects representing attributes should expose. The attribute meta-object is responsible for generating any accessor and/or delegation methods associated with the attribute. =over 4 =item new($name, :$has-accessor, :$rw, :$handles, :$build, :$type) Creates a new attribute meta-object, initialized with the name, whether or not the attribute has an accessor, whether or not that accessor 'is rw' and - if there was a handles trait modifier on the attribute - the handles trait modifier. =item compose($meta-package) Takes the attribute and does any final composition tasks (such as installing any accessor methods and/or delegators). The parameter is the meta-object of the package that the attribute belongs to; you can call .add_method on it to add methods, for example. =back =head2 Composer meta-object API The composer is responsible for composing something composable (in standard Perl 6, that's a role) into some other object (perhaps a class or another role or an instance). The minimal interface need only support one method, but it may well be that a composee and a composer choose to share knowledge of more than this (for example, a "requires" or "conflicts" list). =over 4 =item apply($target, @composees) Applies all of the composees to the target, or throws an exception if there is a problem with doing so. It's totally up to the composer exactly what it does; the default composer for Perl 6 roles will construct a single intermediate role and then compose that into the target, for example. Since the model is intended for more general composition-y things rather than just roles as are commonly defined today, we choose to give the composer a view of all of the composees. =back =head2 Metaclass Compatibility Warning: Conjectural. One rather complex issue we run into is what happens if you want to inherit from something that has a different metaclass. For now, we require that if some class S isa T, then also S.HOW isa T.HOW. This means that all other types of class-ish things that want to have a custom metaclass should subclass ClassHOW (either directly or transitively). Thus, this is fine: class A { } thingy B is A { } otherthingy C is B { } If the following is true: OtherThingyHOW.isa(ThingyHOW) and ThingyHOW.isa(ClassHOW) =head2 Composer Compatibility Warning: Conjectural. TODO: Provide a solution to the problems described here. Given it's the things we compose that determine what composer to use, we may easily run into a situation where different things want a different composer. At some level that's OK - if we want to support a more general notion of "things that do something composition-ish" then it is probably too restrictive to just always make this an error in the long run. For now, however, we do just that; when we have a good solution, we can relax the restriction. We do have the nicety that once we hit runtime, since composition is flattening by nature, we don't have any relationship at runtime with something that was composed in (besides keeping it in our list of "things that we composed"). Thus the problem of the behaviors of two different appliers is only a composition-time issue and not a runtime one. =head2 Associating a package declarator with a metaclass Rakudo provides two levels of hookage for creating new types of package declarator. You will very likely only need this one, which is the HOW map, %*HOW. This is simply a hash that maps the name of a scope declarator to the name of the HOW to create. At the entry point to your derived grammar, you should temporize the current HOW hash from the calling language, and add mappings from names of package declarators that you will introduce to the HOW to use. By default, this hash contains things like: { class => 'ClassHOW', role => 'RoleHOW' } It's completely fine for multiple package declarators to map to the same HOW - you may just wish to introduce a new one as better documentation but not need to do anything more special in terms of the meta-model. Note that your rule for parsing the scope declarator sets the name of the thing in this map in the $*PKGDECL global. For example, here is one from STD. token package_declarator:role { :my $*PKGDECL ::= 'role'; } You should do the same (and it's probably nice if what you set matches the name of the symbol you parse). =head2 Meta-programming Example: Adding AOP Support Note that this currently does not work in Rakudo, and will probably change a bit. It's purpose is mostly a thought experiment to try and help sanify the design of the metamodel. slang AOP { method TOP { temp %*HOW; %*HOW := AspectHOW; my $lang = self.cursor_fresh( AOP ); $lang.comp_unit; } token package_declarator:sym { :my $*PKGDECL := 'aspect'; } } class AspectComposer { method apply($target, @aspects) { my @wrappables = $target.methods(:local); for @aspects -> $aspect { for $aspect.method_wrappers.kv -> $name, $wrapper { my ($wrappee) = @wrappables.grep({ .name eq $name }); if $wrappee { $wrappee.wrap($wrapper); } else { die "No sub found to wrap named '$name'"; } } } } } class Aspect { has $.HOW; has $.Str; method WHAT() { self } method defined() { False } } class AspectHOW { has %.method_wrappers; method new($name) { return Aspect.new( HOW => self.bless(*), Str => $name ~ "()" ); } method add_method($obj, $name, $method) { $.method_wrappers{$name} = $method; } multi method composer_for($obj, $ where { .can('methods') }) { return AspectComposer; } multi method composer_for($obj, Object) { die "Can only apply aspects to things that expose methods"; } method compose($obj) { return $obj; } method add_attribute($meta, $attr) { die "Aspects do not support attributes"; } method add_parent($meta, $parent) { die "Aspects do not support inheritance"; } method add_composable($meta, $composable) { die "Aspects do not support being composed into"; } } This could then we used as something like: use AOP; aspect LogToStderrToo { method log($message) { $*ERR.say($message); nextsame; } } class ErrorLog does LogToStderrToo { method log($message) { my $fh = open("log", :a); $fh.say($message); $fh.close; } } Note that a usable implementation would want a bit more than this, and have many other design considerations. =head2 Influencing package code generation Note: This is highly Rakudo-specific and very likely to remain that way. The good news is that you won't need to do it often. Rakudo has a compile-time representation of the package currently being compiled. This is the thing that ends up actually generating the code - PAST nodes - that make the calls on the metaclass. By default, we always create an instance of Perl6::Compiler::Package, apart from for roles and modules, for which we need to do some slightly different code generation - those use a subclass of it, such as Perl6::Compiler::Role. You may modify %*PKGCOMPILER, again keying on $*PKGDECL, to specify something other than the default. You should then write a subclass of an existing handler for this and implement the same interface (plus any other bits you'll need - it's just a class). rakudo-2018.03/docs/metaobject-api.pod0000644000175000017500000000606413253717231016152 0ustar alexalex=head1 Rakudo Meta-Object API This document describes the meta-objects that constitute Rakudo's objects implementation. It also describes the API to implement should you wish to introduce your own meta-objects. =head2 Meta-model Organization Rakudo is built on top of the NQP platform. NQP provides an object model core that is often known as "6model". It is inspired by the needs of Perl 6, but actually provides a very minimal base that other languages can build their own meta-objects on top of. While Rakudo could start from these base primitives, instead it makes use of some of the NQP meta-objects. Out of the box 6model provides no concept of classes or roles. NQP's meta-objects include a simple, non-parametric implementation of roles and a simple but capable implementation of classes. These are put to use in writing Rakudo's meta-objects. The Rakudo meta-objects are generally factored in terms of roles. These are composed into classes that represent the various types of Perl 6 package (such as classes and roles). =head2 Roles The following roles exist and provide re-usable pieces of functionality that can be re-used in various places in the meta-model. =head3 MethodContainer This role provides storage of methods, method addition and method introspection. =head3 MultiMethodContainer This role provides the extra pieces needed for multi-method handling. =head3 AttributeContainer This role provides storage of attributes, attribute addition and attribute introspection. =head3 RoleContainer This role provides storage of roles, role addition and role introspection. The composition process is not part of the functionality provided by this role, however. =head3 MultipleInheritance Provides for addition of multiple parents, and introspection of them too. =head3 C3MRO This role provides an implementation of the C3 method resolution order. =head3 Versioning This role provides storage and introspection of a version and authority. =head2 Classes The following classes exist in the Perl 6 meta-model. =head3 ModuleHOW Provides an implementation of modules. =head3 ClassHOW Provides an implementation of classes. =head3 ParametricRoleHOW Provides an implementation of parametric roles, which may be instantiated. =head3 ConcreteRoleHOW Provides an implementation of a concrete instance of a role. =head3 GrammarHOW Provides an implementation of grammars. Actually, just a subclass of the ClassHOW since grammars are really just slightly specialized classes. =head3 NativeHOW Meta-object for a native type (only accessible via the type object, perhaps). =head3 SubsetHOW Provides an implementation of subset types. =head3 Attribute Represents an attribute. =head3 RoleToClassComposer Composes a single role into a class. (If many roles are specified, it makes a single role that does all of the roles the class wishes to, and then composes that single role). =head3 RoleToRoleComposer Composes one or more roles into another role, creating a kind of role "summation". =head3 RoleToObjectComposer Composes a role into an object - essentially doing a mix-in. rakudo-2018.03/docs/module_management.md0000644000175000017500000006472213253717231016572 0ustar alexalex# Moving towards a better pre-comp and module management design ## Overview This document contains my (jnthn) input to where implementation work for Perl 6 module/precomp stuff should head. While much has been converged on by existing work, some problems have also been consistently avoided or punted on; robust pre-compilation management is one such issue. Everything here is subject to course corrections as implementation takes place, but it should hopefully set out a good direction to move in. Also, don't expect this to be a complete deign. It's as much as I had time to figure out before I vanish for a week on honeymoon, and I'm sharing it in its current state so that others can carry it forward. Thanks goes to lizmat++ for highly valuable input on an earlier private draft. ## Terminology To keep discussion precise, here are some definitions of the atoms under consideration: * A **compilation unit**, or **compunit** for short, is a piece of Perl 6 code that is analyzed and compiled as a single unit. Typically, this comes from a source file on disk, but what's inside an EVAL also counts as a compilation unit. * **Compilation** is the process by which a compilation unit is parsed and analyzed, and turned into a set of objects representing its declarations ("meta-objects") and executable code representing its statements. Note that, thanks to the many meta-programming features of Perl 6, compilation will involve the execution of code, some of which may come from the compilation unit being compiled (as happens with `BEGIN` blocks). * A **script** refers to a compilation unit that is provided to Perl 6 as the entry point for execution. In an invocation like `perl6 foo.p6`, we say that `foo.p6` is first compiled and then executed. In Rakudo Perl 6, in this case, the results of the compilation only exist in memory. * A **module** refers to a compilation unit that is used by a script, or by another module used from a script. A module must also be compiled before it can be made use of. (There is nothing preventing a given source file serving as both a script and a module depending on how it is used.) * A **distribution** is a set of zero or more scripts and modules that are distributed together, along with some meta-data and potentially with some resources and tests. This "usage" of modules by scripts and other modules is complex, and is the focus of much of this document. Some further terminology to enable precise discussion of the area is useful: * A **dependency specification** is how one module or script's need for another module is declared. In source code, it follows a `use` or `need` statement. An example is `Sereal:auth:ver(1..*)`. The same syntax is used in the `depends` section of a `META6.json`. * The **dependencies** of a script or module are identified during its compilation by evaluating the dependency specifications that follow its `use` or `need` statements. * The **transitive dependencies** of a script or module is the union of its dependencies together with the transitive dependencies of each of those dependencies (`TRAN-DEP(m) = Union(DEP(m), TRAN-DEP(d) | d in DEP(m))`). * The **reverse dependencies** of a module are those scripts and modules that have it as a dependency. * The **transitive reverse dependencies** of a module is the union of its reverse dependencies together with the transitive reverse dependencies of those reverse dependencies (`TRAN-REV(m) = Union(REV(m), TRAN-REV(m) | m in REV(m))`). * The **dependent distributions** of a distribution are those identified by evaluating the dependency specifications in a `META6.json`. The transitive, reverse, and reverse transitive relations can also be established. In this document, the term "dependency" will always refer to a dependency between compilation units, discovered at compile time of the depending compilation unit. Those declared in `META6.json` are instead known as distribution dependencies. They're very different concepts, and it's important to keep them apart. The first is interesting for precompilation management, and the latter for module installation tooling. ## Precompilation Precompilation is a mechanism for *caching* the results of compilation on disk, such that the overhead of compilation can be avoided in the future. The precompilation of a compilation unit can only be formed if all of its dependencies have already been precompiled (implying that at the point the precompilation of a module is completed, all of its transitive dependencies must have already been precompiled). Note this does not mean there is any need for the dependencies to be precompiled before precompilation of begins. It is not only reasonable, but also desirable, for dependencies to be precompiled "on demand" and recursively as they are discovered. That is, you start precompiling at the "top" of a dependency graph and by the time you've precompiled that module, the whole graph has been precompiled. Since resolving dependency specifications to dependencies is a part of the compilation process, a cached precompilation directly identifies the cached precompilations it depends on. That is to say, the compiled effect of a `use` or `need` statement is not to resolve a dependency specification, but instead to identify a precise dependency to load. This in turn means that no module database lookups are required. It also has the consequence that once you load an existing precompilation, all module resolution from that point on is "predestined". It's important, therefore, to ensure that precompilations are tied to the entire set of "repositories" available for consideration at the point they were formed. Furthermore, precompilations are statically linked against the precompilations of their transitive dependencies as well as against a particular compilation of the Perl 6 compiler and its `CORE.setting`. Therefore, the identify of the Perl 6 compiler - obtained through `$*PERL.compiler.id` - should also be considered part of the environment the precompilation was formed in. This will also support `rakudobrew` style tools, which enable switching between different versions and backends. In an ideal world, precompilation would always be possible for all compilation units. In reality, some things simply won't work out. Stashing a file handle in a BEGIN block and reading from it later won't work, because file handles cannot be serialized. And trying to load the precompilation of two modules that make incompatible `augment`ations to the same class can be expected to fail. While we can culturally encourage writing `precompilation-clean` code, it's also important to provide a mechanism whereby a compilation unit can opt out. This in turn means that its transitive reverse dependencies can not be precompiled. A compilation unit can declare it is not elligible for being precompiled with: no precompilation; ## Repositories Something that can locate and load modules, and potentially manage their installation and precompilation, is known as a **repository** (or, more fully, a compilation unit repository). A repository at its simplest could just map module names to source files on disk. A more complex repository might support installation of a distribution's modules along with associated resources, as well as managing precompilation of modules. Repositories are structured as a linked list - that is, a repository may refer to another. A repository can always provide its unique identity, which must incorporate the identity of any repository it refers to. In normal startup, the `PROCESS::<$REPO>` symbol will be set a default repository that supports the installation of distributions (a `CompUnit::Repository::Installation`). Any `-I` includes, or any paths in a `PERL6LIB` environment variable, will cause `PROCESS::<$REPO>` to instead point to a chain of repositories that ends with the default `CompUnit::Repository::Installation` that is normally there. A `use lib` installs a lexical `$?REPO` which takes precedence over that in `PROCESS`. Note that for Perl 6.christmas, we will only support the use of `use lib` in scripts, not in modules, as its interaction with precompilation is more complex than we have time to reasonably consider (and it's better to wait until we've a good answer than to use a hacky one now). This linked list replaces `@?INC`. There are a number of benefits to this design: * Precompilations **must** factor in the whole set of repositories that could have been considered when resolving a dependency specification. To see why, consider an installed module M that contains `use N`. Its precompilation will have been done at installation time, and so only considered other installed modules `N`. Later, the developer of `N` is developing a new version, and uses `-Ilib` to ensure this new `N` is used. His test script does `use M`, and the expectation would be that the `N` is `lib` is loaded. However, if we hit the precomp of `M`, it has already committed to an installed `N`. For correct behavior, the repository for `-Ilib` - assuming it supports precompilation management - must itself manage precompilations for the whole transitive dependency chain. Put another way, only the module precompilations stored by the repository at the head of the chain are valid. This is most easily delivered by the head of the chain passing its precomp repository "down the chain". * You can trivially implement a repository that gives you a "clean room" with no system-wide modules just by it never delegating to the next thing in the chain. * If you want "parallel" consideration of a set of other repositories with no ambiguities allowed across them, or "sequential" consideration of a set of repositories with the first providing a resolution winning, these can both be provided by a repository that contains an array of other repositories and delegates as needed. * It's easier to test repository implementations in isolation if they're not tied up with some global state, like an `@?INC`. ## Module management API The module management API can be broken up into: * **Guts** provided by a Perl 6 implementation (e.g. Rakudo) that do the various low-level tasks. * **Entities** that capture the information associated with concepts such as "dependency specification" and "compilation unit". * **Roles** for the various aspects of module management. Some of these are pure interfaces (that is, entirely required methods). Others provide default implementations that will usually be sufficient, and just need some details to be filled in. * **Provided implementations** of those interfaces for a number of common use cases. Alternative implementations of the roles to handle use cases beyond what Perl 6 provides direct support for are both expected and encouraged. ### Guts #### CompUnit::Loader The `CompUnit::Loader` is responsible for actually loading a compilation unit into memory, either from source or a precompiled representation. It can work with both files and in-memory byte buffers in either case. Implementations are free to efficiently `mmap` files into memory, allowing a single copy of a precompiled module to exist in memory and be shared by many Perl 6 processes. The methods on this are all expected to be called on the `CompUnit::Loader` type object. class CompUnit::Loader is repr('Uninstantiable') { # Load a file from source and compile it method load-source-file(Str $path) returns CompUnit::Handle { ... } # Decode the specified byte buffer as source code, and compile it method load-source(Buf:D $bytes) returns CompUnit::Handle { ... } # Load a pre-compiled file method load-precompilation-file(Str $path) returns CompUnit::Handle { ... } # Load the specified byte buffer as if it was the contents of a # precompiled file method load-precompilation(Buf:D $bytes) returns CompUnit::Handle { ... # XXX this one needs MoarVM/JVM backends to expose a new API } } The `CompUnit::Loader` class only expects to be asked to load a given source or precompiled file into memory once. Asking it to load the same pre-compiled file twice is erroneous. Provided this is respected, concurrent calls to the methods of `CompUnit::Loader` are allowed. #### CompUnit::Handle The `CompUnit::Handle` class is a handle to a loaded compilation unit. Its exact internals are implementation defined, but it can be expected to have the following methods: class CompUnit::Handle { # If the compilation unit has a callable EXPORT subroutine, it will # be returned here. A Callable type object otherwise. method export-sub() returns Callable { ... } # The EXPORT package from the UNIT of the compilation unit; a # Stash type object if none method export-package() returns Stash { ... } # The EXPORTHOW package from the UNIT of the compilation unit; # a Stash type object if none. method export-how-package() returns Stash { ... } # The GLOBALish package from the UNIT of the compilation unit # (the module's contributions to GLOBAL, for merging); a Stash # type object if none. method globalish-package() returns Stash { ... } } Since these methods are all reads, it is safe for them to be called concurrently on the same instance. (If the internal implementation is not automatically threadsafe, it must do appropriate concurrency control, so consumers of this class don't have to worry.) #### Importation/Global Merging We'll likely end up wanting to factor this into some guts-providing class too, to be discovered/defined during implementation. ### Entities #### CompUnit::DependencySpecification A dependency specification consists of a short name for a module (for example, `Grammar::Tracer`), and optionally a version matcher and auth matcher (which will be smart-matched against the version and authority of a potential dependency to see if it is satisfactory). class CompUnit::DependencySpecification { has Str:D $.short-name is required; has $version-matcher = True; has $auth-matcher = True; } #### CompUnit A compilation unit is represented as follows: class CompUnit { # The CompUnit::Repository that loaded this CompUnit. has CompUnit::Repository $.repo is required; # That repository's identifier for the compilation unit. This is not # globally unique. has Str:D $.repo-id is required; # The low-level handle. has CompUnit::Handle $.handle is required; # The short name, version, and auth of the compilation unit, if known. has $.short-name; has $.version; has $.auth; # Whether the module was loaded from a precompilation or not. has Bool $.precompiled = False; # The distribution that this compilation unit was installed as part of # (if known). has Distribution $.distribution; } #### Distribution To be more fully defined, but consists of the metadata from a META6.info and a way to reach any resources declared within it. ### Roles #### CompUnit::PrecompilationStore A precompilation store provides storage of pre-compiled things. It is not concerned with precompilation validity, just storage. Most of the time, the Perl 6 built-in implementation that stores precompiled files on disk will be sufficient. However, a tool that wished to bundle a Perl 6 implementation together with a bunch of precompiled scripts/modules for distribution would do an alternative implementation of this role. subset CompUnit::PrecompilationId of Str:D where { 2 < .chars < 64 && /^<[A..Za..z0..9_]>$/ }; role CompUnit::PrecompilationStore { # Load the precompilation identified by the pairing of the specified # compiler and precompilation ID. method load(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id) { ... } # Store the file at the specified path in the precompilation store, # under the given compiler ID and precompilation ID. method store(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id, Str:D $path) { ... } # Delete an individual precompilation. method delete(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id) { ... } # Delete all precompilations for a particular compiler. method delete-by-compiler(CompUnit::PrecompilationId $compiler-id) { ... } } The `CompUnit::PrecompilationId` subset type restricts the identifiers that can be passed to things that should be valid on any even slightly modern file system. #### CompUnit::PrecompilationRepository A precompilation manager is responsible the creation, location, and validity testing of precompiled modules. The only thing it's not concerned with is their actual storage. Therefore, a precompilation repository will typically be configured with an implementation of `CompUnit::PrecompilationStore`. #### CompUnit::Repository A class implementing the `CompUnit::Repository` role knows how to resolve a dependency specification to a concrete dependency and load it. It can also provide a list of all the compilation units it has loaded. Implementations of this role should take care to cache dependencies they already loaded, so the same `CompUnit` instance can be handed back each time the same dependency is requested. Further, implementations of `CompUnit::Repository` should cope with concurrent calls. The `CompUnit::Repository` role is defined as follows: role CompUnit::Repository { # Resolves a dependency specification to a concrete dependency. If the # dependency was not already loaded, loads it. Returns a CompUnit # object that represents the selected dependency. If there is no # matching dependency, throws X::CompUnit::UnsatisfiedDependency. method need(CompUnit::DependencySpecification $spec, # If we're first in the chain, our precomp repo is # the chosen one. CompUnit::PrecompilationRepository $precomp = self.precomp-repository()) returns CompUnit:D { ... } # Returns the CompUnit objects describing all of the compilation # units that have been loaded by this repository in the current # process. method loaded() returns Iterable { ... } method precomp-repository() returns CompUnit::PrecompilationRepository { CompUnit::PrecompilationRepository::None } } The `X::CompUnit::UnsatisfiedDependency` type is defiend as: class X::CompUnit::UnsatisfiedDependency is Exception { has DependencySpecification $.specification; method message() { ... } } If there is no unique module that can be considered the "best" given the specification, an `X::CompUnit::AmbiguousDependencySpecification` exception will be thrown: class X::CompUnit::AmbiguousDependencySpecification is Exception { has DependencySpecification $.specification; has @.ambiguous; method message() { ... } } #### CompUnit::Repository::Installable A compilation unit repository that supports installation of distributions should implement the following role: role CompUnit::Repository::Installable does CompUnit::Repository { # Installs a distribution into the repository. method install( # A Distribution object Distribution $dist, # A hash mapping entries in `provides` to a disk location that # holds the source files; they will be copied (and may also be # precompiled by some CompUnit::Repository implementations). %sources, # A hash mapping entries in the `resources` to a disk location # that holds the files; again, these will be copied and stored. %resources) { ... } # Returns True if we can install modules (this will typically do a # .w check on the module databaes). method can-install() returns Bool { ... } # Returns the Distribution objects for all installed distributions. method installed() returns Iterable { } } ### Implementations #### CompUnit::PrecompilationStore::File An implementation of a precompilation store that stores the files on disk. It expects to be constructed with a prefix. my $psf = CompUnit::PrecompilationStore::File.new( prefix => "$path/.precomp" ); Its directory layout is straightforward: one directory per compiler ID, which contains subdirectories named for the first two letters of the precompilation ID, which in turn contain the files. So: $psf.store('comp-1', 'deafbeef'); $psf.store('comp-2', 'deafbeef'); $psf.store('comp-1', 'baadf00d'); Would create: $path/.precomp/comp-1/ba/baadf00d $path/.precomp/comp-1/de/deadbeef $path/.precomp/comp-2/de/deadbeef Those used to Git internals will note this is the same structure as it uses for loose objects. #### CompUnit::Repository::Installation The installation compilation unit repository supports both installation and precompilation. It expects to be configured with a directory, where it will keep both original sources and precompilations. class CompUnit::Repository::Installation does CompUnit::Repository::Installable { has $.prefix is required; ... } This repository expects that any changes to modules installed through it will be done directly using it, and so any changes to module sources done directly will not be taken into account. Under its prefix, an installation repository establishes the following structure: repo.lock # A lock file dist/[sha1] # JSON-serialized distribution info (SHA-1 of dist ID) sources/[index] # Module source files, by ascending ID resources/[index] # Module resourece files, by ascending ID short/[sha1] # Short-name quick lookup file by sha1 of the shortname precomp/... # Precompilation store dependencies # Pairs of short-name to short-name SHA-1s HEAD # Current identifier When we install a distribution, we do the following: 1. Create the `repo.lock` file; if it already exists, fail. 2. Create a SHA-1 of the unique identifier for the distribution, and check it does not already exist in `dist`; delete lock file and fail if so. 2. Copy each of the source files into `sources`, allocating each one an ascending ID. 3. Copy each of the resource files into `resources`, allocating each one an ascending ID. 4. Update the Distribution object with this logical name => ID mapping. 5. Serialize the Distribution object and store it into `dist`, using the SHA-1 of its unique identifier for the file name. 6. XXX precomp newly added source files 7. Load the dependencies file, and compute the transitive closure of short name relations from it. 8. Take the provides section of the distribution, SHA-1 all the short names, and then find the the transitive reverse dependencies on those short names. This gives the set of modules whose precompilations will be invalidated by the new modules. 9. XXX precompile all of those impacted modules 10. Insert any new dependencies into the shortname dependency graph, and save it back to disk. 11. Create/update the shortcut file for quick module resolution. 11. Delete the `repo.lock` file. If a `CompUnit::Repository::Installation` is not the final repository in a linked list, then it must also be sure to invalidate its precompilations if the identity of the next repository in the chain changes. (Since the usual case is per-user modules, it's reasonable to assume there will be write access to the precomp directory to update it). Further, when queried for a module, a `CompUnit::Repository::Installation` that is followed in the chain by another `CompUnit::Repository::Installation` should consider its set of modules together with its own, such that the best option across the two of them wins (and if there are ambiguities, the nesting level does not count as a resolution). (Conjectural: we could have a CompUnit::Repository::Installation::Override that always considers itself to know better, and only delegates if it can't do better.) XXX The exact factoring here may want a little futher explanation. #### CompUnit::Repository::FileSystem The file system compilation unit repository is used when the `-I` flag is specified. It is initialized with a prefix. It assumes it will be able to create and write to a `.precomp` directory beneath that path. When it is asked for a module, it first checks if it has a precompilation for it. If so, it ensures it is still valid. The validy check involves: * Checking the identity of the next repository in the chain * Checking the modification time of the module itself * Checking the modification times of the transitive dependencies of that module that live within this CompUnitRepo::FileSystem A `CompUnit::Repository::FileSystem` always tries to satisfy a request for a module first, and only delegates if it is unable. It also doesn't care for versioning or authority. class CompUnit::Repository::FileSystem does CompUnit::Repository { has $.prefix is required; ... } ## Questions and, if you're lucky, answers ### Where libraries are installed? System-wide modules go in a path derived from the `--prefix` that Rakudo is built with. The `Configure.pl` script can also be given a `--module-prefix`, which will override this. Tools like rakudobrew will likely wish to specify a single common `--module-prefix` so modules are shared between the things they will switch between. This directory will be managed by an instance of `CompUnitRepo::Installation`. A user's local module installations go into a `.perl6` in their home directory, with precompilations under it in `.perl6/precomp/`. This will be managed by a `CompUnit::Repository::Installation` (which will delegate to the system-wide `CompUnit::Repository::Installation`). ### What about `@?INC`? It's gone. ### How does an installer choose the right target repository? Good question. Perhaps there should be a lookup mechanism of installation repositories by some kind of identifier ("system", "user", etc.) ### What about `%?CUSTOM_LIB`? Probably also gone, though probably also partly covered by whatever we build to satisfy the previous question. rakudo-2018.03/docs/obtaining-a-commit-bit.pod0000644000175000017500000000475413253717231017524 0ustar alexalex=head1 How to obtain a commit bit for the Rakudo repository? Firstly, what's a "commit bit"? If you don't know what it is, you probably don't need one :-) But, in any case, a "commit bit" is the colloquial way that L<#perl6|https://webchat.freenode.net/?channels=#perl6> describes how you obtain access to make commits directly to the rakudo repository. (i.e., not via a fork and pull request, but directly to https://github.com/rakudo/rakudo) B if you haven't already, is to send a signed copy of the Contributor License Agreement (CLA) to the Perl Foundation. The CLA and the address it can be mailed to can be found at http://www.perlfoundation.org/contributor_license_agreement Some contributors chose to email the CLA to C instead; you can speak to C<[Coke]> on L for details about the process as well as follow up on whether your CLA has been received by The Perl Foundation. Why is a signed CLA necessary for commit access? The CLA helps protect the Perl Foundation and the Rakudo project and contributors alike from intellectual property issues. The CLA warrants that your contributions are yours to give and that they are not encumbered by anyone else's intellectual "lien" on those contributions. For instance, some employment contracts stipulate that any intellectual property that you generate belongs to your employer whether you generate it during work or after hours at home or while on vacation. If your employment contract has such a stipulation, you must seek permission from your employer such that you can contribute to Rakudo without fear that your employer will later claim ownership of your contributions. The CLA says that you have done the due diligence in these matters and that as far as you are aware, your contributions are yours alone to give. B and it's received by The Perl Foundation you can then inquire on L about getting commit access to the Rakudo repository. The main source code repository for Rakudo is administered on GitHub, so it would be a good idea to have a github account before you request a commit bit. There is at least one officer of the Perl Foundation on #perl6 who can verify the reception of your signed CLA and several people that can then add you to the Rakudo project. Typically a commit bit is granted after a new contributor has submitted a few good patches. rakudo-2018.03/docs/ops.markdown0000644000175000017500000001310713253717231015123 0ustar alexalex# TABLE OF CONTENTS - [Rakudo Opcodes] - [p6argsfordispatcher](#p6argsfordispatcher) - [p6argvmarray](#p6argvmarray) - [p6bindassert](#p6bindassert) - [p6bindattrinvres](#p6bindattrinvres) - [p6bindcaptosig](#p6bindcaptosig) - [p6bindsig](#p6bindsig) - [p6bool](#p6bool) - [p6box_i](#p6box_i) - [p6box_n](#p6box_n) - [p6box_s](#p6box_s) - [p6box_u](#p6box_u) - [p6capturelex](#p6capturelex) - [p6capturelexwhere](#p6capturelexwhere) - [p6captureouters2](#p6captureouters2) - [p6clearpre](#p6clearpre) - [p6configposbindfailover](#p6configposbindfailover) - [p6decodelocaltime](#p6decodelocaltime) - [p6decontrv](#p6decontrv) - [p6definite](#p6definite) - [p6finddispatcher](#p6finddispatcher) - [p6getouterctx](#p6getouterctx) - [p6init](#p6init) - [p6inpre](#p6inpre) - [p6invokeflat](#p6invokeflat) - [p6invokehandler](#p6invokehandler) - [p6invokeunder](#p6invokeunder) - [p6isbindable](#p6isbindable) - [p6recont_ro](#p6recont_ro) - [p6reprname](#p6reprname) - [p6return](#p6return) - [p6scalarfromdesc](#p6scalarfromdesc) - [p6setautothreader](#p6setautothreader) - [p6setbinder](#p6setbinder) - [p6setfirstflag](#p6setfirstflag) - [p6setpre](#p6setpre) - [p6settypes](#p6settypes) - [p6sink](#p6sink) - [p6sort](#p6sort) - [p6stateinit](#p6stateinit) - [p6staticouter](#p6staticouter) - [p6store](#p6store) - [p6takefirstflag](#p6takefirstflag) - [p6trialbind](#p6trialbind) - [p6typecheckrv](#p6typecheckrv) - [p6var](#p6var) ## p6argsfordispatcher * p6argsfordispatcher(Sub $dispatcher) ## p6argvmarray * p6argvmarray() ## p6bindassert * p6bindassert(Mu $obj, Mu $target) Check if $obj can bind into a container typed with type $target and return $obj. ## p6bindattrinvres * p6bindattrinvres(Mu $obj, Mu $type, str $attr-name, Mu $value) Bind $value into Attribute $attr-name of object $obj of type $type and return $obj. This desugars to: { bindattr($obj, $type, $attr-name, $value); $obj; } ## p6bindcaptosig * p6bindcaptosig(Mu $signature, Mu $capture) ## p6bindsig * p6bindsig() ## p6bool * p6bool(Mu $value) Create a Perl 6 Bool from $value. ## p6box_i * p6box_i(int $value) Box a native int into a Perl 6 Int. ## p6box_n * p6box_n(num $value) Box a native num into a Perl 6 Num. ## p6box_s * p6box_s(str $value) Box a native str into a Perl 6 Str. ## p6box_u * p6box_u(uint $value) Box a native uint into a Perl 6 UInt. ## p6capturelex * p6capturelex(Mu $closure) Given the specified code object, sets its outer to the current scope. Must be called in the immediate outer scope of the block in question. ## p6capturelexwhere * p6capturelexwhere(Mu $closure) ## p6captureouters2 * p6captureouters2(Mu $coderef) ## p6clearpre * p6clearpre() Clears the "pre" flag in the current frame. ## p6configposbindfailover * p6configposbindfailover(Mu $type, Mu $failover-type) Configures the Binder to allow $failover-type to bind to $type in subroutine invocation. ## p6decodelocaltime * p6decodelocaltime(int $epoch) Decodes the unix timestamp $epoch into a native int array with six fields containing second, minute, hour, day, month, year in that order. ## p6decontrv * p6decontrv(Mu $type, Mu $value) ## p6definite * p6definite(Mu $obj) ## p6finddispatcher * p6finddispatcher(str $value) ## p6getouterctx * p6getouterctx(Mu $closure) ## p6init * p6init() Initializes the GlobalContext extensions for Perl 6. ## p6inpre * p6inpre() Checks for the "pre" flag on the current frame, returns it, and clears it if it was set. ## p6invokeflat * p6invokeflat(Mu $block, Mu $value-buffer) ## p6invokehandler * p6invokehandler(Mu $handler-name, Mu $exception) Invokes handler $handler-name to handle Exception $exception. ## p6invokeunder * p6invokeunder(Mu $code, Mu $closure) Invokes $code under $closure. ## p6isbindable * p6isbindable(Mu $signature, Mu $capture) Checks if Capture $capture can bind to Signature $signature. ## p6recont_ro * p6recont_ro(Mu $value) Recontainerizes $value into a read-only container. ## p6reprname * p6reprname(Mu $obj) Returns the name of the REPR underlying $obj. ## p6return * p6return(Mu $value) ## p6scalarfromdesc * p6scalarfromdesc(Mu $container-descriptor) ## p6setautothreader * p6setautothreader(Mu $auto-threader) Registers a callable that handles the case where a call didn't succeed because it contained Junction arguments. ## p6setbinder * p6setbinder(Mu $binder) Register the class that handles binding. Its methods `bind`, `bind_sig`, `is_bindable`, and `trial_bind` are used throughout the rakudo codebase. ## p6setfirstflag * p6setfirstflag(Mu $coderef) Sets the "first" flag on a code object, then returns that code object. Used to handle FIRST phaser blocks. ## p6setpre * p6setpre() Sets the "pre" flag on the current frame. ## p6settypes * p6settypes(Mu $stash) ## p6sink * p6sink(Mu $past) ## p6sort * p6sort(Mu @data, Mu &comparator) ## p6stateinit * p6stateinit() ## p6staticouter * p6staticouter(Mu $coderef) ## p6store * p6store(Mu $container, Mu $value) ## p6takefirstflag * p6takefirstflag(Mu $coderef) Returns the value of the "first" flag of a code object and clears it. Used to handle FIRST phaser blocks. ## p6trialbind * p6trialbind(Mu $signature, Mu @types, Mu @flags) Tries a compile-time signature bind against @types with @flags ## p6typecheckrv * p6typecheckrv(Mu $return-value, Mu $routine, Mu $bypass-type) Checks if $return-value satisifies the declared return type of $routine, letting $bypass-type bypass the typecheck. ## p6var * p6var(Mu $variable) rakudo-2018.03/docs/release_guide.pod0000644000175000017500000004252013253717231016060 0ustar alexalex=encoding UTF-8 =head1 release_guide.pod - guide to Rakudo releases Rakudo’s development release cycle is the third Saturday of each month. Each development release is given a sequential number and a name based on the release year and month. Older releases had code names based on an active Perl Mongers group. For releases made so far, see the list of development releases at the end of this document. =head2 Planned future releases Note that we are trying very hard to ensure there are no backward compatibility issues post Christmas. As such, we may end up delaying some releases to ensure any compatibility issues are resolved. 2018-04-21 Rakudo #122 (AlexDaniel + Releasable) 2018-05-19 Rakudo #123 2018-06-16 Rakudo #124 2018-07-21 Rakudo #125 2018-08-18 Rakudo #126 2018-09-15 Rakudo #127 2018-10-20 Rakudo #128 2018-11-17 Rakudo #129 2018-12-15 Rakudo #130 (More planned dates can be generated with F). =head2 Steps to create a release (for release managers) =over 4 =item 1. A few days before the Rakudo release, it’s a good idea to... =over 4 =item * Remind people of the upcoming release, invite people to update the ChangeLog file, update the ROADMAP, etc. =item * Check if any DEPRECATED code needs to be removed because the end of the deprecation cycle is reached. One way of doing this, is to grep on the YYYYMM of the release (e.g. 201412 for the 2014.12 release). If you find any occurrences, remove the code and make sure the spectest is still ok. =item * Review the RT queue for tickets that might need resolving prior to the release, addressing them as needed. “Tickets that need resolving” is left to your discretion. Any problem that has a large impact on users is worth addressing either as a fix or as prominent documentation (the README and/or the release announcement). =item * B, especially the day before the release. Otherwise issues with MoarVM/NQP might go unnoticed for too long. =item * Create a draft release announcement in docs/announce/YYYY.MM.md in markdown format. You can often use the previous release’s file as a starting point, updating the release number, version information, name, etc. as appropriate. git add docs/announce/YYYY.MM.md git commit docs There is a helper script C that will create a basic release announcement for you based on the state of the repository and the current date. Feel free to use it to save yourself some time, but please look over its output if you decide to use it: ./perl6 tools/create-release-announcement.p6 > docs/announce/YYYY.MM.md =item * If it’s a month relatively early in the calendar year, double-check that the copyright date in the README file includes the current year. (It’s not necessary to update copyright dates in other files, unless you know that a given file has been modified in a year not reflected by the file’s copyright notice.) =back =item 2. Update Rakudo’s leap-second tables: perl tools/update-tai-utc.pl If a new leap second has been announced, F will be modified, so commit the new version. B be sure to double check the modifications are correct before committing. git commit src But probably there won’t be any new leap seconds, in which case the file will be unchanged. B: this program requires the perl modules L, L and L to be installed. =item 3. As the actual release date nears, review the git log history to see if any additional items need to be added to the ChangeLog. This can be conveniently done with git log --since=yyyy-mm-dd --reverse # find commits # update ChangeLog git commit docs/ChangeLog # commit changes =item 4. When it’s time to cut the release, finalize the new release announcement in docs/announce/YYYY.MM.md . (If one hasn’t already been created, see step 1 above.) Highlight areas in which the new release is significant. Include a list of contributors since the last release in the announcement. You can get an automatically generated list by running ./perl6 tools/contributors.p6 To obtain all contributors, ensure you have all supporting repositories checked out, before running (this can be achieved by building rakudo and running a spectest). Please check the result manually for duplicates and other errors. Note that you may not be able to run your system perl6 in a local checkout, you may have to wait until you build in this directory and use C<./perl6>. git add docs/announce/YYYY.MM.md git commit docs =item 5. Update the release dates and names at the bottom of this file (F). Also improve these instructions if you find any steps that are missing. git commit docs/release_guide.pod =item 6. Ensure that a monthly MoarVM release has been completed. Those releases are typically handled by a separate team. Since you are going to perform smoke testing of the ecosystem, it is likely that MoarVM release team will wait for your confirmation before cutting a release. Make sure that MoarVM builds on Windows (see AppVeyor status). It is also a good idea to look for JVM issues at this point. =item 7. Create an NQP release with the same C version number as Rakudo. Follow NQP’s L file to do that. =item 8. Go back to the Rakudo repository, and update the NQP dependency: echo YYYY.MM > tools/build/NQP_REVISION git commit -m '[release] bump NQP revision' tools/build/NQP_REVISION =item 9. Enter the new version into the F file, and commit the changes: echo YYYY.MM > VERSION git commit -m '[release] bump VERSION' VERSION =item 10. Make sure any locally modified files have been pushed back to github. git status git push =item 11. Make sure everything compiles and runs from a known clean state: make realclean perl Configure.pl --gen-moar --backends=ALL make make install make test =item 12. Install Inline::Perl5 so stresstest can use it. git clone https://github.com/ugexe/zef export PATH=`pwd`/install/bin:$PATH cd zef; perl6 -Ilib bin/zef install . cd .. export PATH=`pwd`/install/share/perl6/site/bin:$PATH zef install Inline::Perl5 =item 13. Now run the stresstests for stable and lastest specs. The following commands assume you already have a roast checkout in C. If not, run C (you can abort it after the repository is retrieved). (cd t/spec && git checkout master) # test latest language spec make stresstest (cd t/spec && git checkout 6.c-errata) # test stable language spec make stresstest There are many tests to run for the stresstest target. If you have a machine with multiple CPU cores, you may want to execute that last as TEST_JOBS=4 make stresstest where 4 is the number of CPU cores. This should make the total time to execute all of the tests dramatically less. Note that any failures against the stable language spec B be fixed before a release can be made. Also, you will see warnings about missing test files; this is because we only have one list of files, and new tests may have been added after the last version of the spec was frozen. Continue adjusting things until make stresstest passes as expected. Often this means fixing a bug, fudging a test, or (temporarily?) commenting out a test file in t/spectest.data . Use your best judgment or ask others if uncertain what to do here. =item 14. B: this step removes any untracked files in F. So please make a backup if you have any important data in there. Create a tarball by entering C, where YYYY.MM is the month for which the release is being made. This will create a tarball file named C. Because we tested the stable language spec last, above, those are the tests that will end up in the release tarball. =item 15. Unpack the tar file into another area, and test that it builds and runs properly using the same process in steps 11-13. For step 13, just run "make stresstest"; you're only testing the official spec tests here, and cannot switch between branches. If there are any problems, fix them and go back to step 11. =item 16. Tag the release by its release month ("YYYY.MM") and its code name. git tag -u -s -a -m "tag release #nnn" YYYY.MM # e.g., 2013.08 git push --tags The C<-s> tells git to sign the release with your PGP/GPG key, so it will likely ask you for the passphrase of your secret key. If you have no PGP key, you might need to L. Should that prove impossible, you can omit the C<-s> from the command line. Be sure to upload your public key to your GitHub account, so that GitHub displays I button next to the tag. You can do that by running C<< gpg --armor --export >> and adding the output as the I at the bottom of the L<< settings -> keys page|https://github.com/settings/keys >> =item 17. Sign the tarball with your PGP key: gpg -b --armor rakudo-YYYY.MM.tar.gz =item 18. Upload the tarball and the signature to L and L: scp rakudo-YYYY.MM.tar.gz rakudo-YYYY.MM.tar.gz.asc \ rakudo@rakudo.org:public_html/downloads/rakudo/ scp rakudo-YYYY.MM.tar.gz rakudo-YYYY.MM.tar.gz.asc \ rakudo@www.p6c.org:public_html/downloads/rakudo/ If you do not have permissions for that, ask one of (pmichaud, jnthn, FROGGS, masak, tadzik, moritz, PerlJam/perlpilot, [Coke], lizmat, timotimo, fsergot, hoelzro, Zoffix) on #perl6 or #perl6-dev to do it for you. =item 19. To avoid public confusion with Rakudo Star releases, we now publish compiler release announcements ONLY to perl6-compiler@perl.org. (We may restart widespread announcements of compiler releases once they are known, or we may begin publishing a single announcement for both.) Don’t send out any announcements until the files are actually available per step 14 above. =item 20. Update the Wikipedia entry at L. =item 21. You’re done! Celebrate with the appropriate amount of fun. =back =head2 Releases so far Previous releases were bundled as part of monthly Parrot releases. 2009-02-26 Rakudo #14 "Vienna" (pmichaud) 2009-03-20 Rakudo #15 "Oslo" (pmichaud) 2009-04-23 Rakudo #16 "Bratislava" (pmichaud) 2009-05-21 Rakudo #17 "Stockholm" (pmichaud) 2009-06-18 Rakudo #18 "Pittsburgh" (pmichaud) 2009-07-23 Rakudo #19 "Chicago" (moritz) 2009-08-20 Rakudo #20 "PDX" (kyle) 2009-09-17 Rakudo #21 "Seattle" (particle) 2009-10-22 Rakudo #22 "Thousand Oaks" (duff) 2009-11-19 Rakudo #23 "Lisbon" (masak) 2009-12-17 Rakudo #24 "Seoul" (chromatic) 2010-01-22 Rakudo #25 "Minneapolis" (pmichaud) 2010-02-18 Rakudo #26 "Amsterdam" (mberends) 2010-03-18 Rakudo #27 "Copenhagen" (smash) 2010-04-22 Rakudo #28 "Moscow" (moritz) 2010-05-20 Rakudo #29 "Erlangen" (colomon) 2010-06-17 Rakudo #30 "Kiev" (masak) 2010-07-22 Rakudo #31 "Atlanta" (Coke) 2010-08-19 Rakudo #32 "Pisa" (mathw) 2010-09-23 Rakudo #33 "Milan" (moritz) 2010-10-21 Rakudo #34 "Paris" (duff) 2010-11-18 Rakudo #35 "Melbourne" (masak) 2010-12-23 Rakudo #36 "New York" (smash) 2011-01-20 Rakudo #37 "BristolBath" (tadzik) 2011-02-17 Rakudo #38 "Toulouse" (arnsholt) 2011-03-17 Rakudo #39 "Orlando" (jdhore) 2011-04-21 Rakudo #40 "ZA" (duff) 2011-05-19 Rakudo #41 "Dahut" (jdhore) 2011-06-23 Rakudo #42 "Bruxelles" (jdhore) 2011-07-21 Rakudo #43 "Beijing" (mberends,moritz) 2011-09-30 Rakudo #44 "Riga" (tadzik) 2011-10-20 Rakudo #45 "Houston" (duff) 2011-11-17 Rakudo #46 "London" (tadzik) 2011-12-22 Rakudo #47 "Columbus" (moritz) 2012-01-23 Rakudo #48 "Toronto" (moritz) 2012-02-23 Rakudo #49 "SPb" (masak) 2012-03-22 Rakudo #50 "Argentina" (masak) 2012-04-19 Rakudo #51 "Brazos Valley" (Coke) 2012-04-25 2012.04.1 (moritz) 2012-05-17 Rakudo #52 "MadMongers" (tadzik) 2012-06-21 Rakudo #53 "Strasbourg" (duff) 2012-07-19 Rakudo #54 "Tallinn" (masak) 2012-08-23 Rakudo #55 "Frankfurt" (tadzik,moritz) 2012-09-20 Rakudo #56 "Perl" (masak) 2012-09-29 2012.09.1 (pmichaud) 2012-10-18 Rakudo #57 "Tokyo" (duff) 2012-11-22 Rakudo #58 "Walnut" (FROGGS) 2012-12-20 Rakudo #59 "Warszawa" (masak) 2013-01-17 Rakudo #60 "Sonoma" (isBEKaml) 2013-02-21 Rakudo #61 "drinkers" (tadzik) 2013-02-23 2013.02.1 (moritz) 2013-03-21 Rakudo #62 "Singapore" (masak) 2013-04-18 Rakudo #63 "Albany" (Coke) 2013-05-23 Rakudo #64 "Austin" (FROGGS) 2013-06-20 Rakudo #65 "Poznan" (masak) 2013-07-18 Rakudo #66 "Edinburgh" (moritz,lizmat) 2013-08-22 Rakudo #67 "Bicycle" (moritz) 2013-09-19 Rakudo #68 "Shanghai" (masak) 2013-10-17 Rakudo #69 "Roederbergweg" (Coke) 2013-11-21 Rakudo #70 "Malmö" (lizmat) 2013-12-19 Rakudo #71 "Advent" (moritz) 2014-01-23 Rakudo #72 "Plano" (masak) 2014-02-20 Rakudo #73 "Karlsruhe" (timotimo) 2014-03-20 Rakudo #74 "Adelaide" (tadzik) 2014-04-17 Rakudo #75 "Echt" (masak) 2014-05-22 Rakudo #76 "Bajor" (FROGGS) 2014-06-19 Rakudo #77 "Gdańsk" (sergot) 2014-07-17 Rakudo #78 "Sofia" (FROGGS) 2014-08-21 Rakudo #79 "Minsk" (Coke) 2014-09-18 Rakudo #80 "HongKong" (masak) 2014-10-23 Rakudo #81 "Linz" (duff) 2014-11-20 Rakudo #82 "Helsinki" (lizmat) 2014-12-18 Rakudo #83 "Cologne" (lizmat) 2014-12-19 2014.12.1 (lizmat) 2015-01-22 Rakudo #84 "Gotanda" (Coke) 2015-02-19 Rakudo #85 "Berlin" (lizmat) 2015-03-19 Rakudo #86 "Cluj" (FROGGS) 2015-04-23 Rakudo #87 "Vladivostok" (masak) 2015-05-21 Rakudo #88 "Dresden" (FROGGS) 2015-06-18 Rakudo #89 "Salt Lake" (hoelzro) 2015-07-24 Rakudo #90 "Prague" (masak) 2015-07-24 2015.07.1 (masak) 2015-07-25 2015.07.2 (moritz) 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 2016-02-01 Rakudo #95 "2016.01" (Coke) 2016-02-02 2016.01.1 (Coke) 2016-02-21 Rakudo #96 "2016.02" (Coke) 2016-03-23 Rakudo #97 "2016.03" (Coke) 2016-04-19 Rakudo #98 "2016.04" (Coke) 2016-05-21 Rakudo #99 "2016.05" (hoelzro) 2016-06-18 Rakudo #100 "2016.06" (Zoffix) 2016-07-16 Rakudo #101 "2016.07" (Zoffix) 2016-07-18 2016.07.1 (Zoffix) 2016-08-20 Rakudo #102 "2016.08" (Zoffix) 2016-08-20 2016.08.1 (Zoffix) 2016-09-17 Rakudo #103 "2016.09" (Zoffix + NeuralAnomaly) 2016-10-15 Rakudo #104 "2016.10" (Zoffix + NeuralAnomaly) 2016-11-19 Rakudo #105 "2016.11" (Zoffix + NeuralAnomaly) 2016-12-17 Rakudo #106 "2016.12" (Zoffix + NeuralAnomaly) 2017-01-20 Rakudo #107 "2017.01" (Zoffix + NeuralAnomaly) 2017-02-18 Rakudo #108 "2017.02" (Zoffix + NeuralAnomaly) 2017-03-18 Rakudo #109 "2017.03" (Zoffix + NeuralAnomaly) 2017-04-17 Rakudo #110 "2017.04" (Zoffix + NeuralAnomaly) 2017-04-18 2017.04.1 (Zoffix) 2017-04-18 2017.04.2 (Zoffix) 2017-04-23 2017.04.3 (Zoffix) 2017-05-20 Rakudo #111 "2017.05" (Zoffix + NeuralAnomaly) 2017-06-17 Rakudo #112 "2017.06" (Zoffix + NeuralAnomaly) 2017-07-15 Rakudo #113 "2017.07" (Zoffix + NeuralAnomaly) 2017-08-21 Rakudo #114 "2017.08" (AlexDaniel + Releasable) 2017-09-18 Rakudo #115 "2017.09" (AlexDaniel + Releasable) 2017-10-26 Rakudo #116 "2017.10" (AlexDaniel + Releasable) 2017-11-21 Rakudo #117 "2017.11" (AlexDaniel + Releasable) 2017-12-21 Rakudo #118 "2017.12" (AlexDaniel + Releasable) 2018-01-25 Rakudo #119 "2018.01" (AlexDaniel + Releasable) 2018-02-20 Rakudo #120 "2018.02" (AlexDaniel + Releasable) 2018-02-23 2018.02.1 (AlexDaniel + Releasable) 2018-03-19 Rakudo #121 "2018.02" (AlexDaniel + Releasable) =head1 COPYRIGHT Copyright © 2009-2018, The Perl Foundation. =cut # Local Variables: # fill-column: 100 # End: # vim: expandtab shiftwidth=4: rakudo-2018.03/docs/ROADMAP0000644000175000017500000000531513253717231013566 0ustar alexalexRakudo Roadmap -------------- Last updated: 2015-07-26 This document serves as a guide to the major goals for Rakudo development, as things stood in December 2011. They have been roughly categorized. Each has been given a 1-3 priority indicator, where 1 is "fairly pressing", 2 is "desirable", and 3 is "wanted, but not a key goal right now". Each item also has from one to five asterisks indicating the estimated "degree of effort" required for the item. A lower priority does not mean, "don't work on this". If you want to hack on a priority 3 item, go right ahead. It is, after all, wanted. And things that are priority 3 now will eventually work their way up to the top anyway. Mostly, -Ofun. Some items are marked with the names of people likely to either work on them OR serve as a "contact person" for the goal. Again, don't let a name already being against a goal stop you working on it - though it would be wise that you check where the marked person is at with it to avoid any duplicated effort, or to pick up hints about how to jump in. :-) Patches to this document are welcome - to add missing goals, remove completed ones, re-prioritize, volunteer for a goal, rescue yourself from a goal, etc. Compiler Performance/Portability Improvements (jnthn) 3 ** Optimizing multis for `[+] 1..10` and `[<=] 1..10` etc. Macros (masak) 2 ** hygienic macros and the COMPILING:: pseudopackage 2 **** "delayed" declarations of routines and types within quasiquotes 3 ? Textual macros Operators 3 ** logical cascades Regexes 2 ** ~~ inside regexes 2 * @< > (force a capture to be an array) 3 ** <*foo> 3 ** <~~0>, <~~foo> 3 *** explicit backtracking control (::, :::) 3 ** and Built-ins/Data Structures 2 *** packed arrays (jnthn) 2 ** Rat/FatRat/Rational cleanup 2 ** sized/shaped arrays (jnthn) 2 ** Correct type smiley support (:U, :D, etc.) (jnthn) 3 *** arrays with custom keys 3 *** complete LoL and slice context implementation 3 *** Cat and stream matching Language Features 2 * $=DATA and friends (tadzik) 2 ** module versioning (lizmat,FROGGS) 2 *** new syntax/semantics for coercion (jnthn) 3 *** domain specific languages -- slang and grammar tweaks (FROGGS) 3 **** more advanced Perl 5 interop (lexical embedding, etc.) (FROGGS) 2 ** label handling using goto 2 ? leave for leading blocks Optimizer (jnthn) 2 ** ro/rw variable tracking, related transforms 2 ** context/non-context variable tracking 2 *** :D/:U constraint tracking and integration with dispatch analysis 2 * topic preservation elimination on simple block inlines Other things (to be organized into above groups) 3 ? AUTOLOAD, including possibly AUTOLOADING setting components rakudo-2018.03/docs/roast-spectest.data-versioning.md0000644000175000017500000000151513253717231021151 0ustar alexalexThe files `t/spectest.data*` specify the list of files to use to test a specific roast version. The version to test is obtained from the VERSION file in roast checkout (`t/spec/VERSION`). The default file is `t/spectest.data` and it's used if roast version could not be obtained, if the `spectest.data` file for the requested version doesn't exist or isn't readable, or if the version matches string `propo` (e.g. `6.d.proposal`). Otherwise, the version is used as a suffix, separated with a dot: VERSION file contains "6.c" => tests read from t/spectest.data.6.c The master roast branch would typically contain a proposal version (`6.d.proposal`). Once that language version is released and a new branch with it is published, the VERSION file will be changed (`6.d`) and a new spectest.data file will be created (`t/spectest.data.6.d`). rakudo-2018.03/docs/running.pod0000644000175000017500000001214313253717231014741 0ustar alexalex=head1 NAME perl6 - Rakudo Perl 6 Compiler =head1 SYNOPSIS perl6 [switches] [--] [programfile] [arguments] =head1 DESCRIPTION With no arguments, enters a REPL. With a C<[programfile]> or the C<-e> option, compiles the given program and by default also executes the compiled code. -c check syntax only (runs BEGIN and CHECK blocks) --doc extract documentation and print it as text -e program one line of program, strict is enabled by default -h, --help display this help text -n run program once for each line of input -p same as -n, but also print $_ at the end of lines -I path adds the path to the module search path -M module loads the module prior to running the program --target=[stage] specify compilation stage to emit --optimize=[level] use the given level of optimization (0..3) --encoding=[mode] specify string encoding mode -o, --output=[name] specify name of output file -v, --version display version information --stagestats display time spent in the compilation stages --ll-exception display a low level backtrace on errors --profile write profile information as HTML file (MoarVM) --profile-filename provide a different filename (also allows .json) --doc=[module] Use Pod::To::[module] to render inline documentation. Note that only boolean single-letter options may be bundled. The supported values for C<--target> are: Target Backend Description ====== ======= =========== parse all a representation of the parse tree ast all an abstract syntax tree (before optimizations) optimize all an abstract syntax tree (after optimizations) mbc MoarVM MoarVM byte code jar JVM JVM archive For C<--profile-filename>, specifying a name ending in C<.json> will write a raw JSON profile dump. The default if this is omitted is C.html>. =head1 ENVIRONMENT VARIABLES Rakudo's behavior can be tweaked by a (growing) number of environment variables; this section attempts to document all those currently in use. =head2 Module Loading =over =item C, C (I; F) Appends a comma-delimited list of paths to C<@INC>. C is evaluated first. =item C (I; F) Causes the module loader to print debugging information to standard error. =back =head2 Error Message Verbosity and Strictness =over =item C (I; F) If true, suppresses deprecation warnings triggered by the C trait. =item C (I; F) If true, deprecation warnings become thrown exceptions. =item C (I; F) Displays source code in stack frames surrounded by the specified number of lines of context. =item C (I; F) Controls whether .setting files are included in backtraces. =back =head2 Affecting Precompilation =over =item C (I; F) When this is set, Rakudo will look for the standard repositories (perl, vendor, site) in the specified directory. This is intended as an escape hatch for build-time bootstrapping issues, where Rakudo may be built as an unprivileged user without write access to the runtime paths in NQP's config. =item C (F) =item C (F) =item C (F) These are internal variables for passing serialized state to precompilation jobs in child processes. Please do not set them manually. =back =head2 Other =over =item C (I; F) Controls whether to emit ANSI codes for error highlighting. Defaults to true if unset, except on Win32. =item C (I; F) Override the default maximum number of threads used by a thread pool. =item C, C, C (I; F) The C method will return C<$TMPDIR> if it points to a directory with full access permissions for the current user, with a fallback default of C<'/tmp'>. C and C use more Win32-appropriate lists which also include the C<%TEMP%> and C<%TMP%> environment variables. =item C, C (I; F) The C method splits C<$PATH> as a shell would; i.e. as a colon-separated list. C inherits this from C. C will read the first defined of either C<%PATH%> or C<%Path%> as a semicolon-delimited list. =back =head1 AUTHORS Written by the Rakudo contributors, see the CREDITS file. This manual page was written by Reini Urban, Moritz Lenz and the Rakudo contributors. rakudo-2018.03/docs/S11-Modules-proposal.pod0000644000175000017500000001210013253717231017061 0ustar alexalex=head1 S11-Modules proposal for Rakudo * implementation The aim will be to implement it all in NQP if possible. =head1 Overriding Principle The source code must always be the absolute source of all information. Everything else should act as a cache. That means *.pir files and databases of metadata may be automatically or manually derived from the *.pm files, but they may not add information (from the command line, for example). If there is to be cached metadata in future, it should be stored in files as close to the corresponding source files as possible. If modules are precompiled to *.pir files, those files will be stored in the same directories as their corresponding *.pm source files, with identical names apart from the extension. =head1 Restrictions and limitations =head2 No C keyword Classes may contain other classes, which provides sufficient hierarchy. Rakudo will implement C, in order to contain sub definitions that do not belong to any class. =head2 Only simplest :ver and :auth implementation There should be only one C<:ver> and C<:auth> name part per source code file, in order to keep the implementation simple. In order to keep users sane, multiple C<:ver> or C<:auth> name parts in the same source file will make the using program die with a NYI error. The following is ok (loaded by "use Foo::Bar:ver<1.2.3>:auth"): # in Foo/Bar.pm class Foo::Bar:ver<1.2.3>:auth { # or module, grammar etc ... class Baz { ... } } The following (nested class declarations) will not be implemented in Rakudo *: # in Foo.pm module Foo { # or class Foo, grammar Foo etc class Bar:ver<1.2.3>:auth { ... } } =head2 No Unicode mangling in file names If you want to use Unicode in your module names, your file system must support Unicode as well. If you want users without Unicode file names to use your modules, don't use Unicode in your module names. =head2 Retain @*INC to specify where searching begins Rakudo effectively gives the following output to -e'.say for @*INC' ~/.perl6/lib parrot_install/lib/2.1.0-devel/share/perl6/lib . The . entry may be removed from the default @*INC because it creates a security risk, but it is needed in the medium term for the build process to conveniently find F. Unlike the Perl 5 case, all matching candidate files in all applicable directories will be considered, so in most cases the order of directories in @*INC is not significant. If copies of the same module name with the same C<:auth> and C<:ver> name parts exist in the same or even different directories, Rakudo may arbitrarily use any one of those files and ignore the others. The module installer utility should try to prevent such duplication arising, but should tolerate it if it already exists. =head2 Room for wriggling on file names If multiple instances of a module exist, they may be distributed among all the @*INC directories. Folders correspond to packages (aka namespaces) and they are not allowed to have :ver and :auth name parts. In every directory, file name collisions are avoided by optionally inserting a unique .infix in the name before the .pm extension. The following would all match a C command: Foo.pm Foo.1.pm Foo.12345.pm Currently only digits are being considered, but anything within reason between the two dots should be allowed, and is under the control of the module installer. The infix characters are meaningless. Only the code inside the file specifies :ver and :auth. =head1 Searches in C, C and C commands In commands such as C, the :auth and :ver name parts are independently optional. Rakudo * will do only exact matches on :auth and :ver name parts, because the alternative gives headaches... Consider the example "use Foo::Bar:ver<1.2.3>:auth" Rakudo * will look for files matching Foo/Bar.pm and Foo/Bar.*.pm from every starting point listed in @*INC. Rakudo will then open each file in turn and partially (how?) parse the content to extract the first :ver and :auth values, building a list of the results. Caching will probably be added soon after the initial implementation works, in order to reduce the obvious overheads. If the C specified an C<:auth> or a C<:ver>, the values must match, and non-matching files are disqualified. Rakudo will consider files in the user's local directories (. and ~/.perl6/lib) that omit :auth and :ver values. Modules in the parrot_install tree should all have :auth and :ver. If the :ver is not specified, Rakudo must select the file containing the highest :ver value. Files without :ver are considered as having the lowest possible :ver value. Multiple files without :ver, or multiple files with the same :ver, will result in an arbitrary selection. =head1 Implementation notes There is a Perl 5 stub implementation of the module finding algorithm in the rmp repository L in the file C. Commit bits to that repo are handed out freely; just ask hugme on #perl6 :-). rakudo-2018.03/docs/spectest-progress.csv0000644000175000017500000013115313253717231016771 0ustar alexalex"date","revision","pass","fail","todo","skip","regr","spec","files" "2008-05-22 00:00",27739,223,0,0,341,564,2905,31 "2008-05-23 00:00",27763,228,0,0,341,569,2905,32 "2008-05-24 00:00",27775,228,0,0,341,569,2915,32 "2008-05-25 00:00",27796,310,0,0,356,666,2915,39 "2008-05-26 00:00",27812,310,0,0,356,666,2915,39 "2008-05-27 00:00",27839,310,0,0,356,666,2956,39 "2008-05-28 00:00",27868,317,0,0,349,666,2964,39 "2008-05-29 00:00",27910,394,4,15,361,774,3011,43 "2008-05-30 00:00",27933,415,0,15,345,775,3012,43 "2008-05-31 00:00",27953,415,0,15,345,775,3014,43 "2008-06-01 00:00",27986,518,0,15,359,892,3014,52 "2008-06-02 00:00",28021,623,0,15,374,1012,3014,55 "2008-06-03 00:00",28042,623,0,15,374,1012,3014,55 "2008-06-04 00:00",28058,624,0,14,374,1012,3014,55 "2008-06-05 00:00",28084,668,0,15,424,1107,3063,58 "2008-06-06 00:00",28127,674,0,14,422,1110,3068,58 "2008-06-07 00:00",28161,682,0,16,441,1139,3068,59 "2008-06-08 00:00",28174,697,0,17,425,1139,3078,59 "2008-06-09 00:00",28192,699,0,15,425,1139,3079,59 "2008-06-10 00:00",28223,699,0,15,425,1139,3079,59 "2008-06-11 00:00",28229,705,0,15,425,1145,3104,59 "2008-06-12 00:00",28248,705,0,15,425,1145,3125,59 "2008-06-13 00:00",28298,707,0,15,426,1148,3129,60 "2008-06-14 00:00",28331,711,0,15,422,1148,3129,60 "2008-06-15 00:00",28372,754,0,15,432,1201,3153,63 "2008-06-16 00:00",28412,779,0,15,432,1226,3189,64 "2008-06-17 00:00",28454,781,0,15,434,1230,3200,64 "2008-06-18 00:00",28506,781,0,15,434,1230,3200,64 "2008-06-19 00:00",28535,781,0,15,434,1230,3405,64 "2008-06-20 00:00",28570,792,0,15,434,1241,3452,65 "2008-06-21 00:00",28591,794,0,15,431,1240,3451,65 "2008-06-22 00:00",28627,843,0,15,391,1249,3494,66 "2008-06-23 00:00",28658,849,0,20,384,1253,3505,66 "2008-06-24 00:00",28672,849,0,20,384,1253,3510,66 "2008-06-25 00:00",28693,891,0,31,389,1311,4218,70 "2008-06-26 00:00",28701,944,0,38,432,1414,4292,73 "2008-06-27 00:00",28737,1080,1,38,310,1429,4311,75 "2008-06-28 00:00",28767,1072,17,38,314,1441,4338,75 "2008-06-29 00:00",28810,1077,74,38,286,1475,4380,75 "2008-06-30 00:00",28840,1126,0,38,307,1471,4484,74 "2008-07-01 00:00",28858,1172,0,36,314,1522,4484,75 "2008-07-02 00:00",28928,1290,0,47,368,1705,4788,80 "2008-07-03 00:00",28991,1365,0,47,418,1830,4814,83 "2008-07-04 00:00",29042,1473,0,56,539,2068,5096,86 "2008-07-05 00:00",29065,1587,0,59,433,2079,5097,87 "2008-07-06 00:00",29090,1587,0,59,433,2079,5115,87 "2008-07-07 00:00",29114,1618,0,84,462,2164,5240,90 "2008-07-08 00:00",29144,1662,0,86,504,2252,5283,94 "2008-07-09 00:00",29181,1677,0,82,498,2257,5288,94 "2008-07-10 00:00",29220,1679,0,85,520,2284,5328,94 "2008-07-11 00:00",29277,1691,0,85,520,2296,5340,95 "2008-07-12 00:00",29323,1691,0,85,520,2296,5340,95 "2008-07-13 00:00",29376,1691,0,85,520,2296,5340,95 "2008-07-14 00:00",29418,1691,0,85,520,2296,5350,95 "2008-07-15 00:00",29468,1695,0,85,516,2296,5350,95 "2008-07-16 00:00",29503,1736,0,81,521,2338,5389,96 "2008-07-17 00:00",29544,1736,0,81,521,2338,5401,96 "2008-07-18 00:00",29575,1770,0,84,529,2383,5429,97 "2008-07-19 00:00",29607,1763,0,87,576,2426,5492,98 "2008-07-20 00:00",29628,1763,0,87,576,2426,5540,98 "2008-07-21 00:00",29642,1763,0,87,576,2426,5555,98 "2008-07-22 00:00",29666,1799,0,94,606,2499,5578,102 "2008-07-23 00:00",29691,1799,0,95,606,2500,5589,102 "2008-07-24 00:00",29719,1815,0,98,606,2519,5610,104 "2008-07-25 00:00",29733,1845,56,103,569,2573,5694,107 "2008-07-26 00:00",29749,1885,0,105,600,2590,5694,110 "2008-07-27 00:00",29786,1896,0,104,599,2599,5703,112 "2008-07-28 00:00",29822,1902,0,103,612,2617,5770,113 "2008-07-29 00:00",29837,1902,0,103,612,2617,5803,113 "2008-07-30 00:00",29869,1861,79,108,583,2631,5845,114 "2008-07-31 00:00",29902,5,2627,0,0,2632,5846,115 "2008-08-01 00:00",29917,1998,3,105,629,2735,5877,116 "2008-08-02 00:00",29933,1998,3,105,629,2735,5877,116 "2008-08-03 00:00",29963,2003,12,105,615,2735,6055,116 "2008-08-04 00:00",29990,2003,12,105,615,2735,6055,116 "2008-08-05 00:00",30019,2102,12,140,827,3081,6055,118 "2008-08-06 00:00",30052,2102,12,140,827,3081,6055,118 "2008-08-07 00:00",30081,2102,12,140,827,3081,6055,118 "2008-08-08 00:00",30120,2198,3,135,869,3205,6065,121 "2008-08-09 00:00",30136,2200,3,135,867,3205,6065,121 "2008-08-10 00:00",30154,2200,3,135,867,3205,6065,121 "2008-08-11 00:00",30161,2196,0,131,878,3205,6065,121 "2008-08-12 00:00",30179,0,3205,0,0,3205,6075,121 "2008-08-13 00:00",30201,2196,0,131,878,3205,6075,121 "2008-08-14 00:00",30217,2196,0,131,878,3205,6075,121 "2008-08-15 00:00",30243,2196,0,131,878,3205,6075,121 "2008-08-16 00:00",30256,2220,0,134,914,3268,6138,121 "2008-08-17 00:00",30275,2220,0,134,914,3268,6170,121 "2008-08-18 00:00",30292,2220,0,134,914,3268,6170,121 "2008-08-19 00:00",30322,2220,0,134,914,3268,6242,121 "2008-08-20 00:00",30370,2249,0,133,938,3320,6235,123 "2008-08-21 00:00",30419,2256,0,248,812,3316,6249,123 "2008-08-22 00:00",30434,2256,0,248,812,3316,6253,123 "2008-08-23 00:00",30465,2263,0,258,814,3335,6278,125 "2008-08-24 00:00",30499,2267,0,258,822,3347,6288,126 "2008-08-25 00:00",30527,2278,0,262,816,3356,6309,127 "2008-08-26 00:00",30556,2278,0,262,816,3356,6309,127 "2008-08-27 00:00",30584,2278,0,262,819,3359,6312,127 "2008-08-28 00:00",30609,2344,0,263,835,3442,6400,131 "2008-08-29 00:00",30631,2351,0,264,840,3455,6413,132 "2008-08-30 00:00",30650,2352,0,263,840,3455,6435,132 "2008-08-31 00:00",30668,2352,0,262,841,3455,6473,132 "2008-09-01 00:00",30680,2389,0,269,850,3508,6473,140 "2008-09-02 00:00",30694,2383,13,269,859,3524,6519,141 "2008-09-03 00:00",30717,2620,49,273,930,3872,6888,150 "2008-09-04 00:00",30745,2707,0,275,945,3927,7066,153 "2008-09-05 00:00",30771,3129,0,386,1278,4793,7246,157 "2008-09-06 00:00",30806,2798,0,281,976,4055,8002,156 "2008-09-07 00:00",30848,3287,0,285,1246,4818,8002,158 "2008-09-08 00:00",30881,3288,0,284,1246,4818,8003,158 "2008-09-09 00:00",30915,3288,0,284,1246,4818,8003,158 "2008-09-10 00:00",30946,3288,0,284,1246,4818,8071,158 "2008-09-11 00:00",30979,3296,0,296,1267,4859,8164,159 "2008-09-12 00:00",31010,3310,0,289,1272,4871,8237,159 "2008-09-13 00:00",31050,3332,4,292,1278,4906,8237,161 "2008-09-14 00:00",31098,3332,4,292,1278,4906,8237,161 "2008-09-15 00:00",31140,3361,0,293,1382,5036,8243,162 "2008-09-16 00:00",31173,3370,0,296,1385,5051,8245,163 "2008-09-17 00:00",31198,3377,0,296,1403,5076,8251,165 "2008-09-18 00:00",31220,3380,4,295,1403,5082,8257,165 "2008-09-19 00:00",31249,3399,0,282,1403,5084,8259,166 "2008-09-20 00:00",31282,3399,0,317,1368,5084,8259,166 "2008-09-21 00:00",31292,3418,0,306,1378,5102,8277,167 "2008-09-22 00:00",31329,3418,0,306,1378,5102,8277,167 "2008-09-23 00:00",31355,3434,0,306,1374,5114,8289,167 "2008-09-24 00:00",31376,3779,0,326,1401,5506,8296,177 "2008-09-25 00:00",31400,3815,0,328,1450,5593,8309,179 "2008-09-26 00:00",31428,3897,0,332,1457,5686,8393,180 "2008-09-27 00:00",31451,4090,0,379,1470,5939,8495,187 "2008-09-28 00:00",31470,4121,0,388,1477,5986,8505,188 "2008-09-29 00:00",31485,4121,0,392,1477,5990,8509,188 "2008-09-30 00:00",31503,4381,0,388,1453,6222,8743,193 "2008-10-01 00:00",31537,4381,7,388,1453,6229,8743,194 "2008-10-02 00:00",31561,4406,0,390,1460,6256,8779,198 "2008-10-03 00:00",31578,4437,0,394,1464,6295,8773,200 "2008-10-04 00:00",31609,4437,0,394,1466,6297,8775,200 "2008-10-05 00:00",31645,4437,0,394,1466,6297,8775,200 "2008-10-06 00:00",31687,4363,74,397,1436,6270,8826,205 "2008-10-07 00:00",31743,4363,74,397,1436,6270,8850,205 "2008-10-08 00:00",31780,4363,74,397,1436,6270,8850,205 "2008-10-09 00:00",31813,4366,11,398,1499,6274,8861,205 "2008-10-10 00:00",31846,4373,0,397,1495,6265,8871,204 "2008-10-11 00:00",31875,4366,0,396,1494,6256,8871,203 "2008-10-12 00:00",31893,4370,0,396,1494,6260,8877,203 "2008-10-13 00:00",31918,4380,0,396,1492,6268,8884,204 "2008-10-14 00:00",31932,4380,0,396,1492,6268,8884,204 "2008-10-15 00:00",31968,4390,0,398,1488,6276,8892,204 "2008-10-16 00:00",31992,4409,0,393,1488,6290,8909,204 "2008-10-17 00:00",32000,4409,0,393,1488,6290,8910,204 "2008-10-18 00:00",32008,4409,0,393,1488,6290,8910,204 "2008-10-19 00:00",32032,4409,0,393,1488,6290,8910,204 "2008-10-20 00:00",32045,4409,0,393,1488,6290,8910,204 "2008-10-21 00:00",32065,4413,0,393,1490,6296,8916,204 "2008-10-22 00:00",32096,4413,0,393,1490,6296,8916,204 "2008-10-23 00:00",32122,4429,0,394,1494,6317,8937,206 "2008-10-24 00:00",32144,4429,0,394,1494,6317,8937,206 "2008-10-25 00:00",32151,4429,0,394,1494,6317,8937,206 "2008-10-26 00:00",32162,4429,0,394,1494,6317,8956,206 "2008-10-27 00:00",32192,4429,2,394,1494,6319,8958,206 "2008-10-28 00:00",32211,4433,2,392,1492,6319,8958,206 "2008-10-29 00:00",32225,4433,2,392,1492,6319,8958,206 "2008-10-30 00:00",32239,4433,0,392,1494,6319,8958,206 "2008-10-31 00:00",32245,4435,0,392,1492,6319,8958,206 "2008-11-01 00:00",32261,4435,0,392,1492,6319,8958,206 "2008-11-02 00:00",32278,4435,0,392,1492,6319,8958,206 "2008-11-03 00:00",32312,4440,0,392,1487,6319,8958,206 "2008-11-04 00:00",32324,4436,5,392,1487,6320,8959,206 "2008-11-05 00:00",32357,4472,10,392,1500,6374,8989,211 "2008-11-06 00:00",32372,4409,0,396,1509,6314,8992,211 "2008-11-07 00:00",32415,4413,0,405,1496,6314,8993,211 "2008-11-08 00:00",32444,4439,4,407,1494,6344,8995,210 "2008-11-09 00:00",32460,4458,7,398,1491,6354,9006,211 "2008-11-10 00:00",32478,4435,58,387,1430,6310,9032,211 "2008-11-11 00:00",32512,4199,473,389,1314,6375,9032,212 "2008-11-12 00:00",32568,4528,8,391,1481,6408,9035,216 "2008-11-13 00:00",32593,4590,0,398,1496,6484,9036,219 "2008-11-14 00:00",32632,4601,0,396,1490,6487,9039,220 "2008-11-15 00:00",32656,4601,0,396,1490,6487,9039,220 "2008-11-16 00:00",32686,4601,0,396,1490,6487,9039,220 "2008-11-17 00:00",32761,4506,41,386,1483,6416,9039,220 "2008-11-18 00:00",32796,4576,41,386,1485,6488,9040,220 "2008-11-19 00:00",32864,4578,41,386,1483,6488,9040,220 "2008-11-20 00:00",32924,4585,41,387,1483,6496,9048,221 "2008-11-21 00:00",32971,4585,41,387,1483,6496,9048,221 "2008-11-22 00:00",32998,4599,41,387,1489,6516,9055,222 "2008-11-23 00:00",33032,4594,41,383,1489,6507,9055,221 "2008-11-24 00:00",33130,4616,41,384,1494,6535,9075,224 "2008-11-25 00:00",33180,4616,41,384,1494,6535,9075,224 "2008-11-26 00:00",33212,4648,41,386,1481,6556,9096,225 "2008-11-27 00:00",33257,5,6347,0,0,6352,9105,227 "2008-11-28 00:00",33295,4634,89,382,1471,6576,9106,227 "2008-11-29 00:00",33322,4653,48,382,1476,6559,9106,227 "2008-11-30 00:00",33359,4653,48,382,1476,6559,9106,227 "2008-12-01 00:00",33411,4689,10,382,1482,6563,9110,227 "2008-12-02 00:00",33436,4689,10,382,1484,6565,9112,227 "2008-12-03 00:00",33449,4689,10,382,1484,6565,9112,227 "2008-12-04 00:00",33477,4703,0,384,1482,6569,9116,227 "2008-12-05 00:00",33499,4710,0,384,1483,6577,9121,228 "2008-12-06 00:00",33539,4708,0,370,1501,6579,9123,228 "2008-12-07 00:00",33590,4717,0,373,1506,6596,9140,231 "2008-12-08 00:00",33645,4779,0,385,1540,6704,9330,233 "2008-12-09 00:00",33696,4805,13,387,1580,6785,9341,236 "2008-12-10 00:00",33741,4884,0,350,1572,6806,9358,235 "2008-12-11 00:00",33793,4916,0,350,1561,6827,9325,235 "2008-12-12 00:00",33823,5004,1,401,1489,6895,9356,240 "2008-12-13 00:00",33823,5005,0,410,1480,6895,9356,240 "2008-12-14 00:00",33844,5005,0,410,1480,6895,9356,240 "2008-12-15 00:00",33898,5101,0,383,1485,6969,9435,249 "2008-12-16 00:00",33949,5139,0,357,1473,6969,9435,249 "2008-12-17 00:00",34009,5170,0,350,1462,6982,9448,250 "2008-12-18 00:00",34055,5213,0,350,1452,7015,9492,250 "2008-12-19 00:00",34059,5213,0,350,1452,7015,9497,250 "2008-12-20 00:00",34114,5228,0,351,1456,7035,9517,252 "2008-12-21 00:00",34185,5645,0,304,1538,7487,9578,261 "2008-12-22 00:00",34232,5790,0,304,1393,7487,9578,261 "2008-12-23 00:00",34267,5833,0,319,1435,7587,9742,264 "2008-12-24 00:00",34313,5837,0,316,1434,7587,9742,264 "2008-12-25 00:00",34346,5840,1,316,1431,7588,9744,264 "2008-12-26 00:00",34364,5880,1,326,1404,7611,9851,264 "2008-12-27 00:00",34407,5905,0,327,1379,7611,9851,264 "2008-12-28 00:00",34465,5913,0,324,1375,7612,9863,264 "2008-12-29 00:00",34549,5802,141,324,1345,7612,9863,264 "2008-12-30 00:00",34615,5912,0,324,1376,7612,9863,264 "2008-12-31 00:00",34686,5911,0,323,1378,7612,9863,264 "2009-01-01 00:00",34735,5911,0,323,1378,7612,9873,264 "2009-01-02 00:00",34787,5911,0,323,1378,7612,10783,264 "2009-01-03 00:00",34854,5911,0,323,1378,7612,10783,264 "2009-01-04 00:00",34911,5911,0,323,1378,7612,10786,264 "2009-01-05 00:00",34959,5914,0,323,1378,7615,10786,265 "2009-01-06 00:00",35013,6170,0,338,1414,7922,11248,279 "2009-01-07 00:00",35093,6171,0,343,1416,7930,11256,279 "2009-01-08 00:00",35189,6175,0,338,1417,7930,11256,279 "2009-01-09 00:00",35243,6172,0,337,1424,7933,11263,279 "2009-01-10 00:00",35329,6141,0,331,1479,7951,11287,279 "2009-01-11 00:00",35386,6143,0,331,1478,7952,11288,279 "2009-01-12 00:00",35432,6218,0,331,1425,7974,11470,281 "2009-01-13 00:00",35477,6233,0,333,1425,7991,11487,282 "2009-01-14 00:00",35517,6233,0,337,1425,7995,11491,282 "2009-01-15 00:00",35576,6254,0,337,1425,8016,11525,284 "2009-01-16 00:00",35615,6263,0,337,1444,8044,11525,285 "2009-01-17 00:00",35664,0,6288,337,1437,8062,11525,286 "2009-01-18 00:00",35708,5,7844,0,0,7849,11525,286 "2009-01-19 00:00",35736,6352,0,313,1458,8123,11542,290 "2009-01-20 00:00",35788,6280,171,297,1420,8167,11582,292 "2009-01-21 00:00",35851,0,8167,0,0,8167,11582,292 "2009-01-22 00:00",35875,6500,11,308,1420,8239,11651,294 "2009-01-23 00:00",35904,6523,0,310,1421,8254,11666,295 "2009-01-24 00:00",35944,6522,0,307,1435,8264,11676,295 "2009-01-25 00:00",35983,6383,180,292,1405,8260,11678,295 "2009-01-26 00:00",36017,6517,0,293,1450,8260,11682,295 "2009-01-27 00:00",36042,6546,0,301,1511,8358,14080,295 "2009-01-28 00:00",36078,6601,1,301,1541,8444,14174,298 "2009-01-29 00:00",36135,6609,0,298,1754,8661,14236,298 "2009-01-30 00:00",9f84067,6614,0,300,1780,8692,14267,298 "2009-01-31 00:00",9f84067,6595,21,300,1778,8692,14267,298 "2009-02-01 00:00",48b6102,6595,21,300,1945,8859,14434,298 "2009-02-02 00:00",21f374f,6609,30,300,1944,8881,14593,299 "2009-02-03 00:00",21f374f,6609,30,300,1944,8881,14593,299 "2009-02-04 00:00",c3705e4,6609,30,300,1944,8881,14593,299 "2009-02-05 00:00",c108072,6629,0,301,1948,8878,14586,300 "2009-02-06 00:00",f990451,6629,0,301,1948,8878,14586,300 "2009-02-07 00:00",f990451,6629,0,301,1948,8878,14586,300 "2009-02-08 00:00",13f6779,6632,0,301,1982,8915,14586,301 "2009-02-09 00:00",1b85e1d,6635,0,301,1982,8918,14589,301 "2009-02-10 00:00",1b85e1d,6635,0,301,1982,8918,14589,301 "2009-02-11 00:00",e73c958,6635,0,301,1982,8918,14589,301 "2009-02-12 00:00",b2e7ac9,6766,0,299,1972,9037,14712,302 "2009-02-13 00:00",b2e7ac9,6766,0,299,1972,9037,14712,302 "2009-02-14 00:00",a0a3902,6812,0,298,1970,9080,14746,303 "2009-02-15 00:00",2f489f2,6812,0,298,1970,9080,14807,303 "2009-02-16 00:00",beac378,6805,15,298,1969,9087,14812,305 "2009-02-17 00:00",8695e4b,6823,0,298,1971,9092,14826,305 "2009-02-18 00:00",842ef38,6815,17,302,1981,9112,14836,306 "2009-02-19 00:00",444a4c8,6843,1,301,1985,9130,14861,306 "2009-02-20 00:00",5423d30,6952,0,303,1988,9243,15188,313 "2009-02-21 00:00",f23eda2,6951,15,307,1977,9250,15188,314 "2009-02-22 00:00",f23eda2,6955,15,307,1977,9254,15192,314 "2009-02-23 00:00",2a9382c,6970,0,307,1977,9254,15192,314 "2009-02-24 00:00",e074bf4,6999,0,308,1987,9294,15232,314 "2009-02-25 00:00",5944501,7007,0,310,1985,9302,15240,314 "2009-02-26 00:00",e6b7133,7041,0,309,1962,9312,15250,314 "2009-02-27 00:00",08b7890,7037,48,311,1947,9343,15261,315 "2009-02-28 00:00",c1f3976,7084,0,315,1944,9343,15261,315 "2009-03-01 00:00",af4b730,7084,0,315,1944,9343,15261,315 "2009-03-02 00:00",0d369db,7087,0,315,1944,9346,15268,315 "2009-03-03 00:00",4ec17da,7087,0,315,1944,9346,15268,315 "2009-03-04 00:00",55fb203,5648,0,284,1444,7376,15268,315 "2009-03-05 00:00",412cbe9,7121,0,314,1932,9367,15289,317 "2009-03-06 00:00",e47c348,7121,0,314,1932,9367,15289,317 "2009-03-07 00:00",f6cdf9b,7121,0,315,1932,9368,15290,317 "2009-03-08 00:00",ed4cd14,7122,2,318,1931,9373,15295,317 "2009-03-09 00:00",8bbc31c,7124,0,318,1931,9373,15295,317 "2009-03-10 00:00",95ce390,7015,140,321,1922,9398,15320,317 "2009-03-11 00:00",0c893bc,7148,0,319,1931,9398,15320,317 "2009-03-12 00:00",ea32839,7153,0,319,1926,9398,15320,317 "2009-03-13 00:00",087e299,7152,2,319,1935,9408,15330,317 "2009-03-14 00:00",41267fd,7166,0,319,1934,9419,15341,317 "2009-03-15 00:00",5b1ff9c,7174,0,315,1932,9421,15341,319 "2009-03-16 00:00",d2ad095,7174,0,316,1931,9421,15343,319 "2009-03-17 00:00",84920ea,7174,0,316,1934,9424,15346,319 "2009-03-18 00:00",521a5f1,7245,0,316,1919,9480,15356,321 "2009-03-19 00:00",f8b6aee,7255,0,318,1922,9495,15356,324 "2009-03-20 00:00",44e1496,7271,0,319,1926,9516,15382,325 "2009-03-21 00:00",627b6d6,7280,0,319,1942,9541,15407,325 "2009-03-22 00:00",de786f3,7280,0,319,1942,9541,15407,325 "2009-03-23 00:00",1c263b0,7308,1,324,1944,9577,15471,327 "2009-03-24 00:00",7487710,7322,1,324,1947,9594,15479,328 "2009-03-25 00:00",9a84c35,7367,0,324,1947,9638,15479,329 "2009-03-26 00:00",bb22e02,7424,0,325,1958,9707,15518,332 "2009-03-27 00:00",4929856,7795,0,326,2077,10198,15518,339 "2009-03-28 00:00",9fa0fca,7804,0,332,2062,10198,15518,339 "2009-03-29 00:00",7af829f,7804,0,332,2062,10198,15518,339 "2009-03-30 00:00",370dd76,8039,0,340,1819,10198,15518,339 "2009-03-31 00:00",c015556,8039,0,340,1819,10198,15518,339 "2009-04-01 00:00",78cb4c3,8049,0,342,1819,10210,15518,340 "2009-04-02 00:00",64e33af,8049,0,342,1819,10210,15518,340 "2009-04-03 00:00",913094f,8081,0,342,1816,10239,15534,344 "2009-04-04 00:00",68ea385,8406,0,342,1964,10712,15534,347 "2009-04-05 00:00",7dc65fd,8436,0,340,1960,10736,15579,349 "2009-04-06 00:00",078012a,8436,0,340,1960,10736,15579,349 "2009-04-07 00:00",8f4dc52,8436,0,340,1960,10736,15579,349 "2009-04-08 00:00",a2728b4,8444,0,342,1960,10746,15589,349 "2009-04-09 00:00",4ae560c,10224,0,343,2050,12617,15627,354 "2009-04-10 00:00",70fc009,10284,0,344,2052,12680,15633,356 "2009-04-11 00:00",79aba97,10300,0,346,2074,12720,15676,359 "2009-04-12 00:00",5b679a9,10298,5,346,2074,12723,15679,359 "2009-04-13 00:00",679e480,10298,5,346,2074,12723,15679,359 "2009-04-14 00:00",2c13d6c,10298,5,346,2074,12723,15679,359 "2009-04-15 00:00",d208e1c,10357,0,347,2148,12852,15801,362 "2009-04-16 00:00",a4535c1,10357,0,347,2148,12852,15801,362 "2009-04-17 00:00",a4535c1,10357,0,347,2148,12852,15801,362 "2009-04-18 00:00",f2c5829,10414,0,354,2153,12921,15860,371 "2009-04-19 00:00",d0310a3,10430,0,355,2151,12936,15866,372 "2009-04-20 00:00",0d55159,10381,0,360,2144,12885,15887,372 "2009-04-21 00:00",cea34fd,10389,0,359,2136,12884,15886,373 "2009-04-22 00:00",2665575,10467,0,358,2131,12956,15886,374 "2009-04-23 00:00",d79ccbe,10467,0,358,2133,12958,15888,374 "2009-04-24 00:00",9a53051,10907,0,353,2138,13398,16298,375 "2009-04-25 00:00",7bbc62a,10922,0,353,2136,13411,16311,376 "2009-04-26 00:00",705ecc2,10922,0,353,2136,13411,16311,376 "2009-04-27 00:00",c4f6763,10927,0,353,2137,13417,16317,376 "2009-04-28 00:00",467ade5,10931,0,363,2136,13430,16332,376 "2009-04-29 00:00",c76d8d0,10943,0,367,2146,13456,16343,377 "2009-04-30 00:00",96de998,10961,0,367,2145,13473,16364,378 "2009-05-01 00:00",b83a0b0,10958,0,367,2145,13470,16363,377 "2009-05-02 00:00",ec69e24,10991,0,364,2191,13546,16372,378 "2009-05-03 00:00",d4a0b3b,10984,7,364,2191,13546,16416,378 "2009-05-04 00:00",cddb162,10999,11,365,2190,13565,16487,379 "2009-05-05 00:00",4d7fe56,11011,0,364,2190,13565,16490,379 "2009-05-06 00:00",71c69d0,11013,0,364,2191,13568,16490,380 "2009-05-07 00:00",615936e,11022,0,365,2195,13582,16492,382 "2009-05-08 00:00",6db88b0,11032,0,365,2195,13592,16495,383 "2009-05-09 00:00",1f4ec5d,11028,66,360,2142,13596,16519,383 "2009-05-10 00:00",7d581a5,11085,1,362,2182,13630,16553,383 "2009-05-11 00:00",a27bbb6,11180,0,386,2213,13779,16562,387 "2009-05-12 00:00",feca3f2,11187,0,390,2213,13790,16573,387 "2009-05-13 00:00",3412a2f,11257,0,387,2182,13826,16581,388 "2009-05-14 00:00",8349d75,11258,1,387,2183,13829,16584,388 "2009-05-15 00:00",8ff0e0a,11291,0,390,2194,13875,16595,390 "2009-05-16 00:00",ec55f17,11288,8,389,2196,13881,16601,390 "2009-05-17 00:00",ec55f17,11288,8,389,2196,13881,16601,390 "2009-05-18 00:00",1639d85,11294,0,389,2199,13882,16603,390 "2009-05-19 00:00",9d2934e,11297,0,389,2199,13885,16603,391 "2009-05-20 00:00",595d364,11299,0,389,2199,13887,16623,391 "2009-05-21 00:00",f08f5ad,11342,0,390,2176,13908,16644,392 "2009-05-22 00:00",5eac9bd,11342,0,390,2176,13908,16644,392 "2009-05-23 00:00",23718a8,11342,0,390,2176,13908,16684,392 "2009-05-24 00:00",23718a8,11338,0,395,2175,13908,16684,392 "2009-05-25 00:00",23718a8,11337,0,395,2175,13907,16683,392 "2009-05-26 00:00",2376c44,11343,0,397,2178,13918,16685,394 "2009-05-27 00:00",6953001,11346,0,397,2178,13921,16685,395 "2009-05-28 00:00",b325177,11346,0,397,2178,13921,16685,395 "2009-05-29 00:00",6062528,11350,0,393,2178,13921,16685,395 "2009-05-30 00:00",764684b,11350,0,393,2178,13921,16685,395 "2009-05-31 00:00",764684b,11350,0,393,2178,13921,16685,395 "2009-06-01 00:00",0b9c9a3,11350,0,392,2180,13922,16686,395 "2009-06-02 00:00",d396ab4,11346,2,392,2182,13922,16686,395 "2009-06-03 00:00",c907d37,11348,2,392,2180,13922,16683,395 "2009-06-04 00:00",77db80c,11379,2,389,2190,13960,16683,399 "2009-06-05 00:00",10a9b23,11380,2,389,2190,13961,16684,399 "2009-06-06 00:00",fb2fd43,11391,2,389,2190,13972,16696,399 "2009-06-07 00:00",97f1415,11391,2,389,2190,13972,16696,399 "2009-06-08 00:00",5f70a68,11428,0,380,2165,13973,16697,399 "2009-06-09 00:00",063f3d5,11475,0,380,2165,14020,16744,400 "2009-06-10 00:00",86aeafb,11508,0,380,2168,14056,16838,401 "2009-06-11 00:00",86aeafb,11508,0,380,2168,14056,16838,401 "2009-06-12 00:00",a2b8ceb,11508,0,380,2168,14056,16841,401 "2009-06-13 00:00",4d21e2a,11514,0,380,2174,14068,16853,401 "2009-06-14 00:00",77f9d70,11535,0,382,2182,14099,16867,404 "2009-06-15 00:00",77f9d70,11535,0,382,2182,14099,16867,404 "2009-06-16 00:00",ba09b27,11535,0,382,2182,14099,16867,404 "2009-06-17 00:00",952fe6d,11536,0,381,2183,14100,16874,404 "2009-06-18 00:00",9dc941f,11536,0,381,2183,14100,16888,404 "2009-06-19 00:00",1b06df8,11536,0,381,2183,14100,16888,404 "2009-06-20 00:00",1b06df8,11488,48,381,2183,14100,16888,404 "2009-06-21 00:00",1b06df8,11488,48,381,2183,14100,16888,404 "2009-06-22 00:00",1b06df8,11532,4,381,2183,14100,16891,404 "2009-06-23 00:00",10f2235,11532,4,383,2184,14103,16894,404 "2009-06-24 00:00",0e0671a,11546,4,383,2184,14117,16908,405 "2009-06-25 00:00",0e0671a,11548,4,383,2183,14118,16909,405 "2009-06-26 00:00",6c43f93,11539,21,380,2218,14158,16921,406 "2009-06-27 00:00",6c43f93,11548,9,384,2218,14159,16925,406 "2009-06-28 00:00",6c43f93,11526,17,384,2221,14148,17010,406 "2009-06-29 00:00",6c43f93,11536,7,384,2221,14148,17010,406 "2009-06-30 00:00",1831bd1,11510,85,388,2223,14206,17026,409 "2009-07-01 00:00",5351a33,11592,52,384,2219,14245,17059,412 "2009-07-02 00:00",3d94ef4,11629,6,388,2226,14249,17063,412 "2009-07-03 00:00",f59630e,11546,90,387,2218,14241,17056,412 "2009-07-04 00:00",6a4d66a,11566,99,397,2216,14278,17067,412 "2009-07-05 00:00",6a4d66a,11577,85,400,2226,14288,17082,412 "2009-07-06 00:00",0e8a86a,11585,112,388,2175,14260,17136,411 "2009-07-07 00:00",99ad1eb,11497,125,403,2183,14208,17178,411 "2009-07-08 00:00",70bfd5c,11561,195,398,2195,14349,17197,412 "2009-07-09 00:00",70bfd5c,11577,195,403,2198,14373,17222,412 "2009-07-10 00:00",544038f,11748,0,410,2215,14373,17222,412 "2009-07-11 00:00",02d0ed2,11746,2,410,2215,14373,17224,412 "2009-07-12 00:00",02d0ed2,11750,2,415,2215,14382,17236,412 "2009-07-13 00:00",4024702,11796,0,420,2227,14443,17264,415 "2009-07-14 00:00",147b3d7,11784,0,426,2226,14436,17315,415 "2009-07-15 00:00",d8d0640,11787,3,430,2229,14447,17326,415 "2009-07-16 00:00",9a7a1dc,11792,2,430,2225,14449,17328,415 "2009-07-17 00:00",9a7a1dc,11802,2,441,2228,14473,17358,415 "2009-07-18 00:00",faf91f9,11813,3,442,2228,14486,17371,415 "2009-07-19 00:00",faf91f9,11815,1,442,2228,14486,17371,415 "2009-07-20 00:00",415514b,11835,1,461,2231,14528,17411,415 "2009-07-21 00:00",b756ac9,11854,0,473,2245,14572,17455,416 "2009-07-22 00:00",21066f1,11343,651,473,2101,14568,17453,416 "2009-07-23 00:00",6062092,11876,0,461,2238,14575,17460,416 "2009-07-24 00:00",fc60e1d,11913,0,462,2236,14611,17496,418 "2009-07-25 00:00",dd5767c,12006,0,537,2242,14785,17511,423 "2009-07-26 00:00",240b984,12027,0,543,2244,14814,17540,423 "2009-07-27 00:00",4c31fb7,12043,0,543,2244,14830,17556,423 "2009-07-28 00:00",ea667e8,12033,14,540,2248,14835,17556,423 "2009-07-29 00:00",6999e58,12048,8,541,2253,14850,17571,423 "2009-07-30 00:00",13ba2f3,12114,8,502,2210,14834,17583,423 "2009-07-31 00:00",a53a1cd,12124,8,511,2210,14853,17602,424 "2009-08-01 00:00",e02bc06,12124,8,512,2214,14858,17609,424 "2009-08-02 00:00",e02bc06,12126,13,512,2214,14865,17616,424 "2009-08-03 00:00",91408af,12179,8,520,2226,14933,17588,426 "2009-08-04 00:00",18598de,12179,8,520,2226,14933,17588,426 "2009-08-05 00:00",24b26a0,12185,8,524,2227,14944,17599,426 "2009-08-06 00:00",a948cae,12189,8,528,2227,14952,17607,426 "2009-08-07 00:00",4665d75,12156,65,528,2206,14955,17610,426 "2009-08-08 00:00",7717c4a,12193,16,531,2221,14961,17622,426 "2009-08-09 00:00",5667dca,12247,0,529,2286,15062,17595,429 "2009-08-10 00:00",39cc848,12303,0,530,2286,15119,17611,430 "2009-08-11 00:00",11a2934,12301,0,533,2259,15093,17625,429 "2009-08-12 00:00",a5dfe96,12303,0,535,2260,15098,17636,428 "2009-08-13 00:00",69eee0d,12308,0,538,2263,15109,17647,428 "2009-08-14 00:00",0d4fe08,12294,0,525,2268,15087,17619,428 "2009-08-15 00:00",637d803,12298,21,522,2262,15103,17632,429 "2009-08-16 00:00",ada2b41,12326,0,526,2267,15119,17650,429 "2009-08-17 00:00",5637208,12326,0,526,2267,15119,17665,429 "2009-08-18 00:00",55c5fa1,12339,1,524,2265,15129,17675,430 "2009-08-19 00:00",b9c79c2,12339,0,523,2267,15129,17675,430 "2009-08-20 00:00",fd8fc8a,12371,0,516,2263,15150,17682,431 "2009-08-21 00:00",ae56d02,12376,0,516,2263,15155,18193,431 "2009-08-22 00:00",0a5b07e,12397,0,514,2263,15174,18204,433 "2009-08-23 00:00",e83932a,12397,0,514,2263,15174,18204,433 "2009-08-24 00:00",c4c67da,12399,0,514,2266,15179,18209,433 "2009-08-25 00:00",9d9d416,12401,0,514,2264,15179,18209,433 "2009-08-26 00:00",bd51ce2,12402,0,513,2267,15182,18212,433 "2009-08-27 00:00",ec2f831,12402,0,513,2267,15182,18212,433 "2009-08-28 00:00",f351f60,12391,0,517,2274,15182,18212,433 "2009-08-29 00:00",7666e92,12393,0,516,2273,15182,18241,433 "2009-08-30 00:00",7666e92,12465,0,520,2274,15259,18289,433 "2009-08-31 00:00",8772e90,12478,0,517,2274,15269,18299,433 "2009-09-01 00:00",9bcba63,12550,0,520,2381,15451,18481,435 "2009-09-02 00:00",ba10463,13245,0,521,2414,16180,19210,435 "2009-09-03 00:00",c9a9300,13257,0,521,2414,16192,19222,435 "2009-09-04 00:00",b51d94c,13402,0,521,2446,16369,19399,435 "2009-09-05 00:00",2276af9,13401,2,521,2445,16369,19399,435 "2009-09-06 00:00",6e2104a,13404,0,518,2447,16369,19403,435 "2009-09-07 00:00",205733f,14255,0,518,2783,17556,20590,435 "2009-09-08 00:00",01ae3fa,14273,0,518,2783,17574,20599,436 "2009-09-09 00:00",62879bb,14268,0,521,2785,17574,20599,436 "2009-09-10 00:00",5960161,14272,0,521,2785,17578,20603,436 "2009-09-11 00:00",d0355a5,14267,5,521,2785,17578,20603,436 "2009-09-12 00:00",3b63817,14835,0,521,2832,18188,21213,436 "2009-09-13 00:00",0f1edeb,15494,0,521,2657,18672,21697,436 "2009-09-14 00:00",0f1edeb,15500,0,523,2659,18682,21679,436 "2009-09-15 00:00",a9ff309,15500,0,523,2659,18682,21679,436 "2009-09-16 00:00",9a61441,15497,0,518,2651,18666,21671,436 "2009-09-17 00:00",ea6448f,15497,0,518,2651,18666,21671,436 "2009-09-18 00:00",a969c9e,15498,0,520,2651,18669,21674,436 "2009-09-19 00:00",4b141a8,15498,0,520,2651,18669,21674,436 "2009-09-20 00:00",2c40a5b,15498,0,521,2651,18670,21695,436 "2009-09-21 00:00",2c40a5b,15498,0,521,2651,18670,21695,436 "2009-09-22 00:00",5d3d3a3,15498,0,521,2651,18670,21695,436 "2009-09-23 00:00",0220cc2,15506,0,521,2658,18685,21710,436 "2009-09-24 00:00",e9a7966,15506,0,521,2658,18685,21710,436 "2009-09-25 00:00",729722a,15515,0,521,2651,18687,21712,436 "2009-09-26 00:00",729722a,15515,0,521,2651,18687,21712,436 "2009-09-27 00:00",834929c,15518,0,525,2651,18694,21719,436 "2009-09-28 00:00",0331d60,15513,0,520,2648,18681,21729,436 "2009-09-29 00:00",0331d60,15512,0,520,2650,18682,21730,436 "2009-09-30 00:00",2d34081,12778,98,520,2134,15404,18458,436 "2009-10-01 00:00",ffe6481,15956,0,520,2650,19126,22180,436 "2009-10-02 00:00",f52e459,15966,0,515,2660,19141,22195,436 "2009-10-03 00:00",e976f23,27697,0,515,6847,35059,38113,449 "2009-10-04 00:00",e976f23,26949,1,515,6847,34309,37363,449 "2009-10-05 00:00",1ca164a,27717,2,514,6838,35071,38088,449 "2009-10-06 00:00",d91717d,27720,0,517,6839,35076,38093,449 "2009-10-07 00:00",8d63378,27718,2,517,6839,35076,38093,449 "2009-10-08 00:00",30e2cfd,27719,0,515,6841,35075,38092,449 "2009-10-09 00:00",daf221d,27719,0,515,6841,35075,38092,449 "2009-10-10 00:00",1b83557,27754,0,521,6846,35121,38138,450 "2009-10-11 00:00",7ec926f,27776,0,518,6847,35141,38158,450 "2009-10-12 00:00",d749d9b,27835,0,521,6868,35224,38211,452 "2009-10-13 00:00",d749d9b,27836,0,521,6867,35224,38211,452 "2009-10-14 00:00",54cfe42,27840,0,520,6874,35234,38221,452 "2009-10-15 00:00",3eceb87,27842,0,521,6876,35239,38226,452 "2009-10-16 00:00",d5a2ee9,27804,0,521,6876,35201,38188,452 "2009-10-17 00:00",d5a2ee9,27804,0,521,6876,35201,38188,452 "2009-10-18 00:00",dc9e98e,0,27804,521,6876,35201,38188,452 "2009-10-19 00:00",827734a,27879,0,523,6902,35304,38291,452 "2009-10-20 00:00",9d76f3b,32365,83,523,2333,35304,38291,452 "2009-10-21 00:00",db1e525,32568,104,485,2140,35297,38284,453 "2009-10-22 00:00",0e662a7,32614,83,491,2151,35339,38326,453 "2009-10-23 00:00",49e62fa,32616,83,493,2156,35348,38335,454 "2009-10-24 00:00",501b4fb,32618,83,493,2157,35351,38335,454 "2009-10-25 00:00",501b4fb,32621,83,494,2160,35358,38342,454 "2009-10-26 00:00",6817b90,32621,83,494,2164,35362,38337,454 "2009-10-26 00:00",571425b,0,32621,494,2164,35362,38337,454 "2009-10-28 00:00",e8cac16,32714,7,496,2188,35405,38373,454 "2009-10-29 00:00",8cf27e5,32721,7,500,2192,35420,38388,454 "2009-10-30 00:00",4320479,31697,17,499,2187,34175,37143,454 "2009-10-31 00:00",d154eb9,32729,7,499,2187,35422,38390,454 "2009-11-01 00:00",d154eb9,32701,37,499,2187,35424,38392,454 "2009-11-02 00:00",33111d4,32609,120,498,2161,35388,38356,452 "2009-11-03 00:00",74f561e,32609,117,498,2164,35388,38356,452 "2009-11-04 00:00",16eab0f,32613,117,498,2164,35392,38360,452 "2009-11-05 00:00",5e05b88,32685,7,516,2196,35404,38372,451 "2009-11-06 00:00",5e05b88,32685,7,516,2196,35404,38372,451 "2009-11-07 00:00",fe6dd27,32688,7,513,2196,35404,38372,451 "2009-11-08 00:00",37d480a,32677,13,512,2196,35398,38374,451 "2009-11-09 00:00",929998c,32696,5,514,2196,35411,38379,451 "2009-11-10 00:00",929998c,32696,15,516,2196,35423,38389,451 "2009-11-11 00:00",f16c9e2,32705,6,516,2196,35423,38389,451 "2009-11-12 00:00",f87efac,31444,11,525,2197,33683,36618,453 "2009-11-13 00:00",d04cce9,32734,8,525,2198,35465,38400,453 "2009-11-14 00:00",d04cce9,32737,8,532,2201,35478,38378,453 "2009-11-15 00:00",7347ec0,32738,8,532,2201,35479,38379,453 "2009-11-16 00:00",7347ec0,32737,10,534,2204,35485,38380,453 "2009-11-17 00:00",d3a573b,32742,6,534,2206,35407,38302,453 "2009-11-18 00:00",68d5c37,32742,6,534,2206,35407,38302,453 "2009-11-19 00:00",c00de9d,32753,5,537,2209,35423,38318,453 "2009-11-20 00:00",f5065b6,32723,16,534,2194,35467,38367,453 "2009-11-21 00:00",6bf0179,32769,16,538,2214,35537,38538,453 "2009-11-22 00:00",6bf0179,32769,16,538,2214,35537,38538,453 "2009-11-23 00:00",6bf0179,32759,16,540,2222,35537,38538,453 "2009-11-24 00:00",0a61bee,32794,8,542,2222,35563,38564,453 "2009-11-25 00:00",0a61bee,32771,31,542,2222,35563,38564,453 "2009-11-26 00:00",f151334,32540,134,531,2184,35262,38263,453 "2009-11-27 00:00",f151334,32540,134,531,2185,35263,38264,453 "2009-11-28 00:00",2b93c78,32557,134,537,2185,35286,38287,453 "2009-11-29 00:00",7ce13d8,32538,0,528,2216,35295,38296,453 "2009-11-30 00:00",7ce13d8,32536,0,528,2218,35295,38296,453 "2009-12-01 00:00",ef9c024,32536,0,528,2218,35295,38296,453 "2009-12-02 00:00",ef9c024,32536,0,528,2218,35295,38296,453 "2009-12-03 00:00",7914ca3,32536,0,528,2218,35295,38296,453 "2009-12-04 00:00",7ef3861,32509,0,528,2218,35298,38299,453 "2009-12-05 00:00",7ef3861,32539,0,527,2218,35298,38299,453 "2009-12-06 00:00",7ef3861,32539,0,527,2218,35298,38299,453 "2009-12-07 00:00",7ef3861,32406,0,527,2208,35160,38161,453 "2009-12-08 00:00",7ef3861,32270,0,545,2009,35166,38167,453 "2009-12-09 00:00",7ef3861,32259,0,546,2021,35171,38172,453 "2009-12-10 00:00",7ef3861,32259,0,546,2021,35171,38172,453 "2009-12-11 00:00",7ef3861,32258,0,546,2021,35171,38172,453 "2009-12-12 00:00",7ef3861,32255,0,545,2025,35172,38173,453 "2009-12-13 00:00",7ef3861,32255,0,543,2027,35172,38173,453 "2009-12-14 00:00",7ef3861,32255,0,543,2027,35172,38173,453 "2009-12-15 00:00",7ef3861,32225,0,543,2027,35172,38173,453 "2009-12-16 00:00",55f51dc,32255,0,543,2027,35172,38173,453 "2009-12-17 00:00",2198ecc,32192,0,543,2021,34311,37376,449 "2009-12-18 00:00",7f1c3fe,32084,0,541,2009,34237,37313,448 "2009-12-19 00:00",7f1c3fe,32080,0,541,2006,34237,37313,448 "2009-12-20 00:00",8dc1895,32080,0,541,2006,34237,37313,448 "2009-12-21 00:00",8dc1895,32080,0,541,2006,34237,37313,448 "2009-12-22 00:00",8dc1895,32080,0,541,2006,34237,37313,448 "2009-12-23 00:00",8dc1895,32080,0,541,2006,34237,37313,448 "2009-12-24 00:00",8dc1895,32080,0,541,2006,34237,37313,448 "2009-12-25 00:00",8dc1895,32080,0,541,2006,34237,37313,448 "2009-12-26 00:00",8dc1895,32080,0,541,2006,34237,37313,448 "2009-12-27 00:00",8dc1895,32075,0,541,2002,34245,37321,448 "2009-12-28 00:00",77bf8cf,32075,0,541,2002,34245,37321,448 "2009-12-29 00:00",77bf8cf,32045,0,545,2004,34221,37297,448 "2009-12-30 00:00",db84bc0,32045,0,548,2004,34224,37300,448 "2009-12-31 00:00",db84bc0,32045,0,548,2004,34224,37300,448 "2010-01-01 00:00",db84bc0,32041,0,547,2005,34224,37300,448 "2010-01-02 00:00",db84bc0,32041,0,547,2005,34224,37300,448 "2010-01-03 00:00",db84bc0,32041,0,547,2005,34224,37300,448 "2010-01-04 00:00",db84bc0,32041,0,547,2005,34224,37300,448 "2010-01-05 00:00",3867ffd,32038,0,546,2001,34216,37292,448 "2010-01-06 00:00",3867ffd,32038,0,546,2001,34216,37292,448 "2010-01-07 00:00",3867ffd,32038,0,546,2001,34216,37292,448 "2010-01-08 00:00",3867ffd,32038,0,546,2001,34216,37292,448 "2010-01-09 00:00",3867ffd,32012,0,545,1984,34172,37248,448 "2010-01-10 00:00",3867ffd,32012,0,545,1984,34172,37248,448 "2010-01-11 00:00",3867ffd,32007,0,544,1990,34172,37248,448 "2010-01-12 00:00",3867ffd,32007,0,544,1997,34176,37252,448 "2010-01-13 00:00",3867ffd,32007,0,544,1997,34176,37252,448 "2010-01-14 00:00",3867ffd,32007,0,544,1997,34176,37252,448 "2010-01-15 00:00",3867ffd,32007,0,544,1997,34176,37252,448 "2010-01-16 00:00",3867ffd,31958,0,544,1999,34179,37255,447 "2010-01-17 00:00",3867ffd,31958,0,544,1999,34179,37255,447 "2010-01-18 00:00",726b83a,31958,0,544,1999,34179,37255,447 "2010-01-19 00:00",726b83a,31958,0,544,1999,34179,37255,447 "2010-01-20 00:00",726b83a,31957,0,545,1999,34179,37268,447 "2010-01-21 00:00",1d49284,31957,0,545,1999,34179,37268,447 "2010-01-22 00:00",1d49284,31957,0,545,1999,34179,37268,447 "2010-01-24 00:00",a609d77,32731,0,542,2216,35489,38554,449 "2010-01-25 00:00",a609d77,32731,0,542,2216,35489,38554,449 "2010-01-26 00:00",a609d77,32731,0,542,2216,35489,38554,449 "2010-01-27 00:00",a609d77,32731,0,542,2216,35489,38554,449 "2010-01-28 00:00",a609d77,32731,0,542,2216,35489,38554,449 "2010-01-29 00:00",a609d77,32731,0,542,2216,35489,38554,449 "2010-01-30 00:00",a609d77,32731,0,542,2216,35489,38554,449 "2010-01-31 00:00",a609d77,32731,0,542,2216,35489,38554,449 "2010-02-01 00:00",a609d77,32731,0,542,2216,35489,38554,449 "2010-02-02 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-03 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-04 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-05 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-06 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-07 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-08 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-09 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-10 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-11 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-12 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-13 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-14 00:00",30e0ed3,32731,0,542,2216,35489,38554,449 "2010-02-15 00:00",70667a0,4051,0,58,336,4445,16418,139 "2010-02-16 00:00",65e2d3d,4085,0,58,336,4479,16428,140 "2010-02-17 00:00",6c478f2,4816,1,129,279,5225,16525,172 "2010-02-18 00:00",b4824f3,24167,0,131,301,24599,35727,194 "2010-02-19 00:00",8fdc942,24221,0,131,301,24653,35730,195 "2010-02-20 00:00",71d8848,24223,0,129,301,24653,35730,195 "2010-02-21 00:00",e904536,23424,20,122,296,23862,34939,195 "2010-02-22 00:00",14f803a,23424,20,122,296,23862,34872,195 "2010-02-23 00:00",d6129bc,24265,0,130,317,24712,35680,197 "2010-02-24 00:00",4f74e3b,24309,0,128,319,24756,35677,200 "2010-02-25 00:00",88f57f6,24339,0,128,331,24798,35695,204 "2010-02-26 00:00",403afe0,24575,1,139,426,25141,35754,215 "2010-02-27 00:00",c83cf2a,24645,0,139,422,25206,35748,216 "2010-02-28 00:00",8ffb7ea,24884,2,151,469,25506,35854,225 "2010-03-01 00:00",588a345,23508,0,162,500,24072,34217,231 "2010-03-02 00:00",5e5969d,25342,0,181,522,26045,35961,240 "2010-03-03 00:00",efb2ccd,25346,0,183,522,26051,35967,240 "2010-03-04 00:00",cee8058,25346,2,181,522,26051,35973,240 "2010-03-05 00:00",2d9808d,25354,1,182,522,26059,35975,241 "2010-03-06 00:00",974d9a8,25404,0,187,532,26091,35978,243 "2010-03-07 00:00",54be6dd,25678,1,201,526,26406,36153,256 "2010-03-08 00:00",f56934d,26687,0,262,789,27738,37279,272 "2010-03-09 00:00",0162536,26860,0,264,814,27938,37320,279 "2010-03-10 00:00",88032ee,27015,0,271,946,28232,37601,287 "2010-03-11 00:00",e634b58,27019,0,271,944,28234,37603,287 "2010-03-12 00:00",3f6af6a,27155,0,286,986,28427,37730,293 "2010-03-13 00:00",41506d4,27256,0,301,1036,28593,37739,302 "2010-03-14 00:00",fefb298,27412,0,308,1076,28796,37867,310 "2010-03-15 00:00",c29d389,27562,0,319,1190,29071,37963,318 "2010-03-16 00:00",f676705,25945,1,316,1197,27404,36272,322 "2010-03-17 00:00",e3937f7,27628,0,319,1205,29152,38020,322 "2010-03-18 00:00",2abcdcd,27764,1,340,1190,29295,38109,332 "2010-03-19 00:00",1e9aa08,27767,0,334,1170,29271,38079,333 "2010-03-20 00:00",a6e9e13,28068,0,356,1174,29598,38075,336 "2010-03-21 00:00",6be8f8c,28312,1,368,1200,29881,38165,338 "2010-03-22 00:00",265726d,28428,2,369,1214,30013,38190,343 "2010-03-23 00:00",eae8b29,28474,2,374,1250,30100,38271,348 "2010-03-24 00:00",d0bf6e3,28549,2,375,1218,30144,38280,354 "2010-03-25 00:00",626ee20,28553,0,375,1218,30146,38286,354 "2010-03-26 00:00",b2f995a,28730,0,415,1304,30449,38287,359 "2010-03-27 00:00",cddc8a7,28730,0,415,1298,30443,38281,359 "2010-03-28 00:00",cddc8a7,28730,0,415,1298,30443,38281,359 "2010-03-29 00:00",534afd8,28765,0,429,1309,30503,38307,361 "2010-03-30 00:00",534afd8,28765,0,429,1309,30503,38307,361 "2010-03-31 00:00",8ba6030,28799,1,430,1362,30592,38396,362 "2010-04-01 00:00",7d00af1,28872,1,438,1401,30712,38488,366 "2010-04-02 00:00",63ff066,28928,1,435,1378,30742,38494,369 "2010-04-03 00:00",e50ff8c,30369,1,435,1454,32259,38496,378 "2010-04-04 00:00",32fda13,30443,1,426,1458,32328,38513,380 "2010-04-05 00:00",4d1b1c7,30515,2,448,1491,32456,38537,385 "2010-04-06 00:00",3b1d348,30548,10,445,1493,32496,38577,386 "2010-04-07 00:00",8c434e8,30552,2,451,1493,32416,38486,387 "2010-04-08 00:00",8c434e8,30564,2,451,1493,32510,38580,387 "2010-04-09 00:00",8681735,30571,2,451,1489,32513,38582,388 "2010-04-10 00:00",43f8659,30570,2,452,1489,32513,38582,388 "2010-04-11 00:00",9406f55,30446,145,446,1441,32422,38491,388 "2010-04-12 00:00",8b256a9,30568,2,452,1491,32431,38500,388 "2010-04-13 00:00",cb45216,30609,2,453,1498,32562,38595,390 "2010-04-14 00:00",fb38dbf,30604,2,453,1503,32562,38595,390 "2010-04-15 00:00",2ec0e4e,30626,2,454,1509,32591,38595,391 "2010-04-16 00:00",78faa0c,30634,2,448,1507,32591,38595,391 "2010-04-17 00:00",78faa0c,30641,2,450,1507,32600,38604,391 "2010-04-18 00:00",78faa0c,30643,2,450,1507,32602,38606,391 "2010-04-19 00:00",842d2b0,30701,4,450,1507,32662,38666,392 "2010-04-20 00:00",b05155e,30751,2,457,1505,32715,38688,392 "2010-04-21 00:00",483a9da,30785,0,449,1522,32674,38627,397 "2010-04-22 00:00",98f05df,30887,0,450,1523,32774,38645,402 "2010-04-23 00:00",6783b52,31502,64,453,1634,33653,38728,410 "2010-04-24 00:00",de2ad34,31558,0,465,1632,33655,38731,410 "2010-04-26 00:00",f6ec0aa,31686,0,468,1650,33804,38790,417 "2010-04-27 00:00",1cdbc19,31695,19,473,1653,33840,38804,419 "2010-04-28 00:00",6a502fc,31707,1,479,1646,33833,38798,419 "2010-04-29 00:00",fe59fa8,31740,0,480,1633,33853,38818,419 "2010-04-30 00:00",f31d524,31142,724,464,1533,33863,38828,419 "2010-05-01 00:00",376196d,31178,724,455,1577,33934,38890,420 "2010-05-02 00:00",8abe0a6,31807,1,468,1694,33970,38898,421 "2010-05-03 00:00",b440a11,31789,47,470,1685,33991,38898,423 "2010-05-04 00:00",124895a,31846,0,473,1684,34003,38908,424 "2010-05-05 00:00",60c23d9,31846,0,473,1684,34003,38908,424 "2010-05-06 00:00",badc61d,30996,67,471,1685,33219,38094,426 "2010-05-07 00:00",ab23221,31873,11,474,1695,34039,38904,427 "2010-05-08 00:00",9427875,31864,10,475,1698,34041,38896,428 "2010-05-09 00:00",27e05a8,31966,24,475,1710,34170,39002,432 "2010-05-10 00:00",3d3893a,32005,0,532,1660,34197,39026,432 "2010-05-11 00:00",ed24098,32005,0,532,1660,34197,39026,433 "2010-05-12 00:00",ed24098,32015,0,532,1663,34210,39039,433 "2010-05-13 00:00",ed24098,32015,0,532,1663,34210,39039,433 "2010-05-14 00:00",da421b4,30785,0,532,1663,32963,37792,433 "2010-05-15 00:00",82f7ef3,32129,0,527,1652,34308,39137,433 "2010-05-16 00:00",92508d6,32144,0,529,1648,34321,39142,434 "2010-05-17 00:00",87e0e1b,32144,0,529,1648,34321,39142,434 "2010-05-18 00:00",2d0fc2b,32187,0,527,1666,34380,39183,437 "2010-05-19 00:00",5ec28d3,32257,0,527,1684,34461,39252,446 "2010-05-20 00:00",8292d45,32346,1,530,1682,34559,39356,448 "2010-05-21 00:00",e6863e4,32347,0,530,1682,34559,39356,448 "2010-05-22 00:00",9a15b82,32422,0,530,1684,34636,39433,451 "2010-05-23 00:00",eb84e91,32474,2,531,1689,34680,39434,457 "2010-05-24 00:00",10a3218,32517,0,531,1648,34696,39450,457 "2010-05-25 00:00",52a1375,32492,4,530,1646,34672,39455,456 "2010-05-26 00:00",475d1c7,32519,2,537,1628,34618,39395,460 "2010-05-27 00:00",e40ee42,32555,8,537,1647,34747,39520,460 "2010-05-28 00:00",ac1571f,32574,8,537,1646,34765,39538,460 "2010-05-29 00:00",9581e6a,32632,552,539,1641,35351,39542,471 "2010-05-30 00:00",dd0e5dd,32920,0,605,1857,35382,39573,471 "2010-05-31 00:00",4f9ca44,32962,1,608,1880,35451,39661,473 "2010-06-01 00:00",18d9960,33046,0,609,1871,35526,39736,473 "2010-06-02 00:00",18d9960,33063,0,609,1872,35544,39754,473 "2010-06-03 00:00",18d9960,0,33063,609,1872,35544,39754,473 "2010-06-04 00:00",e92a5f4,33172,0,607,1884,35663,39822,474 "2010-06-05 00:00",7c83e65,33223,2,607,1889,35721,39886,474 "2010-06-06 00:00",c0efe09,33258,4,606,1892,35760,39898,476 "2010-06-07 00:00",a1193fe,33296,0,609,1896,35801,39929,478 "2010-06-08 00:00",34c1ba4,33358,0,609,1890,35857,39985,479 "2010-06-09 00:00",9f05efa,33360,0,609,1890,35859,39987,479 "2010-06-10 00:00",16d9cb0,33360,0,609,1890,35859,39987,479 "2010-06-11 00:00",d59da85,33384,1,611,1890,35886,40009,481 "2010-06-12 00:00",52873b9,33323,1,611,1890,35825,39948,480 "2010-06-13 00:00",ecacff9,33361,1,614,1880,35856,39979,480 "2010-06-14 00:00",ca5bfc1,29096,3284,379,1209,32548,36671,480 "2010-06-15 00:00",11f835f,32370,641,562,1709,35017,39140,480 "2010-06-16 00:00",b6cc36c,32838,272,568,1772,35416,39649,473 "2010-06-17 00:00",fdb5ca4,33280,37,608,1935,35853,39887,489 "2010-06-18 00:00",3da39cf,33443,4,592,1916,35955,39960,490 "2010-06-19 00:00",683a745,33461,30,595,1906,35992,39969,492 "2010-06-20 00:00",b98d7fa,33534,55,594,1945,36128,40037,496 "2010-06-21 00:00",1277e18,33592,0,598,1951,36141,40050,496 "2010-06-22 00:00",7b089e5,33605,0,596,1937,36138,40047,496 "2010-06-23 00:00",11cbd4f,33610,0,597,1940,36147,40056,496 "2010-06-24 00:00",11cbd4f,33572,2,597,1916,36023,39932,495 "2010-06-25 00:00",f34e780,33587,0,600,1943,36130,40039,495 "2010-06-26 00:00",6769e19,33594,0,599,1938,36131,40040,496 "2010-06-27 00:00",2334011,33656,2,586,1921,36165,40074,496 "2010-06-28 00:00",05684c0,33663,0,584,1918,36165,40074,496 "2010-06-29 00:00",871e2fb,33718,4,569,1924,36215,40091,497 "2010-06-30 00:00",aa015ad,33735,1,569,1937,36238,40102,500 "2010-07-01 00:00",3d2cb82,33744,1,568,1937,36250,40114,500 "2010-07-02 00:00",fcf394a,33678,22,568,1932,36193,40057,501 "2010-07-03 00:00",0ad106c,33505,177,558,1915,36155,40021,501 "2010-07-04 00:00",77ca4f5,33767,55,568,1937,36327,40182,504 "2010-07-05 00:00",ef66ac3,33832,3,565,1940,36340,40195,505 "2010-07-06 00:00",55acd1d,33927,19,558,1907,36411,40197,507 "2010-07-07 00:00",f8dde0a,33926,2,568,1905,36383,40171,507 "2010-07-08 00:00",894e793,33910,0,568,1905,36383,40163,507 "2010-07-09 00:00",1086ff8,34010,12,573,1940,36534,40163,513 "2010-07-10 00:00",7579f7a,34118,3,580,1883,36584,40171,515 "2010-07-11 00:00",7579f7a,34085,3,578,1881,36543,40130,515 "2010-07-12 00:00",bb6df24,34111,26,579,1879,36544,40131,515 "2010-07-13 00:00",ae4538a,34143,29,581,1885,36591,40178,515 "2010-07-14 00:00",c8b6cf4,34157,16,596,1876,36598,40183,516 "2010-07-15 00:00",d51e99a,23534,5,600,1876,26015,20985,515 "2010-07-16 00:00",c513fbd,23507,13,600,1875,25995,20955,516 "2010-07-17 00:00",dd8d5d7,23527,5,596,1875,26003,20963,516 "2010-07-18 00:00",cd64dd0,23415,83,583,1868,25835,20749,518 rakudo-2018.03/docs/val.pod60000644000175000017500000001167513253717231014142 0ustar alexalex=begin pod This document is meant to describe in some detail what's going on in C (found in C), since it's quite a big function. It contains a bunch of inner subs to make the process as sane as possible without resorting to a grammar. The phrase "or fails" in statements on return values means it returns a C, something that always presents itself as undefined. The C<$*LAST_CHANCE> dynamic (defined within C) is used to mark a given candidate as the last possible one, even if it isn't the last in the list (see below on C and C). The top-level (first) call to C will set C<$really-no-doubt> to C<$*LAST_CHANCE> as part of the error reporting process. =head2 C The C class is just a hack, because using Cs in a similar way will cause Perl 6 to hang and likely eat all your memory (including on compiling C, the next step after C). Its only similarity to a C is that it always comes out as undefined (so it can be used with C/C/C). Aside from that it's meant to collect the error information as the literal is processed, turning into a C at the end. =head2 C =item C --- Checks for a negative sign at the start of the string =item2 Returns C<1> or C<0>, to match the flag for C =item C --- Checks if the start of string is a C<+> or C<-> =item2 Returns C<1> or C<0>, to match C (though these particular return values aren't otherwise important) =item C --- Check for oh radix prefix (0x, 0d, 0b, 0o) =item2 Returns new radix or fails =item C --- Runs through a sequence of subs in trying to find a literal, or part of one. =item2 Adverb C<:toplevel> sets C<$really-no-doubt> to C<$*LAST_CHANCE> (meant to let the top-level call to C add a measure of doubt to the given error message) =item2 Returns a literal or fails (with the last candidate's C) =item2 In regex terms, similar to C<||> =item C --- Sets C<$*LAST_CHANCE>, thereby telling C that the sub which called this has to be the one that matches the literal. In other words, it's called by a candidate when it knows that the literal "has to be this" candidate. =item2 Returns nothing useful. =item2 In regex terms, similar to C<::> =head2 C =item Bare integer --- C --- C<42>, C<-12>, C<0xF>, etc. =item2 Options: =item3 C<:e> --- used when calling from C =item3 C<:nosign> --- used when calling from C =item2 Requires: =item3 C (unless C<:nosign>) =item3 C (unless C<:e>) =item2 Returns C or fails =item Radix point rational --- C --- C<3.2>, C<-5.4> =item2 Options: =item3 C<:adverb> --- used when calling from C, allows oh radices =item3 C<:nosign> --- passed through for C, and used in here =item2 Requires: =item3 C (for before point portion) =item3 C (unless C<:nosign>) =item3 C (only if C<:adverb>) =item2 Returns C or fails =item Scientific C --- C --- C<1e5>, C<-3.5e-2> =item2 Requires: =item3 C (coefficient) =item3 C (exponent, base of 10 implied) =item2 Returns C or fails =item Adverbial number --- C --- C«:16», C«:11<0o7.7*8**2>», etc. =item2 Options: =item3 C<:nofrac> --- used when calling from C =item3 C<:nosign> --- controls whether a sign can be in front of the adverb =item2 Requires: =item3 C (for radix specifier, integer coeff) =item3 C (non-int coefficient) =item3 C (optional base in :#<> form) =item3 C (optional base in :#<> form) =item3 C (optional exp in :#<> form) =item3 C (optional exp in :#<> form) =item2 Returns: =item3 C if optional base and exponent; =item3 C without base and exponent, non-integral number; =item3 C without base and exponent, integral number; =item3 or fails =item Fractional rational --- C --- C«1/2», C«-3/:16», etc =item2 Requires: =item3 C (for :#<> form numerator) =item3 C (for bare integers in numerator) =item3 C (for :#<> form denominator) =item3 C (for bare integers in numerator) =item2 Returns C or fails =item Complex number --- C --- C<1+2i>, C<-3.5+-1i>, etc =item2 Requires: =item3 C =item3 C =item3 C =item3 C =item2 Returns C or fails =end podrakudo-2018.03/docs/windows.md0000644000175000017500000000335413253717231014575 0ustar alexalex# Building on windows ## VM Let's assume we're starting out with no hardware: Get virtual box for your platform here: https://www.virtualbox.org/wiki/Downloads Get a windows 10 evaluation copy from here: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines ## Prereqs The evaluation copy comes with a copy of Visual Studio. ### Strawberry Perl Install Strawberry Perl from: https://strawberryperl.com/ ### Visual Studio Run the VS installer; modify the existing install, and select "Desktop Development with C++"; This will make the command line tools available in the "Developer Command Prompt for VS 2017" ### Git Install git from: https://git-scm.com/download/win ## Rakudo Clone rakudo; in the VS command prompt: C:\Users\user git clone https://github.com/rakudo/rakudo.git Configure rakudo: C:\Users\user cd rakudo C:\Users\user perl Configure.pl --backends=moar --gen-moar --moar-option="--cc=cl" --moar-option="--ld=link" --moar-option="--make=nmake" This will git clone nqp & MoarVM, then build MoarVM, nqp. To build rakudo itself (and install it into a local ./install directory): You might want to "copy config.status config.bat" to save this config, so you can later run "config" to perform the config step. You may wish to use "--gen-moar=master" or "--gen-nqp=master" to get the latest version of those repositories. Build rakudo (for Strawberry/gcc) : C:\Users\user gmake install Build rakudo (for ActiveState/VS) : C:\Users\user nmake install ## Test Now you can run (using the appropriate make command) the builtin rakudo tests: C:\Users\user nmake test Or the spectest suite (note that this will use git to download the test suite) C:\Users\user nmake spectest rakudo-2018.03/dynext/IGNORE0000644000175000017500000000004513253717231014044 0ustar alexalexThis space intentionally left blank. rakudo-2018.03/gen/jvm/.gitignore0000644000175000017500000000000213253717231015151 0ustar alexalex* rakudo-2018.03/gen/moar/.gitignore0000644000175000017500000000000213253717231015313 0ustar alexalex* rakudo-2018.03/INSTALL.txt0000644000175000017500000001614413253717231013501 0ustar alexalex Build requirements (Installing from source) For building Rakudo you need at least a C compiler, a "make" utility, and Perl 5.10 or newer. To automatically obtain and build MoarVM as well as NQP, you may also need a git client, which is also needed for fetching the test suite. Building rakudo can take up to 1G of memory when compiling for the MoarVM runtime. The requirements are higher for the JVM backend. (Perl is installed by default already). To enable parallel testing you also need the CPAN module Test::Harness in version 3.16 or newer; you can control the number of parallel jobs with the "TEST_JOBS" environment variable. If TEST_JOBS is not specified, 6 jobs will be used. Building and invoking Rakudo If you're wanting the bleeding-edge version of the Rakudo Perl 6 compiler, we recommend downloading Rakudo directly from Github and building it from there. $ git clone git://github.com/rakudo/rakudo.git If you don't have git installed, you can get a tarball of Rakudo from . Then unpack the tarball. If you already have cloned Rakudo from github, you can get (pull) the most recent version from github like this: $ cd rakudo $ git pull Once you have an up-to-date copy of Rakudo, build it as follows: $ perl Configure.pl --gen-moar --gen-nqp --backends=moar # Moar only or: $ perl Configure.pl --gen-nqp --backends=jvm # needs JDK 1.8 installed then: $ make This will create a "perl6" or "perl6.exe" executable in the current (rakudo) directory. Additionally, for each selected backend, there will be a perl6-* binary. Note that if you have multiple (Perl 5) "perl"s in your path, you may need to use a fully qualified path to the appropriate executable (or update your PATH environment variable). Programs can then be run from the build directory using a command like: $ ./perl6 hello.pl Simply running "perl6" will drop you into a REPL (read-eval-print-loop) that you can use for exploratory programming: $ ./perl6 If you would like readline-like features, such as command history, line editing, and tab completion for builtins, you should install the Linenoise module via zef: $ zef install Linenoise Important: To run Rakudo from outside the build directory, you must run $ make install This will install the "perl6" (or "perl6.exe" binary on windows) into the "install/bin" directory locally, no additional root privileges necessary. If you want to have perl6, nqp, and moar installed into a different directory, you may supply --prefix= to Configure.pl. The "--gen-moar" above option tells Configure.pl to automatically download and build the most appropriate version of NQP and MoarVM into local "nqp/" and "moar/" subdirectories, install NQP and MoarVM into the "install/" subdirectory, and use them for building Rakudo. It's okay to use the "--gen-moar" option on later invocations of Configure.pl; the configure system will re-build NQP and/or MoarVM only if a newer version is needed for whatever version of Rakudo you're working with. If you already have MoarVM installed, you can use "--with-moar=/path/to/bin/moar" to use it instead of building a new one. This installed MoarVM must include its development environment. Similarly, if you already have NQP installed, you can specify "--with-nqp=/path/to/bin/nqp" to use it. (Note that this must be NQP, not the NQP-rx that comes with MoarVM.) The versions of any already installed NQP or MoarVM binaries must satify a minimum specified by the Rakudo being built -- Configure.pl and "make" will verify this for you. Released versions of Rakudo generally build against the latest release of MoarVM; checkouts of Rakudo's HEAD revision from Github often require a version of MoarVM that is newer than the most recent MoarVM monthly release. Once built, Rakudo's "make install" target will install Rakudo and its libraries into the directories specified by the MoarVM installation used to create it or whatever you specified with the --prefix flag. Until this step is performed, the "perl6" executable created by "make" above can only be reliably run from the root of Rakudo's build directory. After "make install" is performed, the installed executable can be run from any directory (as long as the MoarVM installation that were used to create it remain intact). If the Rakudo compiler is invoked without an explicit script to run, it enters a small interactive mode that allows Perl 6 statements to be executed from an interactive prompt. See the manual page ("docs/running.pod") for more about command-line options. Build/install problems Occasionally, there may be problems when building/installing Rakudo. Make sure you have a backup of any custom changes you have done to the source tree before performing the following steps: Try to remove the "install/" subdirectory: $ cd rakudo $ rm -r install $ git pull $ perl Configure.pl --gen-moar --gen-nqp --backends=moar # for instance $ make Or, in case you are really stuck, start with a fresh source tree: $ rm -r rakudo $ git clone git://github.com/rakudo/rakudo.git Running the test suite Entering "make test" will run a small test suite that comes bundled with Rakudo. This is a simple suite of tests, designed to make sure that the Rakudo compiler is basically working and that it's capable of running a simple test harness. Running "make spectest" will import the official Perl 6 test suite from the "roast" repository and run all of these tests that are currently known to pass. At present we do not have any plans to directly store the official test suite as part of the Rakudo repository, but will continue to fetch it from the roast repository. Releases of Rakudo get a snapshot of the roast repository as of the time of the release. You can also use "make" to run an individual test from the command line: $ make t/spec/S29-str/ucfirst.t t/spec/S29-str/ucfirst.rakudo .. 1..4 ok 1 - simple ok 2 - empty string ok 3 - # SKIP unicode ok 4 - # SKIP unicode # FUDGED! ok All tests successful. Files=1, Tests=4, 1 wallclock secs ( 0.02 usr 0.00 sys + 0.57 cusr 0.06 csys = 0.65 CPU) Result: PASS If you want to run the tests in parallel, you need to install a fairly recent version of the Perl 5 module Test::Harness (3.16 works for sure). Spectest smolder requirements (Windows) You need recent version of either Strawberry Perl or ActiveState Perl. If you are working with ActiveState Perl you need the Mingw gcc compiler. You need msys git installed and you need "\Program Files\Git\cmd" on your execution path and NOT "\Program Files\Git\bin". You need a win32 curl program. rakudo-2018.03/lib/CompUnit/Repository/Staging.pm60000644000175000017500000000113713253717231020331 0ustar alexalexclass CompUnit::Repository::Staging is CompUnit::Repository::Installation { has Str $.name; submethod BUILD(Str :$!name --> Nil) { CompUnit::RepositoryRegistry.register-name($!name, self); } method short-id() { 'staging' } method name(--> Str) { $!name } method path-spec(CompUnit::Repository::Staging:D:) { self.^name ~ '#name(' ~ $!name ~ ')#' ~ $.prefix.absolute; } method source-file(Str $name --> IO::Path) { my $file = self.prefix.add($name); $file.e ?? $file !! self.next-repo.source-file($name) } } # vim: ft=perl6 rakudo-2018.03/lib/experimental.pm60000644000175000017500000000245313253717231015517 0ustar alexalexuse nqp; package EXPORT::cached { multi sub trait_mod:(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:(Method $m, :$cached!) { X::NYI.new(:feature("'is cached' on methods")).throw; } OUR::{'&trait_mod:'} := &trait_mod:; } package EXPORT::macros { OUR:: := True; } package EXPORT::smallnatives { our native int1 is repr('P6int') is Int is nativesize( 1) { } our native int2 is repr('P6int') is Int is nativesize( 2) { } our native int4 is repr('P6int') is Int is nativesize( 4) { } our native uint1 is repr('P6int') is Int is nativesize( 1) is unsigned { } our native bit is repr('P6int') is Int is nativesize( 1) is unsigned { } our native uint2 is repr('P6int') is Int is nativesize( 2) is unsigned { } our native uint4 is repr('P6int') is Int is nativesize( 4) is unsigned { } } package EXPORT::pack { OUR:: := True; } package EXPORT::collation { OUR:: := True; } rakudo-2018.03/lib/NativeCall/Compiler/GNU.pm60000644000175000017500000000455613253717231017255 0ustar alexalexunit class NativeCall::Compiler::GNU; use NativeCall::Types; our sub mangle_cpp_symbol(Routine $r, $symbol) { $r.signature.set_returns($r.package) if $r.name eq 'new' && !$r.signature.has_returns && $r.package !~~ GLOBAL; my $mangled = '_Z' ~ ($r.package.REPR eq 'CPPStruct' ?? 'N' !! '') ~ $symbol.split('::').map({$_ eq 'new' ?? 'C1' !! $_.chars ~ $_}).join('') ~ ($r.package.REPR eq 'CPPStruct' ?? 'E' !! ''); my @params = $r.signature.params; if $r ~~ Method { @params.shift; @params.pop if @params.tail.name eq '%_'; } my $params = join '', @params.map: { my $R = $_.?cpp-ref ?? 'R' !! ''; # reference my $P = .rw ?? 'P' !! ''; # pointer my $K = ($R || $P) && $_.?cpp-const ?? 'K' !! ''; # const cpp_param_letter(.type, :$R, :$P, :$K) }; $mangled ~= $params || 'v'; } sub cpp_param_letter($type, :$R = '', :$P = '', :$K = '') { given $type { when NativeCall::Types::void { $R ~ $P ~ $K ~ 'v' } when Bool { $R ~ $P ~ $K ~ 'b' } when int8 { $R ~ $P ~ $K ~ 'c' } when uint8 { $R ~ $P ~ $K ~ 'h' } when int16 { $R ~ $P ~ $K ~ 's' } when uint16 { $R ~ $P ~ $K ~ 't' } when int32 { $R ~ $P ~ $K ~ 'i' } when uint32 { $R ~ $P ~ $K ~ 'j' } when NativeCall::Types::long { $R ~ $P ~ $K ~ 'l' } when NativeCall::Types::ulong { $R ~ $P ~ $K ~ 'm' } when int64 { $R ~ $P ~ $K ~ 'x' } when NativeCall::Types::longlong { $R ~ $P ~ $K ~ 'x' } when uint64 { $R ~ $P ~ $K ~ 'y' } when NativeCall::Types::ulonglong { $R ~ $P ~ $K ~ 'y' } when num32 { $R ~ $P ~ $K ~ 'f' } when num64 { $R ~ $P ~ $K ~ 'd' } when Str { 'Pc' } when NativeCall::Types::CArray | NativeCall::Types::Pointer { 'P' ~ $K ~ cpp_param_letter(.of); } default { my $name = .^name; $R ~ $P ~ $K ~ $name.chars ~ $name; } } } rakudo-2018.03/lib/NativeCall/Compiler/MSVC.pm60000644000175000017500000000603413253717231017365 0ustar alexalexunit class NativeCall::Compiler::MSVC; use NativeCall::Types; our sub mangle_cpp_symbol(Routine $r, $symbol) { $r.signature.set_returns($r.package) if $r.name eq 'new' && !$r.signature.has_returns && $r.package !~~ GLOBAL; my $mangled = '?'; if $r ~~ Method { $mangled ~= $symbol.split('::').reverse.map({$_ eq 'new' ?? '?0' !! "$_@"}).join('') ~ '@' ~ ($r.name eq 'new' ?? 'QE' !! 'UE'); } else { $mangled ~= $symbol.split('::').reverse.map({"$_@"}).join('') ~ '@' ~ 'Y' ~ 'A' # http://en.wikipedia.org/wiki/Visual_C%2B%2B_name_mangling#Function_Property ~ ($r.signature.has_returns ?? cpp_param_letter($r.returns) !! 'X'); } my @params = $r.signature.params; if $r ~~ Method { @params.shift; @params.pop if @params.tail.name eq '%_'; } my $params = join '', @params.map: { my $R = ''; # reference my $P = .rw ?? 'PE' !! ''; # pointer my $K = $P ?? ($_.?cpp-const ?? 'B' !! 'A') !! ''; # const cpp_param_letter(.type, :$R, :$P, :$K) }; if $r ~~ Method { $mangled ~= 'AA'; $mangled ~= $r.signature.has_returns && $r.name ne 'new' ?? cpp_param_letter($r.returns) !! ''; $mangled ~= $params; $mangled ~= '@' if $params || $r.name eq 'new'; $mangled ~= $params ?? 'Z' !! 'XZ'; } else { $mangled ~= $params || 'X'; $mangled ~= '@' if $r.package.REPR eq 'CPPStruct'; $mangled ~= 'Z'; } $mangled } sub cpp_param_letter($type, :$R = '', :$P = '', :$K = '') { given $type { when NativeCall::Types::void { $R ~ $K ~ 'X' } when Bool { $R ~ $K ~ '_N' } when int8 { $R ~ $K ~ 'D' } when uint8 { $R ~ $K ~ 'E' } when int16 { $R ~ $K ~ 'F' } when uint16 { $R ~ $K ~ 'G' } when int32 { $P ~ $K ~ 'H' } when uint32 { $P ~ $K ~ 'I' } when NativeCall::Types::long { $R ~ $K ~ 'J' } when NativeCall::Types::ulong { $R ~ $K ~ 'K' } when int64 { $R ~ '_J' } when NativeCall::Types::longlong { $R ~ '_J' } when uint64 { $R ~ '_K' } when NativeCall::Types::ulonglong { $R ~ '_K' } when num32 { $R ~ $K ~ 'M' } when num64 { $R ~ $K ~ 'N' } when Str { 'PEAD' } when NativeCall::Types::CArray { 'QEA' ~ cpp_param_letter(.of); } when NativeCall::Types::Pointer { 'PEA' ~ cpp_param_letter(.of); } default { my $name = .^name; $P ~ $K ~ $name.chars ~ $name; } } } rakudo-2018.03/lib/NativeCall.pm60000644000175000017500000006637413253717231015060 0ustar alexalexuse nqp; use QAST:from; use NativeCall::Types; use NativeCall::Compiler::GNU; use NativeCall::Compiler::MSVC; my $repr_map := nqp::hash( "CArray", "carray", "CPPStruct", "cppstruct", "CPointer", "cpointer", "CStruct", "cstruct", "CUnion", "cunion", "VMArray", "vmarray", ); module NativeCall { 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 ssize_t is export(:types, :DEFAULT) = NativeCall::Types::ssize_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; my constant OpaquePointer is export(:types, :DEFAULT) = NativeCall::Types::Pointer; # Role for carrying extra calling convention information. my role NativeCallingConvention[$name] { method native_call_convention() { $name }; } # Role for carrying extra string encoding information. my role NativeCallEncoded[$name] { method native_call_encoded() { $name }; } my role NativeCallMangled[$name] { method native_call_mangled() { $name } } # Throwaway type just to get us some way to get at the NativeCall # representation. my class native_callsite is repr('NativeCall') { } # Maps a chosen string encoding to a type recognized by the native call engine. sub string_encoding_to_nci_type(\encoding) { my str $enc = encoding; nqp::iseq_s($enc,"utf8") ?? "utf8str" !! nqp::iseq_s($enc,"ascii") ?? "asciistr" !! nqp::iseq_s($enc,"utf16") ?? "utf16str" !! die "Unknown string encoding for native call: $enc" } # Builds a hash of type information for the specified parameter. sub param_hash_for(Parameter $p) { my Mu $result := nqp::hash(); my $type := $p.type(); nqp::bindkey($result, 'typeobj', nqp::decont($type)); nqp::bindkey($result, 'rw', nqp::unbox_i(1)) if $p.rw; if $type ~~ Str { my $enc := $p.?native_call_encoded() || 'utf8'; nqp::bindkey($result, 'type', nqp::unbox_s(string_encoding_to_nci_type($enc))); nqp::bindkey($result, 'free_str', nqp::unbox_i(1)); } elsif $type ~~ Callable { nqp::bindkey($result, 'type', nqp::unbox_s(type_code_for($type))); my $info := param_list_for($p.sub_signature); nqp::unshift($info, return_hash_for($p.sub_signature, :with-typeobj)); nqp::bindkey($result, 'callback_args', $info); } else { nqp::bindkey($result, 'type', nqp::unbox_s(type_code_for($type))); } $result } # Builds the list of parameter information for a callback argument. sub param_list_for(Signature $sig, &r?) { my $params := nqp::getattr($sig.params,List,'$!reified'); my int $elems = nqp::elems($params); # not sending Method's default slurpy *%_ (which is always last) --$elems if nqp::istype(&r,Method) && nqp::iseq_s(nqp::atpos($params,$elems - 1).name,'%_'); # build list my $result := nqp::setelems(nqp::list,$elems); my int $i = -1; nqp::bindpos($result,$i, param_hash_for(nqp::atpos($params,$i)) ) while nqp::islt_i($i = nqp::add_i($i,1),$elems); $result } # Builds a hash of type information for the specified return type. sub return_hash_for(Signature $s, &r?, :$with-typeobj, :$entry-point) { my Mu $result := nqp::hash(); my $returns := $s.returns; nqp::bindkey($result, 'typeobj', nqp::decont($returns)) if $with-typeobj; nqp::bindkey($result, 'entry_point', nqp::decont($entry-point)) if $entry-point; if $returns ~~ Str { my $enc := &r.?native_call_encoded() || 'utf8'; nqp::bindkey($result, 'type', nqp::unbox_s(string_encoding_to_nci_type($enc))); nqp::bindkey($result, 'free_str', nqp::unbox_i(0)); } # TODO: If we ever want to handle function pointers returned from C, this # bit of code needs to handle that. else { nqp::bindkey($result, 'type', $returns =:= Mu ?? 'void' !! nqp::unbox_s(type_code_for($returns))); } $result } my $signed_ints_by_size := nqp::list_s( "", "char", "short", "", "int", "", "", "", "longlong" ); # Gets the NCI type code to use based on a given Perl 6 type. my $type_map := nqp::hash( "Bool", nqp::atpos_s($signed_ints_by_size,nativesizeof(bool)), "bool", nqp::atpos_s($signed_ints_by_size,nativesizeof(bool)), "Callable", "callback", "Int", "longlong", "int", "long", "int16", "short", "int32", "int", "int64", "longlong", "int8", "char", "long", "long", "longdouble", "longdouble", "longlong", "longlong", "Num", "double", "num", "double", "num32", "float", "num64", "double", "size_t", nqp::atpos_s($signed_ints_by_size,nativesizeof(size_t)), "ssize_t", nqp::atpos_s($signed_ints_by_size,nativesizeof(ssize_t)), "uint", "ulong", "uint16", "ushort", "uint32", "uint", "uint64", "ulonglong", "uint8", "uchar", "ulong", "ulong", "ulonglong", "ulonglong", ); sub type_code_for(Mu ::T) { if nqp::atkey($type_map,T.^shortname) -> $type { $type } elsif nqp::atkey($repr_map,T.REPR) -> $type { $type } # the REPR of a Buf or Blob type object is Uninstantiable, so # needs an extra special case here that isn't covered in the # hash lookup above. elsif nqp::istype(T,Blob) { "vmarray" } elsif nqp::istype(T,Pointer) { "cpointer" } else { die "Unknown type {T.^name} used in native call.\n" ~ "If you want to pass a struct, be sure to use the CStruct or\n" ~ "CPPStruct representation.\n" ~ "If you want to pass an array, be sure to use the CArray type."; } } sub gen_native_symbol(Routine $r, :$cpp-name-mangler) { if ! $r.?native_call_mangled { # Native symbol or name is said to be already mangled $r.?native_symbol // $r.name; } elsif $r.package.REPR eq 'CPPStruct' { # Mangle C++ classes $cpp-name-mangler($r, $r.?native_symbol // ($r.package.^name ~ '::' ~ $r.name)); } else { # Mangle C $cpp-name-mangler($r, $r.?native_symbol // $r.name) } } multi sub map_return_type(Mu $type) { Mu } multi sub map_return_type($type) { nqp::istype($type, Int) ?? Int !! nqp::istype($type, Num) ?? Num !! $type; } my role NativeCallSymbol[Str $name] { method native_symbol() { $name } } sub guess_library_name($lib) is export(:TEST) { my $libname; my $apiversion = ''; my Str $ext = ''; given $lib { when IO::Path { $libname = $lib.absolute; } when Distribution::Resource { return $lib.platform-library-name.Str; } when Callable { return $lib(); } when List { $libname = $lib[0]; $apiversion = $lib[1]; } when Str { $libname = $lib; } } return '' unless $libname.DEFINITE; #Already a full name? return $libname if ($libname ~~ /\.<.alpha>+$/ or $libname ~~ /\.so(\.<.digit>+)+$/); return $*VM.platform-library-name($libname.IO, :version($apiversion || Version)).Str; } my %lib; my @cpp-name-mangler = &NativeCall::Compiler::MSVC::mangle_cpp_symbol, &NativeCall::Compiler::GNU::mangle_cpp_symbol, ; sub guess-name-mangler(Routine $r, Str $libname) { if $r.package.REPR eq 'CPPStruct' { my $sym = $r.?native_symbol // ($r.package.^name ~ '::' ~ $r.name); for @cpp-name-mangler -> &mangler { return &mangler if try cglobal($libname, mangler($r, $sym), Pointer) } die "Don't know how to mangle symbol '$sym' for library '$libname'" } elsif $r.?native_call_mangled { my $sym = $r.?native_symbol // $r.name; for @cpp-name-mangler -> &mangler { return &mangler if try cglobal($libname, mangler($r, $sym), Pointer) } die "Don't know how to mangle symbol '$sym' for library '$libname'" } } my Lock $setup-lock .= new; # This role is mixed in to any routine that is marked as being a # native call. our role Native[Routine $r, $libname where Str|Callable|List|IO::Path|Distribution::Resource] { has int $!setup; has int $!precomp-setup; has native_callsite $!call is box_target; has Mu $!rettype; has $!cpp-name-mangler; has Pointer $!entry-point; has int $!arity; has int8 $!is-clone; has int8 $!any-optionals; has Mu $!optimized-body; has Mu $!jit-optimized-body; method !setup() { $setup-lock.protect: { return if $!setup || $*W && $*W.is_precompilation_mode && $!precomp-setup; # Make sure that C++ methods are treated as mangled (unless set otherwise) if self.package.REPR eq 'CPPStruct' and not self.does(NativeCallMangled) { self does NativeCallMangled[True]; } my $guessed_libname = guess_library_name($libname); if self.does(NativeCallMangled) and $r.?native_call_mangled { # if needed, try to guess mangler $!cpp-name-mangler = %lib{$guessed_libname} // (%lib{$guessed_libname} = guess-name-mangler($r, $guessed_libname)); } my Mu $arg_info := param_list_for($r.signature, $r); my $conv = self.?native_call_convention || ''; my $jitted = nqp::buildnativecall(self, nqp::unbox_s($guessed_libname), # library name nqp::unbox_s(gen_native_symbol($r, :$!cpp-name-mangler)), # symbol to call nqp::unbox_s($conv), # calling convention $arg_info, return_hash_for($r.signature, $r, :$!entry-point)); $!rettype := nqp::decont(map_return_type($r.returns)) unless $!rettype; $!arity = $r.signature.arity; ($*W && $*W.is_precompilation_mode ?? $!precomp-setup !! $!setup) = $jitted ?? 2 !! 1; $!any-optionals = self!any-optionals; my $body := $jitted ?? $!jit-optimized-body !! $!optimized-body; if $body { nqp::bindattr( self, Code, '$!do', nqp::getattr(nqp::hllizefor($body, 'perl6'), ForeignCode, '$!do') ); nqp::setinvokespec(self, Code.HOW.invocation_attr_class(Code), Code.HOW.invocation_attr_name(Code), nqp::null()); } } } method !any-optionals() { for $r.signature.params -> $p { return True if $p.optional } return False } method !decont-for-type($type) { $type ~~ Str ?? 'decont_s' !! $type ~~ Int ?? 'decont_i' !! $type ~~ Num ?? 'decont_n' !! 'decont'; } method !create-jit-compiled-function-body(Routine $r) { my $block := QAST::Block.new(:name($r.name), :arity($!arity), :blocktype('declaration_static')); my $locals = 0; my $args = 0; my (@params, @assigns); for $r.signature.params { next if nqp::istype($r, Method) && ($_.name // '') eq '%_'; $args++; my $name = $_.name || '__anonymous_param__' ~ $++; my $lowered_param_name = '__lowered_param__' ~ $locals; my $lowered_name = '__lowered__' ~ $locals++; $block.push: QAST::Var.new( :name($lowered_name), :scope, :decl, :returns( $_.type ~~ Str ?? nqp::bootstr() !! $_.type ~~ Int ?? nqp::bootint() !! $_.type ~~ Num ?? nqp::bootnum() !! $_.type ), ); @params.push: QAST::Var.new(:scope, :name($lowered_name)); $block.push: QAST::Var.new( :name($lowered_param_name), :scope, :decl, :slurpy($_.slurpy ?? 1 !! 0), ); if $_.rw and nqp::objprimspec($_.type) > 0 { $block.push: QAST::Var.new( :name($name), :scope, :decl, :returns($_.type), ); $block.push: QAST::Op.new( :op, QAST::Var.new(:scope, :name($name)), QAST::Var.new(:scope, :name($lowered_param_name)), ); } $block.push: QAST::Op.new( :op, QAST::Op.new( :op, QAST::Var.new(:scope, :name($lowered_param_name)), ), QAST::Op.new( :op, QAST::Var.new(:scope, :name($lowered_name)), QAST::Op.new( :op(self!decont-for-type($_.type)), QAST::Var.new(:scope, :name($lowered_param_name)), ), ), QAST::Op.new( :op, QAST::Var.new(:scope, :name($lowered_name)), $_.type ~~ Str ?? Str !! $_.type ~~ Int ?? QAST::IVal.new(:value(0)) !! $_.type ~~ Num ?? QAST::NVal.new(:value(0)) !! QAST::IVal.new(:value(0)) ), ); if $_.rw and nqp::objprimspec($_.type) > 0 { @assigns.push: QAST::Op.new( :op, QAST::Var.new(:scope, :name($name)), QAST::Op.new(:op, QAST::IVal.new(:value($args - 1))), ); } } $!rettype := nqp::decont(map_return_type($r.returns)) unless $!rettype; my $invoke_op := QAST::Op.new( :op, QAST::WVal.new(:value(self)), QAST::WVal.new(:value($!rettype)), ); $invoke_op.push: nqp::decont($_) for @params; if @assigns { $block.push: QAST::Op.new( :op, QAST::Var.new( :name, :scope, :decl, ), $invoke_op ); $block.push: nqp::decont($_) for @assigns; $block.push: QAST::Var.new(:name, :scope); } else { $block.push: $invoke_op; } $block } method !create-function-body(Routine $r) { my $block := QAST::Block.new(:name($r.name), :arity($!arity), :blocktype('declaration_static')); my $arglist := QAST::Op.new(:op); my $locals = 0; for $r.signature.params { next if nqp::istype($r, Method) && ($_.name // '') eq '%_'; my $name = $_.name || '__anonymous_param__' ~ $++; my $decont = self!decont-for-type($_.type); if $_.rw and nqp::objprimspec($_.type) > 0 { $block.push: QAST::Var.new( :name($name), :scope, :decl, :returns($_.type), ); my $lowered_name = '__lowered_param__' ~ $locals++; $block.push: QAST::Var.new( :name($lowered_name), :scope, :decl, QAST::Op.new( :op, QAST::Var.new(:scope, :name($name)), QAST::Var.new(:scope, :name($lowered_name)), ), ); $arglist.push: QAST::Var.new(:scope, :name($name)); } else { my $lowered_name = '__lowered__' ~ $locals++; $block.push: QAST::Var.new( :name($lowered_name), :scope, :decl, :slurpy($_.slurpy ?? 1 !! 0), ); $block.push: QAST::Op.new( :op, QAST::Var.new(:scope, :name($lowered_name)), QAST::Op.new( :op, QAST::Op.new( :op, QAST::Var.new(:scope, :name($lowered_name)), ), QAST::Op.new( :op(self!decont-for-type($_.type)), QAST::Var.new(:scope, :name($lowered_name)), ), QAST::Var.new(:scope, :name($lowered_name)), ), ); $arglist.push: QAST::Var.new(:scope, :name($lowered_name)); } } $!rettype := nqp::decont(map_return_type($r.returns)) unless $!rettype; $block.push: QAST::Op.new( :op, QAST::WVal.new(:value($!rettype)), QAST::WVal.new(:value(self)), $arglist, ); $block } method !compile-function-body(Mu $block) { my $perl6comp := nqp::getcomp("perl6"); my @stages = $perl6comp.stages; Nil until @stages.shift eq 'optimize'; my $result := $block; $result := $perl6comp.^can($_) ?? $perl6comp."$_"($result) !! $perl6comp.backend."$_"($result) for @stages; my $body := nqp::compunitmainline($result); $*W.add_object($body) if $*W; nqp::setcodename($body, $r.name); $body } method create-optimized-call() { unless $!optimized-body { $setup-lock.protect: { unless nqp::defined(nqp::getobjsc(self)) { if $*W { $*W.add_object(self); } else { my $sc := nqp::createsc('NativeCallSub' ~ nqp::objectid(self)); nqp::setobjsc(self, $sc); my int $idx = nqp::scobjcount($sc); nqp::scsetobj($sc, $idx, self); } } my $optimized-body := self!create-function-body($r); $optimized-body.annotate('code_object', self); $optimized-body.code_object(self); my $stub := nqp::freshcoderef(nqp::getattr(sub (*@args, *%named) { die "stub called" }, Code, '$!do')); nqp::setcodename($stub, self.name); nqp::markcodestatic($stub); nqp::markcodestub($stub); nqp::bindattr(self, $?CLASS, '$!optimized-body', $stub); my $jit-optimized-body := self!create-jit-compiled-function-body($r); $jit-optimized-body.annotate('code_object', self); $jit-optimized-body.code_object(self); nqp::bindattr(self, $?CLASS, '$!jit-optimized-body', $stub); my $fixups := QAST::Stmts.new(); my $des := QAST::Stmts.new(); if $*W { $*W.add_root_code_ref($stub, $optimized-body); $*W.add_root_code_ref($stub, $jit-optimized-body); $*W.add_object($?CLASS); $*UNIT.push($optimized-body); $*UNIT.push($jit-optimized-body); $fixups.push($*W.set_attribute(self, $?CLASS, '$!optimized-body', QAST::BVal.new( :value($optimized-body) ))); $fixups.push($*W.set_attribute(self, $?CLASS, '$!jit-optimized-body', QAST::BVal.new( :value($jit-optimized-body) ))); $*W.add_fixup_task(:deserialize_ast($fixups), :fixup_ast($fixups)); } else { $!optimized-body := self!compile-function-body(self!create-function-body($r)); $!jit-optimized-body := self!compile-function-body(self!create-jit-compiled-function-body($r)); } } } } method clone() { my $clone := callsame; nqp::bindattr_i($clone, $?CLASS, '$!is-clone', 1); nqp::bindattr($clone, $?CLASS, '$!optimized-body', Mu); nqp::bindattr($clone, $?CLASS, '$!jit-optimized-body', Mu); $clone } method CALL-ME(|args) { self.create-optimized-call() unless $!is-clone # Clones and original would share the invokespec but not the $!do attribute or $!any-optionals # the compiled code doesn't support optional parameters yet or $*W; # Avoid issues with compiling specialized version during BEGIN time self!setup(); my Mu $args := nqp::getattr(nqp::decont(args), Capture, '@!list'); if nqp::elems($args) != $!arity { X::TypeCheck::Argument.new( :objname($.name), :arguments(args.list.map(*.^name)) :signature(try $r.signature.gist), ).throw } nqp::nativecall($!rettype, self, $args) } } multi sub postcircumfix:<[ ]>(CArray:D \array, $pos) is export(:DEFAULT, :types) { $pos ~~ Iterable ?? $pos.map: { array.AT-POS($_) } !! array.AT-POS($pos); } multi sub postcircumfix:<[ ]>(CArray:D \array, *@pos) is export(:DEFAULT, :types) { @pos.map: { array.AT-POS($_) }; } multi trait_mod:(Routine $r, :$symbol!) is export(:DEFAULT, :traits) { $r does NativeCallSymbol[$symbol]; } # Specifies the calling convention to use for a native call. multi trait_mod:(Routine $r, :$nativeconv!) is export(:DEFAULT, :traits) { $r does NativeCallingConvention[$nativeconv]; } # Ways to specify how to marshall strings. multi trait_mod:(Parameter $p, :$encoded!) is export(:DEFAULT, :traits) { $p does NativeCallEncoded[$encoded]; } multi trait_mod:(Routine $p, :$encoded!) is export(:DEFAULT, :traits) { $p does NativeCallEncoded[$encoded]; } multi trait_mod:(Routine $p, :$mangled!) is export(:DEFAULT, :traits) { $p does NativeCallMangled[$mangled === True ?? 'C++' !! $mangled]; } role ExplicitlyManagedString { has $.cstr is rw; } multi explicitly-manage(Str $x, :$encoding = 'utf8') is export(:DEFAULT, :utils) { $x does ExplicitlyManagedString; my $class = class CStr is repr('CStr') { method encoding() { $encoding; } }; $x.cstr = nqp::box_s(nqp::unbox_s($x), nqp::decont($class)); } role CPPConst { method cpp-const() { 1 } } multi trait_mod:(Parameter $p, :$cpp-const!) is export(:DEFAULT, :traits) { $p does CPPConst; } role CPPRef { method cpp-ref() { 1 } } multi trait_mod:(Parameter $p, :$cpp-ref!) is export(:DEFAULT, :traits) { $p does CPPRef; } multi refresh($obj) is export(:DEFAULT, :utils) { nqp::nativecallrefresh($obj); 1; } multi sub nativecast(Signature $target-type, $source) is export(:DEFAULT) { my $r := sub { }; $r does Native[$r, Str]; nqp::bindattr($r, Code, '$!signature', nqp::decont($target-type)); nqp::bindattr($r, $r.WHAT, '$!entry-point', $source); $r } multi sub nativecast(Int $target-type, $source) is export(:DEFAULT) { nqp::nativecallcast(nqp::decont($target-type), Int, nqp::decont($source)); } multi sub nativecast(Num $target-type, $source) is export(:DEFAULT) { nqp::nativecallcast(nqp::decont($target-type), Num, nqp::decont($source)); } multi sub nativecast($target-type, $source) is export(:DEFAULT) { nqp::nativecallcast(nqp::decont($target-type), nqp::decont($target-type), nqp::decont($source)); } sub nativesizeof($obj) is export(:DEFAULT) { nqp::nativecallsizeof($obj) } sub cglobal($libname, $symbol, $target-type) is export is rw { Proxy.new( FETCH => -> $ { nqp::nativecallglobal( nqp::unbox_s(guess_library_name($libname)), nqp::unbox_s($symbol), nqp::decont($target-type), nqp::decont(map_return_type($target-type))) }, STORE => -> | { die "Writing to C globals NYI" } ) } } sub check_routine_sanity(Routine $r) is export(:TEST) { #Maybe this should use the hash already existing? sub validnctype (Mu ::T) { return True if nqp::existskey($repr_map,T.REPR) && T.REPR ne 'CArray' | 'CPointer'; return True if T.^name eq 'Str' | 'str' | 'Bool'; return False if T.REPR eq 'P6opaque'; return False if T.HOW.^can("nativesize") && !nqp::defined(T.^nativesize); #to disting int and int32 for example return validnctype(T.of) if T.REPR eq 'CArray' | 'CPointer' and T.^can('of'); return True; } my $sig = $r.signature; for @($sig.params).kv -> $i, $param { next if $r ~~ Method and ($i < 1 or $i == $sig.params.elems - 1); #Method have two extra parameters if $param.type ~~ Callable { # We probably want to check the given routine type too here. but I don't know how next; } next unless $param.type ~~ Buf | Blob #Buf are Uninstantiable, make this buggy || $param.type.^can('gist'); #FIXME, it's to handle case of class A { sub foo(A) is native) }, the type is not complete if !validnctype($param.type) { warn "In '{$r.name}' routine declaration - Not an accepted NativeCall type" ~ " for parameter [{$i + 1}] {$param.name ?? $param.name !! ''} : {$param.type.^name}\n" ~ " --> For Numerical type, use the appropriate int32/int64/num64..."; } } return True if $r.returns.REPR eq 'CPointer' | 'CStruct' | 'CPPStruct'; #Meh fix but 'imcomplete' type are a pain if $r.returns.^name ne 'Mu' && !validnctype($r.returns) { warn "The returning type of '{$r.name}' --> {$r.returns.^name} is erroneous." ~ " You should not return a non NativeCall supported type (like Int inplace of int32)," ~ " truncating errors can appear with different architectures"; } } sub EXPORT(|) { my @routines_to_setup; if $*W { my $block := { for @routines_to_setup { .create-optimized-call; CATCH { default { note $_ } } } }; $*W.add_object($block); my $op := $*W.add_phaser(Mu, 'CHECK', $block, class :: { method cuid { (^2**128).pick }}); } # Specifies that the routine is actually a native call, into the # current executable (platform specific) or into a named library my $native_trait := multi trait_mod:(Routine $r, :$native!) { check_routine_sanity($r); $r does NativeCall::Native[$r, $native === True ?? Str !! $native]; @routines_to_setup.push: $r; }; Map.new( '&trait_mod:' => $native_trait.dispatcher, ); } # vim:ft=perl6 rakudo-2018.03/lib/NativeCall/Types.pm60000644000175000017500000002065013253717231016147 0ustar alexalexuse 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 unsigned is repr("P6int") { }; our native ssize_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') { method of() { void } multi method new() { self.CREATE() } multi method new(int $addr) { nqp::box_i($addr, ::?CLASS) } multi method new(Int $addr) { nqp::box_i(nqp::unbox_i(nqp::decont($addr)), ::?CLASS) } method Numeric(::?CLASS:D:) { self.Int } method Int(::?CLASS:D:) { nqp::p6box_i(nqp::unbox_i(nqp::decont(self))) } proto method Bool() {*} multi method Bool(::?CLASS:U: --> False) { } multi method Bool(::?CLASS:D:) { so self.Int } method deref(::?CLASS:D \ptr:) { self ?? nativecast(void, ptr) !! fail("Can't dereference a Null Pointer") } multi method gist(::?CLASS:U:) { '(' ~ self.^name ~ ')' } multi method gist(::?CLASS:D:) { if self.Int -> $addr { self.^name ~ '<' ~ $addr.fmt('%#x') ~ '>' } else { self.^name ~ '' } } multi method perl(::?CLASS:U:) { self.^name } multi method perl(::?CLASS:D:) { self.^name ~ '.new(' ~ self.Int ~ ')' } my role TypedPointer[::TValue] { method of() { TValue } method deref(::?CLASS:D \ptr:) { self ?? nativecast(TValue, ptr) !! fail("Can't dereference a Null Pointer"); } method add(Int $off) returns Pointer { die "Can't do arithmetic with a void pointer" if TValue.isa(void); nqp::box_i(self.Int + nqp::nativecallsizeof(TValue) * $off, self.WHAT); } method succ { self.add(1); } method pred { self.add(-1); } method AT-POS(Int $pos) { nqp::nativecallcast( TValue, nqp::istype(TValue, Int) ?? Int !! nqp::istype(TValue, Num) ?? Num !! TValue, nqp::box_i(nqp::unbox_i(nqp::decont(self)) + nqp::nativecallsizeof(TValue) * $pos, Pointer) ) } } method ^parameterize(Mu:U \p, Mu:U \t) { die "A typed pointer can only hold:\n" ~ " (u)int8, (u)int16, (u)int32, (u)int64, (u)long, (u)longlong, num16, num32, (s)size_t, bool, Str\n" ~ " and types with representation: CArray, CPointer, CStruct, CPPStruct and CUnion" ~ "not: {t.^name}" unless t ~~ Int|Num|Bool || t === Str|void || t.REPR eq any ; 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) { method AT-POS(CArray:D: $pos) { die "CArray cannot be used without a type" } my role IntTypedCArray[::TValue] does Positional[TValue] is array_type(TValue) { multi method AT-POS(::?CLASS:D \arr: $pos) is raw { nqp::atposref_i(nqp::decont(arr), $pos); } multi method AT-POS(::?CLASS:D \arr: int $pos) is raw { nqp::atposref_i(nqp::decont(arr), $pos); } multi method ASSIGN-POS(::?CLASS:D \arr: int $pos, int $assignee) { nqp::bindpos_i(nqp::decont(arr), $pos, $assignee); } multi method ASSIGN-POS(::?CLASS:D \arr: Int $pos, int $assignee) { nqp::bindpos_i(nqp::decont(arr), nqp::unbox_i($pos), $assignee); } multi method ASSIGN-POS(::?CLASS:D \arr: Int $pos, Int $assignee) { nqp::bindpos_i(nqp::decont(arr), nqp::unbox_i($pos), nqp::unbox_i($assignee)); } multi method ASSIGN-POS(::?CLASS:D \arr: int $pos, Int $assignee) { nqp::bindpos_i(nqp::decont(arr), $pos, nqp::unbox_i($assignee)); } } my role NumTypedCArray[::TValue] does Positional[TValue] is array_type(TValue) { multi method AT-POS(::?CLASS:D \arr: $pos) is raw { nqp::atposref_n(nqp::decont(arr), $pos); } multi method AT-POS(::?CLASS:D \arr: int $pos) is raw { nqp::atposref_n(nqp::decont(arr), $pos); } multi method ASSIGN-POS(::?CLASS:D \arr: int $pos, num $assignee) { nqp::bindpos_n(nqp::decont(arr), $pos, $assignee); } multi method ASSIGN-POS(::?CLASS:D \arr: Int $pos, num $assignee) { nqp::bindpos_n(nqp::decont(arr), nqp::unbox_i($pos), $assignee); } multi method ASSIGN-POS(::?CLASS:D \arr: Int $pos, Num $assignee) { nqp::bindpos_n(nqp::decont(arr), nqp::unbox_i($pos), nqp::unbox_n($assignee)); } multi method ASSIGN-POS(::?CLASS:D \arr: int $pos, Num $assignee) { nqp::bindpos_n(nqp::decont(arr), $pos, nqp::unbox_n($assignee)); } } 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 () { nqp::atpos(nqp::decont(arr), nqp::unbox_i($pos.Int)) }, STORE => method ($v) { nqp::bindpos(nqp::decont(arr), nqp::unbox_i($pos.Int), nqp::decont($v)); self } } multi method AT-POS(::?CLASS:D \arr: int $pos) is rw { Proxy.new: FETCH => method () { nqp::atpos(nqp::decont(arr), $pos) }, STORE => method ($v) { nqp::bindpos(nqp::decont(arr), $pos, nqp::decont($v)); self } } multi method ASSIGN-POS(::?CLASS:D \arr: int $pos, \assignee) { nqp::bindpos(nqp::decont(arr), $pos, nqp::decont(assignee)); } multi method ASSIGN-POS(::?CLASS:D \arr: Int $pos, \assignee) { nqp::bindpos(nqp::decont(arr), nqp::unbox_i($pos), nqp::decont(assignee)); } } method ^parameterize(Mu:U \arr, Mu:U \t) { my $mixin; if t ~~ Int { $mixin := IntTypedCArray[t.WHAT]; } elsif t ~~ Num { $mixin := NumTypedCArray[t.WHAT]; } else { die "A C array can only hold:\n" ~ " (u)int8, (u)int16, (u)int32, (u)int64, (u)long, (u)longlong, num16, num32, (s)size_t, bool, Str\n" ~ " and types with representation: CArray, CPointer, CStruct, CPPStruct and CUnion\n" ~ "not: {t.^name}" unless t === Str || t.REPR eq 'CStruct' | 'CPPStruct' | 'CUnion' | 'CPointer' | 'CArray'; $mixin := TypedCArray[t]; } my $what := arr.^mixin: $mixin; $what.^set_name("{arr.^name}[{t.^name}]"); $what; } method elems { nqp::elems(self) } method list { do for ^self.elems { self.AT-POS($_) } } multi method new() { nqp::create(self) } multi method new(*@values) { self.new(@values) } multi method new(@values) { if @values.elems -> $n { my int $elems = $n - 1; my $result := nqp::create(self); # XXX setelems would be nice $result.ASSIGN-POS($elems,@values.AT-POS($elems)); # fake setelems my int $i = -1; nqp::while( nqp::islt_i(($i = nqp::add_i($i,1)),$elems), $result.ASSIGN-POS($i,@values.AT-POS($i)), ); $result } else { nqp::create(self) } } } # duplicated code from NativeCall.pm to support Pointer.deref multi sub map_return_type(Mu $type) { Mu } multi sub map_return_type($type) { nqp::istype($type, Int) ?? Int !! nqp::istype($type, Num) ?? Num !! $type; } rakudo-2018.03/lib/newline.pm60000644000175000017500000000025313253717231014457 0ustar alexalexpackage EXPORT::crlf { BEGIN OUR::<$?NL> := "\x0D\x0A" } package EXPORT::cr { BEGIN OUR::<$?NL> := "\x0D" } package EXPORT::lf { BEGIN OUR::<$?NL> := "\x0A" } rakudo-2018.03/lib/Pod/To/Text.pm60000644000175000017500000000752413253717231015056 0ustar alexalexunit class Pod::To::Text; method render($pod) { pod2text($pod) } my &colored = sub ($text, $) {$text } if %*ENV { (try require Terminal::ANSIColor <&colored>) !=== Nil and &OUTER::colored = &colored }; sub pod2text($pod) is export { given $pod { when Pod::Heading { heading2text($pod) } when Pod::Block::Code { code2text($pod) } when Pod::Block::Named { named2text($pod) } when Pod::Block::Para { twrap( $pod.contents.map({pod2text($_)}).join("") ) } when Pod::Block::Table { table2text($pod) } when Pod::Block::Declarator { declarator2text($pod) } when Pod::Item { item2text($pod).indent(2) } when Pod::FormattingCode { formatting2text($pod) } when Positional { .flat».&pod2text.grep(?*).join: "\n\n" } when Pod::Block::Comment { '' } when Pod::Config { '' } default { $pod.Str } } } sub heading2text($pod) { given $pod.level { when 1 { pod2text($pod.contents) } when 2 { ' ' ~ pod2text($pod.contents) } default { ' ' ~ pod2text($pod.contents) } } } sub code2text($pod) { $pod.contents>>.&pod2text.join.indent(4) } sub item2text($pod) { '* ' ~ pod2text($pod.contents).chomp.chomp } sub named2text($pod) { given $pod.name { when 'pod' { pod2text($pod.contents) } when 'para' { para2text($pod.contents[0]) } when 'defn' { pod2text($pod.contents[0]) ~ "\n" ~ pod2text($pod.contents[1..*-1]) } when 'config' { } when 'nested' { } default { $pod.name ~ "\n" ~ pod2text($pod.contents) } } } sub para2text($pod) { twine2text($pod.contents) } sub table2text($pod) { my @rows = $pod.contents; @rows.unshift($pod.headers.item) if $pod.headers; my @maxes; my $cols = [max] @rows.map({ .elems }); for ^$cols -> $i { @maxes.push([max] @rows.map({ $i < $_ ?? $_[$i].chars !! 0 })); } @maxes[*-1] = 0; # Don't pad last column with spaces my $ret; if $pod.config { $ret = $pod.config ~ "\n" } for @rows -> $row { # Gutter of two spaces between columns $ret ~= ' ' ~ join ' ', (@maxes Z=> @$row).map: { .value.fmt("%-{.key}s") }; $ret ~= "\n"; } $ret } sub declarator2text($pod) { next unless $pod.WHEREFORE.WHY; my $what = do given $pod.WHEREFORE { when Method { my @params=$_.signature.params[1..*]; @params.pop if @params.tail.name eq '%_'; 'method ' ~ $_.name ~ signature2text(@params) } when Sub { 'sub ' ~ $_.name ~ signature2text($_.signature.params) } when .HOW ~~ Metamodel::ClassHOW { 'class ' ~ $_.perl } when .HOW ~~ Metamodel::ModuleHOW { 'module ' ~ $_.perl } when .HOW ~~ Metamodel::PackageHOW { 'package ' ~ $_.perl } default { '' } } "$what\n{$pod.WHEREFORE.WHY.contents}" } sub signature2text($params) { $params.elems ?? "(\n\t" ~ $params.map(¶m2text).join("\n\t") ~ "\n)" !! "()"; } sub param2text($p) { $p.perl ~ ',' ~ ( $p.WHY ?? ' # ' ~ $p.WHY !! ' ') } my %formats = C => "bold", L => "underline", D => "underline", R => "inverse" ; sub formatting2text($pod) { my $text = $pod.contents>>.&pod2text.join; $pod.type ~~ %formats ?? colored($text, %formats{$pod.type}) !! $text } sub twine2text($_) { .map({ when Pod::Block { twine2text .contents }; .&pod2text }).join } sub twrap($text is copy, :$wrap=75 ) { $text ~~ s:g/(. ** {$wrap} <[\s]>*)\s+/$0\n/; $text } # vim: ft=perl6 rakudo-2018.03/lib/snapper.pm60000644000175000017500000000026613253717231014472 0ustar alexalex# shorthand for loading Telemetry and starting a snapper use Telemetry ; safe-ctrl-c; snapper( %*ENV // 0.1 ); # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/lib/Telemetry.pm60000644000175000017500000007075113253717231015002 0ustar alexalex# Provide an API for keeping track of a lot of system lifesigns use nqp; # the place where the default snaps are stored my $snaps := nqp::create(IterationBuffer); # Role for building instruments -------------------------- role Telemetry::Instrument { # Should return instantiated snap object method snap() is raw { ... } # Typically just Snap.new # Should return a list of lists with: # [0] name of the column, also used in headers and legends # [1] printf format of the column, *without* '%' prefix # [2] one line explanation of the column to be used in legend method formats() { ... } # Should a return a list of column names to be used by default method default-columns() { ... } # Returns sorted list of all columns names method columns() { self.formats.map( *[0] ).sort } } # Role for creating an instrument snap ------------- role Telemetry::Instrument::Snap does Associative { has Mu $!data; method data() is raw { $!data } multi method new(::?CLASS:) { nqp::p6bindattrinvres(nqp::create(self),self,'$!data',self!snap) } multi method new(::?CLASS:D: Mu \data) { # needed for creating a difference nqp::p6bindattrinvres( nqp::clone(self),::?CLASS,'$!data',nqp::decont(data)) } multi method new(::?CLASS: *@data) { # provided for .perl roundtripping my $data := nqp::list_i; nqp::push_i($data,$_) for @data; nqp::p6bindattrinvres(nqp::create(self),self,'$!data',$data) } multi method perl(::?CLASS:D:) { my $text := nqp::list_s; my int $elems = nqp::elems($!data); my int $i = -1; nqp::while( ++$i < $elems, nqp::push_s($text,nqp::atpos_i($!data,$i)) ); self.^name ~ '.new(' ~ nqp::join(',',$text) ~ ')' } # Should return a native-int like list with a sample method !snap() is raw { ... } # Needed for associative access: given a column name, return the value method AT-KEY($column) { ... } # Needed for associative access: given a column name, return whether exists method EXISTS-KEY($column) { ... } } # Telemetry data from wallclock and nqp::getrusage ----------------------------- class Telemetry::Instrument::Usage does Telemetry::Instrument { method formats() is raw { << cpu 8d 'The total amount of CPU used (in microseconds)' >>,<< cpu-sys 8d 'The amount of CPU used in system overhead (in microseconds)' >>,<< cpu-user 8d 'The amount of CPU used in user code (in microseconds)' >>,<< cpus 5.1f "The number of CPU's that were busy on average" >>,<< id-rss 8d 'Integral unshared data size (in Kbytes)' >>,<< inb 4d 'Number of block input operations' >>,<< invcsw 8d 'Number of involuntary context switches' >>,<< is-rss 8d 'Integral unshared stack size (in Kbytes)' >>,<< ix-rss 8d 'Integral shared text memory size (in Kbytes)' >>,<< majf 4d 'Number of page reclaims' >>,<< max-rss 8d 'Maximum resident set size (in Kbytes)' >>,<< minf 4d 'Number of page reclaims' >>,<< mrcv 4d 'Number of messages received' >>,<< msnd 4d 'Number of messages sent' >>,<< nsig 4d 'Number of signals received' >>,<< nswp 4d 'Number of swaps' >>,<< volcsw 6d 'Number of voluntary context switches' >>,<< outb 4d 'Number of block output operations' >>,<< util% 6.2f 'Percentage of CPU utilization (0..100%)' >>,<< wallclock 9d 'Number of microseconds elapsed' >> } method default-columns() { < wallclock util% max-rss > } method preamble($first, $last, $total, @snaps --> Str:D) { qq:to/HEADER/.chomp; Initial/Final Size: { $first } / { $last } Kbytes Total Time: { ($total / 1000000).fmt('%9.2f') } seconds Total CPU Usage: { ($total / 1000000).fmt('%9.2f') } seconds HEADER } # actual snapping logic class Snap does Telemetry::Instrument::Snap { # Helper stuff my int $start = nqp::fromnum_I(Rakudo::Internals.INITTIME * 1000000,Int); my int $cores = Kernel.cpu-cores; my $utilize = 100 / $cores; my int $b2kb = VM.osname eq 'darwin' ?? 10 !! 0; # Constants indexing into the data array my constant UTIME_SEC = 0; my constant UTIME_MSEC = 1; my constant STIME_SEC = 2; my constant STIME_MSEC = 3; my constant MAX_RSS = 4; my constant IX_RSS = 5; my constant ID_RSS = 6; my constant IS_RSS = 8; my constant MIN_FLT = 9; my constant MAJ_FLT = 10; my constant NSWAP = 11; my constant INBLOCK = 12; my constant OUTBLOCK = 13; my constant MSGSND = 14; my constant MSGRCV = 14; my constant NSIGNALS = 15; my constant NVCSW = 16; my constant INVCSW = 17; my constant WALLCLOCK = 18; # not actually part of nqp::getrusage # Initialize the dispatch hash using HLL features, as we only need to # do this on module load time. First handle the usable names of # attributes that are part of getrusage struct. my %dispatch = << "" "" "" "" # first 4 are special max-rss ix-rss id-rss is-rss minf majf nswp inb outb msnd mrcv nsig volcsw invcsw wallclock >>.kv.map: -> int $index, $name { if $name { $name => $name.ends-with('rss') && $b2kb ?? -> Mu \data { nqp::bitshiftr_i(nqp::atpos_i(data,$index),$b2kb) } !! -> Mu \data { nqp::atpos_i(data,$index) } } } # Allow for low-level dispatch hash access for speed my $dispatch := nqp::getattr(%dispatch,Map,'$!storage'); # Add the special cases to the dispatch %dispatch = -> Mu \data { nqp::atpos_i(data,UTIME_SEC) * 1000000 + nqp::atpos_i(data,UTIME_MSEC) + nqp::atpos_i(data,STIME_SEC) * 1000000 + nqp::atpos_i(data,STIME_MSEC) } %dispatch = -> Mu \data { nqp::atpos_i(data,UTIME_SEC) * 1000000 + nqp::atpos_i(data,UTIME_MSEC) } %dispatch = -> Mu \data { nqp::atpos_i(data,STIME_SEC) * 1000000 + nqp::atpos_i(data,STIME_MSEC) } %dispatch = -> Mu \data { (my int $wallclock = nqp::atpos_i(data,WALLCLOCK)) ?? (nqp::atkey($dispatch,'cpu')(data) / $wallclock) !! $cores } %dispatch = -> Mu \data { $utilize * nqp::atkey($dispatch,'cpus')(data) } method AT-KEY(Str:D $key) { nqp::ifnull( nqp::atkey($dispatch,$key), -> Mu \data { Nil } )($!data) } method EXISTS-KEY(Str:D $key) { nqp::p6bool(nqp::existskey($dispatch,$key)) } method !snap() is raw { nqp::stmts( nqp::bindpos_i( (my $data := nqp::getrusage), WALLCLOCK, nqp::sub_i(nqp::fromnum_I(nqp::time_n() * 1000000,Int),$start) ), $data ) } } method snap(--> Snap:D) { Snap.new } } # Telemetry data of starting Threads ------------------------------------------- class Telemetry::Instrument::Thread does Telemetry::Instrument { method formats() is raw { << tad 3d 'Number of threads that ended with an exception (aborted)' >>,<< tcd 3d 'Number of threads that completed without any problem' >>,<< thid 4d 'Highest OS thread ID seen' >>,<< tjd 3d 'Number of threads that were joined' >>,<< tsd 3d 'Number of threads that were started' >>,<< tys 4d 'Number of times a thread was yielded' >> } method default-columns() { < tsd tcd tad thid > } method preamble($first, $last, $total, @snaps --> Str:D) { qq:to/HEADER/.chomp; OS threads started: { ($last - $first).fmt('%4d') }{ " ($first started earlier)" if $first } HEADER } # actual snapping logic class Snap does Telemetry::Instrument::Snap { # Initialize the dispatch hash using HLL features, as we only need to # do this on module load time. Note that the order matters here! my %dispatch = .kv.map: -> int $index, $name { $name => -> Mu \data { nqp::atpos_i(data,$index) } } # Allow for low-level dispatch hash access for speed my $dispatch := nqp::getattr(%dispatch,Map,'$!storage'); method AT-KEY(Str:D $key) { nqp::ifnull( nqp::atkey($dispatch,$key), -> Mu \data { Nil } )($!data) } method EXISTS-KEY(Str:D $key) { nqp::p6bool(nqp::existskey($dispatch,$key)) } method !snap() is raw { Thread.usage } } method snap(--> Snap:D) { Snap.new } } # Telemetry data from the ThreadPoolScheduler ---------------------------------- class Telemetry::Instrument::ThreadPool does Telemetry::Instrument { method formats() is raw { << atc 8d 'The number of tasks completed in affinity threads' >>,<< atq 3d 'The number of tasks queued for execution in affinity threads' >>,<< aw 3d 'The number of affinity threads' >>,<< gtc 8d 'The number of tasks completed in general worker threads' >>,<< gtq 3d 'The number of tasks queued for execution in general worker threads' >>,<< gw 3d 'The number of general worker threads' >>,<< s 1d 'The number of supervisors' >>,<< ttc 8d 'The number of tasks completed in timer threads' >>,<< ttq 3d 'The number of tasks queued for execution in timer threads' >>,<< tw 3d 'The number of timer threads' >> } method default-columns() { < gw gtc tw ttc aw atc > } method preamble($first, $last, $total, @snaps --> Str:D) { my $text := nqp::list_s; if $first { nqp::push_s($text,"Supervisor thread ran the whole time"); } elsif !$last { nqp::push_s($text,"No supervisor thread has been running"); } else { my $started = @snaps.first: *.; nqp::push_s($text,"Supervisor thread ran for { (100 * ($last - $started) / $total).fmt("%5.2f") }% of the time"); } nqp::join("\n",$text) } # actual snapping logic class Snap does Telemetry::Instrument::Snap { # Initialize the dispatch hash using HLL features, as we only need to # do this on module load time. First handle the usable names of # attributes that are part of getrusage struct. my %dispatch = << s gw gtq gtc tw ttq ttc aw atq atc >>.kv.map: -> int $index, $name { $name => -> Mu \data { nqp::atpos_i(data,$index) } } # Allow for low-level dispatch hash access for speed my $dispatch := nqp::getattr(%dispatch,Map,'$!storage'); method AT-KEY(Str:D $key) { nqp::ifnull( nqp::atkey($dispatch,$key), -> Mu \data { Nil } )($!data) } method EXISTS-KEY(Str:D $key) { nqp::p6bool(nqp::existskey($dispatch,$key)) } method !snap() is raw { $*SCHEDULER ?? $*SCHEDULER.usage !! ThreadPoolScheduler.usage } } method snap(--> Snap:D) { Snap.new } } # Telemetry::Instrument::Adhoc ------------------------------------------------- class Telemetry::Instrument::AdHoc does Telemetry::Instrument { has @!formats; has @!columns; has Mu $!containers; has Mu $!dispatch; multi method new(::?CLASS: *@vars is raw, *%vars is raw) { nqp::create(self)!SET-SELF(@vars, %vars) } method !SET-SELF(\array, \hash) { $!containers := nqp::create(IterationBuffer); $!dispatch := nqp::create(Rakudo::Internals::IterationSet); for array { my int $index = nqp::elems($!containers); if nqp::istype($_,Pair) { my $variable := .value; die "Must specify a container" unless nqp::iscont($variable); my str $name = $variable.VAR.name.substr(1); @!formats.push([$name,"{4 max nqp::chars($name)}d",.key]); @!columns.push($name); nqp::bindpos($!containers,$index,$variable.VAR); nqp::bindkey($!dispatch,$name, -> Mu \data { nqp::atpos_i(data,$index) }); } else { die "Must specify a container" unless nqp::iscont($_); my str $name = .VAR.name; @!formats.push([$name,"{4 max nqp::chars($name)}d",""]); @!columns.push($name); nqp::bindpos($!containers,$index,$_); nqp::bindkey($!dispatch,$name, -> Mu \data { nqp::atpos_i(data,$index) }); } } self } method preamble($first, $, $, @ --> Str:D) { my $text := nqp::list_s; for @!columns -> $name { nqp::push_s($text, "Initial $name.tc(): ".fmt('%-17s') ~ $first{$name}.fmt('%9d') ); } nqp::join("\n",$text) } # actual snapping logic class Snap does Telemetry::Instrument::Snap { has Mu $!instrument; multi method new(::?CLASS: Telemetry::Instrument::AdHoc:D \instrument) { my $self := nqp::create(self); nqp::bindattr($self,::?CLASS,'$!instrument',instrument); nqp::p6bindattrinvres($self,::?CLASS,'$!data',$self!snap) } method AT-KEY(Str:D $key) { nqp::ifnull( nqp::atkey( nqp::getattr( $!instrument,Telemetry::Instrument::AdHoc,'$!dispatch'), $key ), -> Mu \data { Nil } )($!data) } method EXISTS-KEY(Str:D $key) { nqp::p6bool( nqp::existskey( nqp::getattr( $!instrument,Telemetry::Instrument::AdHoc,'$!dispatch'), $key ) ) } method !snap() { my $containers := nqp::getattr( $!instrument,Telemetry::Instrument::AdHoc,'$!containers'); my int $i = -1; my int $elems = nqp::elems($containers); my $data := nqp::setelems(nqp::list_i,$elems); nqp::while( nqp::islt_i(($i = nqp::add_i($i,1)),$elems), nqp::bindpos_i($data,$i,nqp::decont(nqp::atpos($containers,$i))) ); $data } } method formats() { @!formats } method default-columns() { @!columns } method snap(--> Snap:D) { Snap.new(self) } } # Telemetry::Sampler ----------------------------------------------------------- class Telemetry::Sampler { has $!instruments; has $!dispatcher; has $!formats; # helper sub for handling instruments specified with a Str sub Str-instrument($name) { (my $class := nqp::decont(Telemetry::Instrument::{$name})) =:= Any ?? die "Could not find Telemetry::Instrument::$name class" !! $class } method !set-up-instrument($instrument is copy --> Nil) { my $class = nqp::istype($instrument,Str) ?? Str-instrument($instrument) !! $instrument; my int $index = nqp::elems($!instruments); $!instruments.push($class); my constant KEY = 0; my constant FORMAT = 1; my constant LEGEND = 2; for $class.formats -> @info { my str $key = @info[KEY]; nqp::bindkey($!dispatcher,$key, -> Mu \samples { nqp::atpos(samples,$index).AT-KEY($key) }); nqp::bindkey($!formats,$key,@info); } } multi method new(Telemetry::Sampler:) { self.new([]) } multi method new(Telemetry::Sampler: Mu \instrument) { self.new(List.new(instrument)) } multi method new(Telemetry::Sampler: @spec) { my $self := nqp::create(self); nqp::bindattr($self,self,'$!instruments', nqp::create(IterationBuffer)); nqp::bindattr($self,self,'$!dispatcher', nqp::create(Rakudo::Internals::IterationSet)); nqp::bindattr($self,self,'$!formats', nqp::create(Rakudo::Internals::IterationSet)); # handle instrument specification if @spec { $self!set-up-instrument($_) for @spec; } # none specified, but we do have a default in the environment elsif %*ENV -> $rri { $self!set-up-instrument(Str-instrument($_)) for $rri.comb( /<[\w-]>+/ ); } # no instruments to be found anywhere, use the default default else { $self!set-up-instrument($_) for Telemetry::Instrument::Usage, Telemetry::Instrument::ThreadPool, ; } $self } method set-instruments(Telemetry::Sampler:D: *@instruments --> Nil) { nqp::bindattr(self,Telemetry::Sampler,'$!instruments', nqp::create(IterationBuffer)); nqp::bindattr(self,Telemetry::Sampler,'$!dispatcher', nqp::create(Rakudo::Internals::IterationSet)); nqp::bindattr(self,Telemetry::Sampler,'$!formats', nqp::create(Rakudo::Internals::IterationSet)); self!set-up-instrument($_) for @instruments; $snaps := nqp::create(IterationBuffer); } multi method perl(Telemetry::Sampler:D: --> Str:D) { self.^name ~ '.new(' ~ self.instruments.map(*.^name).join(",") ~ ')' } method instruments(Telemetry::Sampler:D:) { nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',$!instruments) } method formats(Telemetry::Sampler:D:) { nqp::p6bindattrinvres(nqp::create(Map),Map,'$!storage',$!formats) } } # Make sure we alwas have a Sampler INIT without $*SAMPLER { PROCESS::<$SAMPLER> := Telemetry::Sampler.new; } # Telemetry -------------------------------------------------------------------- class Telemetry does Associative { has $!sampler; has $!samples; multi method new(Telemetry:) { my $self := nqp::create(self); nqp::bindattr($self,self,'$!sampler', my $sampler := nqp::decont($*SAMPLER)); my $instruments := nqp::getattr($sampler,Telemetry::Sampler,'$!instruments'); my int $elems = nqp::elems($instruments); nqp::bindattr($self,self,'$!samples', my $samples := nqp::setelems(nqp::create(IterationBuffer),$elems)); my int $i = -1; nqp::while( ++$i < $elems, nqp::bindpos($samples,$i,nqp::atpos($instruments,$i).snap) ); $self } multi method new(Telemetry: *@samples) { # needed for .perl roundtripping my $self := nqp::create(self); nqp::bindattr($self,Telemetry,'$!sampler', my $sampler := nqp::decont($*SAMPLER)); nqp::bindattr($self,Telemetry,'$!samples', my $samples := nqp::create(IterationBuffer)); $samples.push($_) for @samples; $self } multi method perl(Telemetry:D: --> Str:D) { self.^name ~ ".new$!samples.perl()" } method sampler() { $!sampler } method samples() { nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',$!samples) } method AT-KEY($key) is raw { nqp::ifnull( nqp::atkey( nqp::getattr($!sampler,Telemetry::Sampler,'$!dispatcher'), $key ), -> Mu \samples { Nil } )($!samples) } method EXISTS-KEY($key) { nqp::p6bool( nqp::existskey( nqp::getattr($!sampler,Telemetry::Sampler,'$!dispatcher'), $key ) ) } method FALLBACK(Telemetry:D: $method) is raw { self.AT-KEY($method) // X::Method::NotFound.new(:$method,:typename(self.^name)).throw } } # Telemetry::Period ------------------------------------------------------------ class Telemetry::Period is Telemetry { # Same as Telemetry, but contains differences instead of absolute values } # Creating Telemetry::Period objects ------------------------------------------- multi sub infix:<->(Telemetry:U \a, Telemetry:U \b) is export { die "Cannot subtract Telemetry type objects"; } multi sub infix:<->( Telemetry:D \a, Telemetry:U \b --> Telemetry::Period:D) is export { a - b.new } multi sub infix:<->( Telemetry:U \a, Telemetry:D \b --> Telemetry::Period:D) is export { a.new - b } multi sub infix:<->( Telemetry:D \a, Telemetry:D \b --> Telemetry::Period) is export { my $a := nqp::decont(a); my $b := nqp::decont(b); my $period := nqp::create(Telemetry::Period); nqp::bindattr($period,Telemetry,'$!sampler', nqp::getattr($a,Telemetry,'$!sampler')); my \samples-a := nqp::getattr($a,Telemetry,'$!samples'); my \samples-b := nqp::getattr($b,Telemetry,'$!samples'); my int $elems = nqp::elems(samples-a); die "Different number of samples" if $elems != nqp::elems(samples-b); # create diff of rusage structs sub diff($a, $b) is raw { my Mu \data-a = nqp::decont($a.data); my Mu \data-b = nqp::decont($b.data); my Mu \data = nqp::clone(data-a); # make sure correct type my int $i = -1; my int $elems = nqp::elems(data); nqp::while( ++$i < $elems, nqp::bindpos_i(data,$i, nqp::sub_i(nqp::atpos_i(data-a,$i),nqp::atpos_i(data-b,$i)) ) ); $a.new(data) } nqp::bindattr($period,Telemetry,'$!samples', my \samples := nqp::setelems(nqp::create(IterationBuffer),$elems)); my int $i = -1; nqp::while( ++$i < $elems, nqp::bindpos(samples,$i,diff( nqp::atpos(samples-a,$i), nqp::atpos(samples-b,$i) )) ); $period } # Making a Telemetry object procedurally --------------------------------------- proto sub snap(|) is export {*} multi sub snap(--> Nil) { $snaps.push(Telemetry.new) } multi sub snap(@s --> Nil) { @s.push(Telemetry.new) } # Starting the snapper / changing the period size my int $snapper-running; my $snapper-wait; sub snapper($sleep = 0.1, :$stop, :$reset --> Nil) is export { $snapper-wait = $sleep; $snaps := nqp::create(IterationBuffer) if $reset; if $snapper-running { $snapper-running = 0 if $stop; } elsif !$stop { $snapper-running = 1; Thread.start(:app_lifetime, :name, { snap; while $snapper-running { sleep $snapper-wait; snap if $snapper-running; } }); } } # Telemetry::Period objects from a list of Telemetry objects ------------------- proto sub periods(|) is export {*} multi sub periods() { my $new := $snaps; $snaps := nqp::create(IterationBuffer); $new.push(Telemetry.new) if $new.elems == 1; periods(nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',$new)); } multi sub periods(@s) { (1..^@s).map: { @s[$_] - @s[$_ - 1] } } # Telemetry reporting features ------------------------------------------------- proto sub report(|) is export {*} multi sub report(*%_ --> Str:D) { report(nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',$snaps),|%_) } # some constants for the %format list my constant NAME = 0; # short name my constant FORMAT = 1; # format (without % prefixed) my constant LEGEND = 2; # legend my constant HEADER = 3; # generated: column header my constant FOOTER = 4; # generated: column footer my constant DISPLAY = 5; # generated: code to execute to display sub prepare-format(@raw, %format --> Nil) is raw { for @raw -> @info is copy { my str $name = @info[NAME]; my str $format = @info[FORMAT]; my int $width = $format; # natives have p5 semantics my str $empty = nqp::x(" ",$width); @info[HEADER] = $name.fmt("%{$width}s"); @info[FOOTER] = nqp::x("-",$width); @info[DISPLAY] = -> \value { value ?? value.fmt("%$format") !! $empty } %format{$name} = @info; } } multi sub report( @s, :@columns is copy, :$header-repeat is copy, :$legend is copy, :$csv is copy, :@format, --> Str:D ) { # set up basic header my $text := nqp::list_s(qq:to/HEADER/.chomp); Telemetry Report of Process #$*PID ({Instant.from-posix(nqp::time_i).DateTime}) Number of Snapshots: {+@s} HEADER # return that if there's nothing to tell otherwise return nqp::atpos_s($text,0) unless @s; # get the sampler that was used my $sampler := @s[0].sampler; # determine columns to be displayed unless @columns { if %*ENV -> $rrc { @columns = $rrc.comb( /<[\w%-]>+/ ); } else { @columns.append(.default-columns) for $sampler.instruments; } } # set header repeat flag without $header-repeat { $header-repeat = $_.Int with %*ENV // 32; } # set legend flag without $legend { $legend = $_.Int with %*ENV // 1; } # set csv flag without $csv { $csv = $_.Int with %*ENV // 0; } # get / calculate the format info we need my %format; if @format { prepare-format(@format, %format) } else { prepare-format(.formats, %format) for @s[0].sampler.instruments; } # some initializations my @periods = periods(@s); # only want CSV ready output if $csv { my @formats = %format{@columns}; nqp::push_s($text,%format{@columns}>>.[NAME].join(' ')); for @periods -> $period { nqp::push_s($text, @formats.map( -> @info { $period{@info[NAME]} }).join(' ') ) } } # standard text output else { my $first = @s[0]; my $last = @s[*-1]; my $total = $last - $first; # remove the columns that don't have any values @columns = @columns.grep: -> $column { @periods.first: { .{%format{$column}[NAME]} } }; my $header = "\n%format{@columns}>>.[HEADER].join(' ')"; my @formats = %format{@columns}; for $sampler.instruments -> \instrument { nqp::push_s($text,$_) with instrument.preamble: $first, $last, $total, @s; } sub push-period($period --> Nil) { nqp::push_s($text, @formats.map( -> @info { @info[DISPLAY]($period{@info[NAME]}) }).join(' ').trim-trailing ) } nqp::push_s($text,$header) unless $header-repeat; for @periods.kv -> $index, $period { nqp::push_s($text,$header) if $header-repeat && $index %% $header-repeat; push-period($period) } nqp::push_s($text,%format{@columns}>>.[FOOTER].join(' ')); push-period($total); if $legend { nqp::push_s($text,''); nqp::push_s($text,'Legend:'); for %format{@columns} -> $col { nqp::push_s($text,"$col[NAME].fmt("%9s") $col[LEGEND]"); } } } nqp::join("\n",$text) } # Allow for safe CTRL-c exit, always giving a report --------------------------- my int $has-safe-ctrl-c; sub safe-ctrl-c(--> Nil) is export { unless $has-safe-ctrl-c { signal(SIGINT).tap: &exit; $has-safe-ctrl-c = 1; } } # The special T functionality ----------------------------------------- sub T (--> Telemetry:D) is export { Telemetry.new } # Provide limited export capability -------------------------------------------- sub EXPORT(*@args) { (EXPORT::DEFAULT::{ @args.map: '&' ~ * }:p).Map } # Make sure we tell the world if we're implicitely told to do so --------------- END { $snapper-running = 0; # stop any snapper if $snaps.elems { snap; note report; } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/lib/Test.pm60000644000175000017500000006277613253717231013757 0ustar alexalexuse MONKEY-GUTS; # Allow NQP ops. unit module Test; # Copyright (C) 2007 - 2018 The Perl Foundation. # settable from outside my int $perl6_test_times = ?%*ENV; my int $die_on_fail = ?%*ENV; # global state my @vars; my $indents = ""; # variables to keep track of our tests my $subtest_callable_type; my int $num_of_tests_run; my int $num_of_tests_failed; my int $todo_upto_test_num; my $todo_reason; my $num_of_tests_planned; my int $no_plan; my num $time_before; my num $time_after; my int $subtest_level; my $subtest_todo_reason; my int $pseudo_fails; # number of untodoed failed tests inside a todoed subtest # Output should always go to real stdout/stderr, not to any dynamic overrides. my $output; my $failure_output; my $todo_output; ## If done-testing hasn't been run when we hit our END block, we need to know ## so that it can be run. This allows compatibility with old tests that use ## plans and don't call done-testing. my int $done_testing_has_been_run = 0; # make sure we have initializations _init_vars(); sub _init_io { nqp::setbuffersizefh(nqp::getstdout(), 0); nqp::setbuffersizefh(nqp::getstderr(), 0); $output = $PROCESS::OUT; $failure_output = $PROCESS::ERR; $todo_output = $PROCESS::OUT; } sub MONKEY-SEE-NO-EVAL() is export { 1 } ## test functions our sub output is rw { $output } our sub failure_output is rw { $failure_output } our sub todo_output is rw { $todo_output } multi sub plan (Cool:D :skip-all($reason)!) { _init_io() unless $output; $output.say: $indents ~ "1..0 # Skipped: $reason"; exit unless $subtest_level; # just exit if we're not in a subtest # but if we are, adjust the vars, so the output matches up with zero # planned tests, all passsing. Also, check the subtest's Callable is # something we can actually return from. $subtest_callable_type === Sub|Method or die "Must give `subtest` a (Sub) or a (Method) to be able to use " ~ "`skip-all` plan inside, but you gave a " ~ $subtest_callable_type.gist; $done_testing_has_been_run = 1; $num_of_tests_failed = $num_of_tests_planned = $num_of_tests_run = 0; nqp::throwpayloadlexcaller(nqp::const::CONTROL_RETURN, True); } # "plan 'no_plan';" is now "plan *;" # It is also the default if nobody calls plan at all multi sub plan($number_of_tests) is export { _init_io() unless $output; my str $str-message; if $number_of_tests ~~ ::Whatever { $no_plan = 1; } else { $num_of_tests_planned = $number_of_tests; $no_plan = 0; $str-message ~= $indents ~ '1..' ~ $number_of_tests; } # Get two successive timestamps to say how long it takes to read the # clock, and to let the first test timing work just like the rest. # These readings should be made with the expression now.to-posix[0], # but its execution time when tried in the following two lines is a # lot slower than the non portable nqp::time_n. $time_before = nqp::time_n; $time_after = nqp::time_n; $str-message ~= "\n$indents# between two timestamps " ~ ceiling(($time_after-$time_before)*1_000_000) ~ ' microseconds' if nqp::iseq_i($perl6_test_times,1); $output.say: $str-message; # Take one more reading to serve as the begin time of the first test $time_before = nqp::time_n; } multi sub pass($desc = '') is export { $time_after = nqp::time_n; proclaim(1, $desc); $time_before = nqp::time_n; } multi sub ok(Mu $cond, $desc = '') is export { $time_after = nqp::time_n; my $ok = proclaim($cond, $desc); $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub nok(Mu $cond, $desc = '') is export { $time_after = nqp::time_n; my $ok = proclaim(!$cond, $desc); $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub is(Mu $got, Mu:U $expected, $desc = '') is export { $time_after = nqp::time_n; my $ok; if $got.defined { # also hack to deal with Failures $ok = proclaim(False, $desc); _diag "expected: ($expected.^name())\n" ~ " got: '$got'"; } else { # infix:<===> can't handle Mu's my $test = nqp::eqaddr($expected.WHAT, Mu) ?? nqp::eqaddr($got.WHAT, Mu) !! nqp::eqaddr($got.WHAT, Mu) ?? False !! $got === $expected; $ok = proclaim($test, $desc); if !$test { _diag "expected: ($expected.^name())\n" ~ " got: ($got.^name())"; } } $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub is(Mu $got, Mu:D $expected, $desc = '') is export { $time_after = nqp::time_n; my $ok; if $got.defined { # also hack to deal with Failures # infix: can't handle Mu's my $test = nqp::eqaddr($expected.WHAT, Mu) ?? nqp::eqaddr($got.WHAT, Mu) !! nqp::eqaddr($got.WHAT, Mu) ?? False !! $got eq $expected; $ok = proclaim($test, $desc); if !$test { if try $got .Str.subst(/\s/, '', :g) eq $expected.Str.subst(/\s/, '', :g) { # only white space differs, so better show it to the user _diag "expected: $expected.perl()\n" ~ " got: $got.perl()"; } else { _diag "expected: '$expected'\n" ~ " got: '$got'"; } } } else { $ok = proclaim(False, $desc); _diag "expected: '$expected'\n" ~ " got: ($got.^name())"; } $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub isnt(Mu $got, Mu:U $expected, $desc = '') is export { $time_after = nqp::time_n; my $ok; if $got.defined { # also hack to deal with Failures $ok = proclaim(True, $desc); } else { my $test = $got !=== $expected; $ok = proclaim($test, $desc); if !$test { _diag "expected: anything except '$expected.perl()'\n" ~ " got: '$got.perl()'"; } } $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub isnt(Mu $got, Mu:D $expected, $desc = '') is export { $time_after = nqp::time_n; my $ok; if $got.defined { # also hack to deal with Failures my $test = $got ne $expected; $ok = proclaim($test, $desc); if !$test { _diag "expected: anything except '$expected.perl()'\n" ~ " got: '$got.perl()'"; } } else { $ok = proclaim(True, $desc); } $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub cmp-ok(Mu $got is raw, $op, Mu $expected is raw, $desc = '') is export { $time_after = nqp::time_n; $got.defined; # Hack to deal with Failures my $ok; # the three labeled &CALLERS below are as follows: # #1 handles ops that don't have '<' or '>' # #2 handles ops that don't have '«' or '»' # #3 handles all the rest by escaping '<' and '>' with backslashes. # Note: #3 doesn't eliminate #1, as #3 fails with '<' operator my $matcher = nqp::istype($op, Callable) ?? $op !! &CALLERS::("infix:<$op>") #1 // &CALLERS::("infix:«$op»") #2 // &CALLERS::("infix:<$op.subst(/]>>/, "\\", :g)>"); #3 if $matcher { $ok = proclaim($matcher($got,$expected), $desc); if !$ok { my $expected-desc = (try $expected.perl) // $expected.gist; my $got-desc = (try $got .perl) // $got .gist; _diag "expected: $expected-desc\n" ~ " matcher: '" ~ ($matcher.?name || $matcher.^name) ~ "'\n" ~ " got: $got-desc"; } } else { $ok = proclaim(False, $desc); _diag "Could not use '$op.perl()' as a comparator." ~ ( ' If you are trying to use a meta operator, pass it as a ' ~ "Callable instead of a string: \&[$op]" unless nqp::istype($op, Callable) ); } $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } sub bail-out ($desc?) is export { _init_io() unless $output; $output.put: join ' ', 'Bail out!', ($desc if $desc); $done_testing_has_been_run = 1; exit 255; } multi sub is_approx(Mu $got, Mu $expected, $desc = '') is export { DEPRECATED('is-approx'); # Remove for 6.d release $time_after = nqp::time_n; my $tol = $expected.abs < 1e-6 ?? 1e-5 !! $expected.abs * 1e-6; my $test = ($got - $expected).abs <= $tol; my $ok = proclaim($test, $desc); unless $test { _diag "expected: $expected\n" ~ "got: $got"; } $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } # We're picking and choosing which tolerance to use here, to make it easier # to test numbers close to zero, yet maintain relative tolerance elsewhere. # For example, relative tolerance works equally well with regular and huge, # but once we go down to zero, things break down: is-approx sin(τ), 0; would # fail, because the computed relative tolerance is 1. For such cases, absolute # tolerance is better suited, so we DWIM in the no-tol version of the sub. multi sub is-approx(Numeric $got, Numeric $expected, $desc = '') is export { $expected.abs < 1e-6 ?? is-approx-calculate($got, $expected, 1e-5, Nil, $desc) # abs-tol !! is-approx-calculate($got, $expected, Nil, 1e-6, $desc) # rel-tol } multi sub is-approx( Numeric $got, Numeric $expected, Numeric $abs-tol, $desc = '' ) is export { is-approx-calculate($got, $expected, $abs-tol, Nil, $desc); } multi sub is-approx( Numeric $got, Numeric $expected, $desc = '', Numeric :$rel-tol is required ) is export { is-approx-calculate($got, $expected, Nil, $rel-tol, $desc); } multi sub is-approx( Numeric $got, Numeric $expected, $desc = '', Numeric :$abs-tol is required ) is export { is-approx-calculate($got, $expected, $abs-tol, Nil, $desc); } multi sub is-approx( Numeric $got, Numeric $expected, $desc = '', Numeric :$rel-tol is required, Numeric :$abs-tol is required ) is export { is-approx-calculate($got, $expected, $abs-tol, $rel-tol, $desc); } sub is-approx-calculate ( $got, $expected, $abs-tol where { !.defined or $_ >= 0 }, $rel-tol where { !.defined or $_ >= 0 }, $desc, ) { $time_after = nqp::time_n; my Bool ($abs-tol-ok, $rel-tol-ok) = True, True; my Numeric ($abs-tol-got, $rel-tol-got); if $abs-tol.defined { $abs-tol-got = abs($got - $expected); $abs-tol-ok = $abs-tol-got <= $abs-tol; } if $rel-tol.defined { if max($got.abs, $expected.abs) -> $max { $rel-tol-got = abs($got - $expected) / $max; $rel-tol-ok = $rel-tol-got <= $rel-tol; } else { # if $max is zero, then both $got and $expected are zero # and so our relative difference is also zero $rel-tol-got = 0; } } my $ok = proclaim($abs-tol-ok && $rel-tol-ok, $desc); unless $ok { _diag " expected approximately: $expected\n" ~ " got: $got"; unless $abs-tol-ok { _diag "maximum absolute tolerance: $abs-tol\n" ~ "actual absolute difference: $abs-tol-got"; } unless $rel-tol-ok { _diag "maximum relative tolerance: $rel-tol\n" ~ "actual relative difference: $rel-tol-got"; } } $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub todo($reason, $count = 1) is export { $time_after = nqp::time_n; $todo_upto_test_num = $num_of_tests_run + $count; # Adding a space to not backslash the # TODO $todo_reason = " # TODO $reason"; $time_before = nqp::time_n; } multi sub skip() { $time_after = nqp::time_n; proclaim(1, '', "# SKIP"); $time_before = nqp::time_n; } multi sub skip($reason, $count = 1) is export { $time_after = nqp::time_n; die "skip() was passed a non-integer number of tests. Did you get the arguments backwards or use a non-integer number?" if $count !~~ Int; my $i = 1; while $i <= $count { proclaim(1, $reason, "# SKIP "); $i = $i + 1; } $time_before = nqp::time_n; } sub skip-rest($reason = '') is export { $time_after = nqp::time_n; die "A plan is required in order to use skip-rest" if nqp::iseq_i($no_plan,1); skip($reason, $num_of_tests_planned - $num_of_tests_run); $time_before = nqp::time_n; } multi sub subtest(Pair $what) is export { subtest($what.value,$what.key) } multi sub subtest($desc, &subtests) is export { subtest(&subtests,$desc) } multi sub subtest(&subtests, $desc = '') is export { my $parent_todo = $todo_reason || $subtest_todo_reason; _push_vars(); _init_vars(); $subtest_todo_reason = $parent_todo; $subtest_callable_type = &subtests.WHAT; $indents ~= " "; $subtest_level++; subtests(); $subtest_level--; done-testing() if nqp::iseq_i($done_testing_has_been_run,0); my $status = $num_of_tests_failed == 0 && $num_of_tests_planned == $num_of_tests_run && $pseudo_fails == 0; _pop_vars; $indents .= chop(4); proclaim($status,$desc) or ($die_on_fail and die-on-fail); } sub diag(Mu $message) is export { # Always send user-triggered diagnostics to STDERR. This prevents # cases of confusion of where diag() has to send its ouput when # we are in the middle of TODO tests _diag $message, :force-stderr; } sub _diag(Mu $message, :$force-stderr) { _init_io() unless $output; my $is_todo = !$force-stderr && ($subtest_todo_reason || $num_of_tests_run <= $todo_upto_test_num); my $out = $is_todo ?? $todo_output !! $failure_output; $time_after = nqp::time_n; my $str-message = nqp::join( "\n$indents# ", nqp::split("\n", "$indents# $message") ); $out.say: $str-message; $time_before = nqp::time_n; } # In earlier Perls, this is spelled "sub fail" multi sub flunk($reason) is export { $time_after = nqp::time_n; my $ok = proclaim(0, $reason); $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub isa-ok( Mu $var, Mu $type, $desc = "The object is-a '$type.perl()'" ) is export { $time_after = nqp::time_n; my $ok = proclaim($var.isa($type), $desc) or _diag('Actual type: ' ~ $var.^name); $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub does-ok( Mu $var, Mu $type, $desc = "The object does role '$type.perl()'" ) is export { $time_after = nqp::time_n; my $ok = proclaim($var.does($type), $desc) or _diag([~] 'Type: ', $var.^name, " doesn't do role ", $type.perl); $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub can-ok( Mu $var, Str $meth, $desc = ($var.defined ?? "An object of type '" !! "The type '") ~ "$var.WHAT.perl()' can do the method '$meth'" ) is export { $time_after = nqp::time_n; my $ok = proclaim($var.^can($meth), $desc); $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub like( Str() $got, Regex:D $expected, $desc = "text matches $expected.perl()" ) is export { $time_after = nqp::time_n; my $ok := proclaim $got ~~ $expected, $desc or _diag "expected a match with: $expected.perl()\n" ~ " got: $got.perl()"; $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub unlike( Str() $got, Regex:D $expected, $desc = "text does not match $expected.perl()" ) is export { $time_after = nqp::time_n; my $ok := proclaim !($got ~~ $expected), $desc or _diag "expected no match with: $expected.perl()\n" ~ " got: $got.perl()"; $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub use-ok(Str $code, $desc = "$code module can be use-d ok") is export { $time_after = nqp::time_n; try { EVAL ( "use $code" ); } my $ok = proclaim((not defined $!), $desc) or _diag($!); $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub dies-ok(Callable $code, $reason = '') is export { $time_after = nqp::time_n; my $death = 1; try { $code(); $death = 0; } my $ok = proclaim( $death, $reason ); $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub lives-ok(Callable $code, $reason = '') is export { $time_after = nqp::time_n; try { $code(); } my $ok = proclaim((not defined $!), $reason) or _diag($!); $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub eval-dies-ok(Str $code, $reason = '') is export { $time_after = nqp::time_n; my $ee = eval_exception($code); my $ok = proclaim( $ee.defined, $reason ); $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } multi sub eval-lives-ok(Str $code, $reason = '') is export { $time_after = nqp::time_n; my $ee = eval_exception($code); my $ok = proclaim((not defined $ee), $reason) or _diag("Error: $ee"); $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } ###################################################################### # The fact that is-deeply converts Seq args to Lists is actually a bug # that ended up being too-much-pain-for-little-gain to fix. Using Seqs # breaks ~65 tests in 6.c-errata and likely breaks a lot of module # tests as well. So... for the foreseeable future we decided to leave it # as is. If a user really wants to ensure Seq comparison, there's always # `cmp-ok` with `eqv` op. # https://irclog.perlgeek.de/perl6-dev/2017-05-04#i_14532363 ###################################################################### multi sub is-deeply(Seq:D $got, Seq:D $expected, $reason = '') is export { is-deeply $got.cache, $expected.cache, $reason; } multi sub is-deeply(Seq:D $got, Mu $expected, $reason = '') is export { is-deeply $got.cache, $expected, $reason; } multi sub is-deeply(Mu $got, Seq:D $expected, $reason = '') is export { is-deeply $got, $expected.cache, $reason; } multi sub is-deeply(Mu $got, Mu $expected, $reason = '') is export { $time_after = nqp::time_n; my $test = _is_deeply( $got, $expected ); my $ok = proclaim($test, $reason); if !$test { my $got_perl = try { $got.perl }; my $expected_perl = try { $expected.perl }; if $got_perl.defined && $expected_perl.defined { _diag "expected: $expected_perl\n" ~ " got: $got_perl"; } } $time_before = nqp::time_n; $ok or ($die_on_fail and die-on-fail) or $ok; } sub throws-like($code, $ex_type, $reason?, *%matcher) is export { subtest { plan 2 + %matcher.keys.elems; my $msg; if $code ~~ Callable { $msg = 'code dies'; $code() } else { $msg = "'$code' died"; EVAL $code, context => CALLER::CALLER::CALLER::CALLER::; } flunk $msg; skip 'Code did not die, can not check exception', 1 + %matcher.elems; CATCH { default { pass $msg; my $type_ok = $_ ~~ $ex_type; ok $type_ok , "right exception type ($ex_type.^name())"; if $type_ok { for %matcher.kv -> $k, $v { my $got is default(Nil) = $_."$k"(); my $ok = $got ~~ $v,; ok $ok, ".$k matches $v.gist()"; unless $ok { _diag "Expected: " ~ ($v ~~ Str ?? $v !! $v.perl) ~ "\nGot: $got"; } } } else { _diag "Expected: $ex_type.^name()\n" ~ "Got: $_.^name()\n" ~ "Exception message: $_.message()"; skip 'wrong exception type', %matcher.elems; } } } }, $reason // "did we throws-like $ex_type.^name()?"; } sub _is_deeply(Mu $got, Mu $expected) { $got eqv $expected; } ## 'private' subs sub die-on-fail { if !$todo_reason && !$subtest_level && nqp::iseq_i($die_on_fail,1) { _diag 'Test failed. Stopping test suite, because' ~ ' PERL6_TEST_DIE_ON_FAIL environmental variable is set' ~ ' to a true value.'; exit 255; } $todo_reason = '' if $todo_upto_test_num == $num_of_tests_run; False; } sub eval_exception($code) { try { EVAL ($code); } $!; } # Take $cond as Mu so we don't thread with Junctions: sub proclaim(Bool(Mu) $cond, $desc is copy, $unescaped-prefix = '') { _init_io() unless $output; # exclude the time spent in proclaim from the test time $num_of_tests_run = $num_of_tests_run + 1; my $tap = $indents; unless $cond { $tap ~= "not "; $num_of_tests_failed = $num_of_tests_failed + 1 unless $num_of_tests_run <= $todo_upto_test_num; $pseudo_fails = $pseudo_fails + 1 if $subtest_todo_reason; } # TAP parsers do not like '#' in the description, they'd miss the '# TODO' # So, adding a ' \' before it. $desc = $desc ?? nqp::join("\n$indents# ", # prefix newlines with `#` nqp::split("\n", nqp::join(' \\#', # escape `#` nqp::split('#', $desc.Str)))) !! ''; $tap ~= $todo_reason && $num_of_tests_run <= $todo_upto_test_num ?? "ok $num_of_tests_run - $unescaped-prefix$desc$todo_reason" !! (! $cond && $subtest_todo_reason) ?? "ok $num_of_tests_run - $unescaped-prefix$desc$subtest_todo_reason" !! "ok $num_of_tests_run - $unescaped-prefix$desc"; $tap ~= ("\n$indents# t=" ~ ceiling(($time_after - $time_before)*1_000_000)) if nqp::iseq_i($perl6_test_times,1); $output.say: $tap; unless $cond { my $caller; # sub proclaim is not called directly, so 2 is minimum level my int $level = 2; repeat until !$?FILE.ends-with($caller.file) { $caller = callframe($level++); } _diag $desc ?? "Failed test '$desc'\nat $caller.file() line $caller.line()" !! "Failed test at $caller.file() line $caller.line()"; } # must clear this between tests $todo_reason = '' if $todo_upto_test_num == $num_of_tests_run and nqp::iseq_i($die_on_fail,0); $cond } sub done-testing() is export { _init_io() unless $output; $done_testing_has_been_run = 1; if nqp::iseq_i($no_plan,1) { $num_of_tests_planned = $num_of_tests_run; $output.say: $indents ~ "1..$num_of_tests_planned"; } # Wrong quantity of tests _diag("Looks like you planned $num_of_tests_planned test" ~ ($num_of_tests_planned == 1 ?? '' !! 's') ~ ", but ran $num_of_tests_run" ) if ($num_of_tests_planned or $num_of_tests_run) && ($num_of_tests_planned != $num_of_tests_run); _diag("Looks like you failed $num_of_tests_failed test" ~ ($num_of_tests_failed == 1 ?? '' !! 's') ~ " of $num_of_tests_run" ) if $num_of_tests_failed && ! $subtest_todo_reason; } sub _init_vars { $subtest_callable_type = Mu; $num_of_tests_run = 0; $num_of_tests_failed = 0; $todo_upto_test_num = 0; $todo_reason = ''; $num_of_tests_planned = Any; $no_plan = 1; $time_before = NaN; $time_after = NaN; $done_testing_has_been_run = 0; $pseudo_fails = 0; $subtest_todo_reason = ''; } sub _push_vars { @vars.push: item [ $subtest_callable_type, $num_of_tests_run, $num_of_tests_failed, $todo_upto_test_num, $todo_reason, $num_of_tests_planned, $no_plan, $time_before, $time_after, $done_testing_has_been_run, $pseudo_fails, $subtest_todo_reason, ]; } sub _pop_vars { ( $subtest_callable_type, $num_of_tests_run, $num_of_tests_failed, $todo_upto_test_num, $todo_reason, $num_of_tests_planned, $no_plan, $time_before, $time_after, $done_testing_has_been_run, $pseudo_fails, $subtest_todo_reason, ) = @(@vars.pop); } END { ## In planned mode, people don't necessarily expect to have to call done-testing ## So call it for them if they didn't done-testing if nqp::iseq_i($done_testing_has_been_run,0) && nqp::iseq_i($no_plan,0); .?close unless $_ === $*OUT || $_ === $*ERR for $output, $failure_output, $todo_output; exit($num_of_tests_failed min 254) if $num_of_tests_failed > 0; exit(255) if nqp::iseq_i($no_plan,0) && ($num_of_tests_planned or $num_of_tests_run) && $num_of_tests_planned != $num_of_tests_run; } =begin pod =head1 NAME Test - Rakudo Testing Library =head1 SYNOPSIS use Test; =head1 DESCRIPTION Please check the section Language/testing of the doc repository. If you have 'p6doc' installed, you can do 'p6doc Language/testing'. You can also check the documentation about testing in Perl 6 online on: https://doc.perl6.org/language/testing =end pod # vim: expandtab shiftwidth=4 ft=perl6 rakudo-2018.03/LICENSE0000644000175000017500000002130613253717231012633 0ustar alexalex The Artistic License 2.0 Copyright (c) 2000-2006, The Perl Foundation. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software. You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package. If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement. Definitions "Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package. "Contributor" means any party that has contributed code or other material to the Package, in accordance with the Copyright Holder's procedures. "You" and "your" means any person who would like to copy, distribute, or modify the Package. "Package" means the collection of files distributed by the Copyright Holder, and derivatives of that collection and/or of those files. A given Package may consist of either the Standard Version, or a Modified Version. "Distribute" means providing a copy of the Package or making it accessible to anyone else, or in the case of a company or organization, to others outside of your company or organization. "Distributor Fee" means any fee that you charge for Distributing this Package or providing support for this Package to another party. It does not mean licensing fees. "Standard Version" refers to the Package if it has not been modified, or has been modified only in ways explicitly requested by the Copyright Holder. "Modified Version" means the Package, if it has been changed, and such changes were not explicitly requested by the Copyright Holder. "Original License" means this Artistic License as Distributed with the Standard Version of the Package, in its current version or as it may be modified by The Perl Foundation in the future. "Source" form means the source code, documentation source, and configuration files for the Package. "Compiled" form means the compiled bytecode, object code, binary, or any other form resulting from mechanical transformation or translation of the Source form. Permission for Use and Modification Without Distribution (1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version. Permissions for Redistribution of the Standard Version (2) You may Distribute verbatim copies of the Source form of the Standard Version of this Package in any medium without restriction, either gratis or for a Distributor Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At your discretion, such verbatim copies may or may not include a Compiled form of the Package. (3) You may apply any bug fixes, portability changes, and other modifications made available from the Copyright Holder. The resulting Package will still be considered the Standard Version, and as such will be subject to the Original License. Distribution of Modified Versions of the Package as Source (4) You may Distribute your Modified Version as Source (either gratis or for a Distributor Fee, and with or without a Compiled form of the Modified Version) provided that you clearly document how it differs from the Standard Version, including, but not limited to, documenting any non-standard features, executables, or modules, and provided that you do at least ONE of the following: (a) make the Modified Version available to the Copyright Holder of the Standard Version, under the Original License, so that the Copyright Holder may include your modifications in the Standard Version. (b) ensure that installation of your Modified Version does not prevent the user installing or running the Standard Version. In addition, the Modified Version must bear a name that is different from the name of the Standard Version. (c) allow anyone who receives a copy of the Modified Version to make the Source form of the Modified Version available to others under (i) the Original License or (ii) a license that permits the licensee to freely copy, modify and redistribute the Modified Version using the same licensing terms that apply to the copy that the licensee received, and requires that the Source form of the Modified Version, and of any works derived from it, be made freely available in that license fees are prohibited but Distributor Fees are allowed. Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source (5) You may Distribute Compiled forms of the Standard Version without the Source, provided that you include complete instructions on how to get the Source of the Standard Version. Such instructions must be valid at the time of your distribution. If these instructions, at any time while you are carrying out such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If you provide valid instructions or cease distribution within thirty days after you become aware that the instructions are invalid, then you do not forfeit any of your rights under this license. (6) You may Distribute a Modified Version in Compiled form without the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version. Aggregating or Linking the Package (7) You may aggregate the Package (either the Standard Version or Modified Version) with other packages and Distribute the resulting aggregation provided that you do not charge a licensing fee for the Package. Distributor Fees are permitted, and licensing fees for other components in the aggregation are permitted. The terms of this license apply to the use and Distribution of the Standard or Modified Versions as included in the aggregation. (8) You are permitted to link Modified and Standard Versions with other works, to embed the Package in a larger work of your own, or to build stand-alone binary or bytecode versions of applications that include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package. Items That are Not Considered Part of a Modified Version (9) Works (including, but not limited to, modules and scripts) that merely extend or make use of the Package, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not subject to the terms of this license. General Provisions (10) Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license. (11) If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license. (12) This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder. (13) This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed. (14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. rakudo-2018.03/MANIFEST0000644000175000017500000016165313253724135012772 0ustar alexalexappveyor.yml blib/Perl6/.gitignore Configure.pl CONTRIBUTING.md CREDITS docs/announce/2009-02 docs/announce/2009-03 docs/announce/2009-04 docs/announce/2009-05 docs/announce/2009-06 docs/announce/2009-07 docs/announce/2009-08 docs/announce/2009-09 docs/announce/2009-10 docs/announce/2009-11 docs/announce/2009-12 docs/announce/2010-01 docs/announce/2010.02 docs/announce/2010.03 docs/announce/2010.04 docs/announce/2010.05 docs/announce/2010.06 docs/announce/2010.07 docs/announce/2010.08 docs/announce/2010.09 docs/announce/2010.10 docs/announce/2010.11 docs/announce/2010.12 docs/announce/2011.01 docs/announce/2011.02 docs/announce/2011.03 docs/announce/2011.04 docs/announce/2011.05 docs/announce/2011.06 docs/announce/2011.07 docs/announce/2011.09 docs/announce/2011.10 docs/announce/2011.11 docs/announce/2011.12 docs/announce/2012.01 docs/announce/2012.02 docs/announce/2012.03 docs/announce/2012.04 docs/announce/2012.04.1 docs/announce/2012.05 docs/announce/2012.06 docs/announce/2012.07 docs/announce/2012.08 docs/announce/2012.09 docs/announce/2012.09.1 docs/announce/2012.10 docs/announce/2012.11 docs/announce/2012.12 docs/announce/2013.01 docs/announce/2013.02 docs/announce/2013.03.md docs/announce/2013.04.md docs/announce/2013.05.md docs/announce/2013.06.md docs/announce/2013.07.md docs/announce/2013.08.md docs/announce/2013.09.md docs/announce/2013.10.md docs/announce/2013.11.md docs/announce/2013.12.md docs/announce/2014.01.md docs/announce/2014.02.md docs/announce/2014.03.md docs/announce/2014.04.md docs/announce/2014.05.md docs/announce/2014.06.md docs/announce/2014.07.md docs/announce/2014.08.md docs/announce/2014.09.md docs/announce/2014.10.md docs/announce/2014.11.md docs/announce/2014.12.md docs/announce/2015.01.md docs/announce/2015.02.md docs/announce/2015.03.md docs/announce/2015.04.md docs/announce/2015.05.md docs/announce/2015.06.md docs/announce/2015.07.md docs/announce/2015.08.md docs/announce/2015.09.md docs/announce/2015.10.md docs/announce/2015.11.md docs/announce/2015.12.md docs/announce/2016.01.md docs/announce/2016.02.md docs/announce/2016.03.md docs/announce/2016.04.md docs/announce/2016.05.md docs/announce/2016.06.md docs/announce/2016.07.1.md docs/announce/2016.07.md docs/announce/2016.08.1.md docs/announce/2016.08.md docs/announce/2016.09.md docs/announce/2016.10.md docs/announce/2016.11.md docs/announce/2016.12.md docs/announce/2017.01.md docs/announce/2017.02.md docs/announce/2017.03.md docs/announce/2017.04.1.md docs/announce/2017.04.2.md docs/announce/2017.04.3.md docs/announce/2017.04.md docs/announce/2017.05.md docs/announce/2017.06.md docs/announce/2017.07.md docs/announce/2017.08.md docs/announce/2017.09.md docs/announce/2017.10.md docs/announce/2017.11.md docs/announce/2017.12.md docs/announce/2018.01.md docs/announce/2018.02.1.md docs/announce/2018.02.md docs/announce/2018.03.md docs/architecture.html docs/architecture.svg docs/archive/2017-IO-Grant--Action-Plan.md docs/archive/2018-03-04--Polishing-Rationals.md docs/archive/constants-type-constraints-proposal-2018-02-10.md docs/ChangeLog docs/compiler_overview.pod docs/deprecations docs/guide_to_setting.pod docs/language_versions.md docs/line-editor.pod docs/metamodel.pod docs/metaobject-api.pod docs/module_management.md docs/obtaining-a-commit-bit.pod docs/ops.markdown docs/release_guide.pod docs/ROADMAP docs/roast-spectest.data-versioning.md docs/running.pod docs/S11-Modules-proposal.pod docs/spectest-progress.csv docs/val.pod6 docs/windows.md dynext/IGNORE gen/jvm/.gitignore gen/moar/.gitignore INSTALL.txt lib/CompUnit/Repository/Staging.pm6 lib/experimental.pm6 lib/NativeCall/Compiler/GNU.pm6 lib/NativeCall/Compiler/MSVC.pm6 lib/NativeCall.pm6 lib/NativeCall/Types.pm6 lib/newline.pm6 lib/Pod/To/Text.pm6 lib/snapper.pm6 lib/Telemetry.pm6 lib/Test.pm6 LICENSE MANIFEST README.md src/core/allomorphs.pm6 src/core/Any-iterable-methods.pm6 src/core/Any.pm6 src/core/Argfiles.pm6 src/core/array_operators.pm6 src/core/Array.pm6 src/core/array_slice.pm6 src/core/Associative.pm6 src/core/AST.pm6 src/core/asyncops.pm6 src/core/atomicops.pm6 src/core/Attribute.pm6 src/core/Awaitable.pm6 src/core/Awaiter.pm6 src/core/Backtrace.pm6 src/core/Baggy.pm6 src/core/BagHash.pm6 src/core/Bag.pm6 src/core/Block.pm6 src/core/Bool.pm6 src/core/Buf.pm6 src/core/Callable.pm6 src/core/CallFrame.pm6 src/core/Cancellation.pm6 src/core/Capture.pm6 src/core/Channel.pm6 src/core/Code.pm6 src/core/Collation.pm6 src/core/Compiler.pm6 src/core/Complex.pm6 src/core/CompUnit/DependencySpecification.pm6 src/core/CompUnit/Handle.pm6 src/core/CompUnit/Loader.pm6 src/core/CompUnit.pm6 src/core/CompUnit/PrecompilationRepository.pm6 src/core/CompUnit/PrecompilationStore/File.pm6 src/core/CompUnit/PrecompilationStore.pm6 src/core/CompUnit/PrecompilationUnit.pm6 src/core/CompUnit/Repository/AbsolutePath.pm6 src/core/CompUnit/Repository/FileSystem.pm6 src/core/CompUnit/Repository/Installable.pm6 src/core/CompUnit/Repository/Installation.pm6 src/core/CompUnit/Repository/Locally.pm6 src/core/CompUnit/Repository/NQP.pm6 src/core/CompUnit/Repository/Perl5.pm6 src/core/CompUnit/Repository.pm6 src/core/CompUnit/RepositoryRegistry.pm6 src/core/CompUnit/Repository/Spec.pm6 src/core/CompUnit/Repository/Unknown.pm6 src/core/control.pm6 src/core/Cool.pm6 src/core/core_epilogue.pm6 src/core/core_prologue.pm6 src/core/CurrentThreadScheduler.pm6 src/core/Cursor.pm6 src/core/Dateish.pm6 src/core/Date.pm6 src/core/DateTime.pm6 src/core.d/await.pm6 src/core.d/core_prologue.pm6 src/core/Deprecations.pm6 src/core/Distribution.pm6 src/core/Distro.pm6 src/core/Duration.pm6 src/core/Encoding/Builtin.pm6 src/core/Encoding/Decoder/Builtin.pm6 src/core/Encoding/Decoder.pm6 src/core/Encoding/Encoder/Builtin.pm6 src/core/Encoding/Encoder.pm6 src/core/Encoding/Encoder/TranslateNewlineWrapper.pm6 src/core/Encoding.pm6 src/core/Encoding/Registry.pm6 src/core/Enumeration.pm6 src/core/Env.pm6 src/core/Exception.pm6 src/core/EXPORTHOW.pm6 src/core/Failure.pm6 src/core/ForeignCode.pm6 src/core/Grammar.pm6 src/core/Hash.pm6 src/core/hash_slice.pm6 src/core/HyperConfiguration.pm6 src/core/HyperSeq.pm6 src/core/Instant.pm6 src/core/Int.pm6 src/core/IO/ArgFiles.pm6 src/core/IO/CatHandle.pm6 src/core/IO/Handle.pm6 src/core/IO/Notification.pm6 src/core/io_operators.pm6 src/core/IO/Path.pm6 src/core/IO/Pipe.pm6 src/core/IO.pm6 src/core/IO/Socket/Async.pm6 src/core/IO/Socket/INET.pm6 src/core/IO/Socket.pm6 src/core/IO/Spec/Cygwin.pm6 src/core/IO/Special.pm6 src/core/IO/Spec.pm6 src/core/IO/Spec/QNX.pm6 src/core/IO/Spec/Unix.pm6 src/core/IO/Spec/Win32.pm6 src/core/Iterable.pm6 src/core/IterationBuffer.pm6 src/core/Iterator.pm6 src/core/JSON/Pretty.pm6 src/core/Junction.pm6 src/core/JVM/IOAsyncFile.pm6 src/core/JVM/KeyReducer.pm6 src/core/Kernel.pm6 src/core/Label.pm6 src/core/List.pm6 src/core/Lock/Async.pm6 src/core/Lock.pm6 src/core/Macro.pm6 src/core/Main.pm6 src/core/Map.pm6 src/core/Match.pm6 src/core/Metamodel/Primitives.pm6 src/core/metaops.pm6 src/core/Method.pm6 src/core/MixHash.pm6 src/core/Mix.pm6 src/core/Mixy.pm6 src/core/multidim_slice.pm6 src/core/Mu.pm6 src/core/native_array.pm6 src/core/natives.pm6 src/core/Nil.pm6 src/core/Numeric.pm6 src/core/Num.pm6 src/core/ObjAt.pm6 src/core/operators.pm6 src/core/Order.pm6 src/core/OS.pm6 src/core/Pair.pm6 src/core/Parameter.pm6 src/core/Perl.pm6 src/core/Pod.pm6 src/core/Positional.pm6 src/core/precedence.pm6 src/core/Proc/Async.pm6 src/core/Process.pm6 src/core/Proc.pm6 src/core/Promise.pm6 src/core/PseudoStash.pm6 src/core/QuantHash.pm6 src/core/RaceSeq.pm6 src/core/Rakudo/Internals/HyperIteratorBatcher.pm6 src/core/Rakudo/Internals/HyperPipeline.pm6 src/core/Rakudo/Internals/HyperRaceSharedImpl.pm6 src/core/Rakudo/Internals/HyperToIterator.pm6 src/core/Rakudo/Internals/HyperWorkBatch.pm6 src/core/Rakudo/Internals/HyperWorkStage.pm6 src/core/Rakudo/Internals/JSON.pm6 src/core/Rakudo/Internals.pm6 src/core/Rakudo/Internals/RaceToIterator.pm6 src/core/Rakudo/Iterator.pm6 src/core/Rakudo/Metaops.pm6 src/core/Rakudo/QuantHash.pm6 src/core/Rakudo/Sorting.pm6 src/core/Range.pm6 src/core/Rational.pm6 src/core/Rat.pm6 src/core/Real.pm6 src/core/Regex.pm6 src/core/REPL.pm6 src/core/Routine.pm6 src/core/Scalar.pm6 src/core/Scheduler.pm6 src/core/Semaphore.pm6 src/core/Seq.pm6 src/core/Sequence.pm6 src/core/set_addition.pm6 src/core/set_difference.pm6 src/core/set_elem.pm6 src/core/SetHash.pm6 src/core/set_intersection.pm6 src/core/set_multiply.pm6 src/core/set_operators.pm6 src/core/Set.pm6 src/core/set_precedes.pm6 src/core/set_proper_subset.pm6 src/core/set_subset.pm6 src/core/set_symmetric_difference.pm6 src/core/Setty.pm6 src/core/set_union.pm6 src/core/Shaped1Array.pm6 src/core/Shaped2Array.pm6 src/core/Shaped3Array.pm6 src/core/ShapedArray.pm6 src/core/ShapedNArray.pm6 src/core/signals.pm6 src/core/Signature.pm6 src/core/Slang.pm6 src/core/SLICE.pm6 src/core/Slip.pm6 src/core/SlippyIterator.pm6 src/core/Stash.pm6 src/core/StrDistance.pm6 src/core/Stringy.pm6 src/core/Str.pm6 src/core/stubs.pm6 src/core/Submethod.pm6 src/core/Sub.pm6 src/core/Supply.pm6 src/core/Systemic.pm6 src/core/Thread.pm6 src/core/ThreadPoolScheduler.pm6 src/core/traits.pm6 src/core/TypedArray.pm6 src/core/Uni.pm6 src/core/Variable.pm6 src/core/Version.pm6 src/core/VM.pm6 src/core/WhateverCode.pm6 src/core/Whatever.pm6 src/main.nqp src/Perl6/Actions.nqp src/Perl6/Compiler.nqp src/perl6-debug.nqp src/Perl6/Grammar.nqp src/Perl6/Metamodel/Archetypes.nqp src/Perl6/Metamodel/ArrayType.nqp src/Perl6/Metamodel/AttributeContainer.nqp src/Perl6/Metamodel/BaseType.nqp src/Perl6/Metamodel/BoolificationProtocol.nqp src/Perl6/Metamodel/BOOTSTRAP.nqp src/Perl6/Metamodel/BUILDPLAN.nqp src/Perl6/Metamodel/C3MRO.nqp src/Perl6/Metamodel/ClassHOW.nqp src/Perl6/Metamodel/CoercionHOW.nqp src/Perl6/Metamodel/ConcreteRoleHOW.nqp src/Perl6/Metamodel/Configuration.nqp src/Perl6/Metamodel/ContainerDescriptor.nqp src/Perl6/Metamodel/CurriedRoleHOW.nqp src/Perl6/Metamodel/DefaultParent.nqp src/Perl6/Metamodel/DefiniteHOW.nqp src/Perl6/Metamodel/Dispatchers.nqp src/Perl6/Metamodel/Documenting.nqp src/Perl6/Metamodel/EnumHOW.nqp src/Perl6/Metamodel/EXPORTHOW.nqp src/Perl6/Metamodel/Finalization.nqp src/Perl6/Metamodel/GenericHOW.nqp src/Perl6/Metamodel/GrammarHOW.nqp src/Perl6/Metamodel/InvocationProtocol.nqp src/Perl6/Metamodel/MetaMethodContainer.nqp src/Perl6/Metamodel/MethodContainer.nqp src/Perl6/Metamodel/MethodDelegation.nqp src/Perl6/Metamodel/Mixins.nqp src/Perl6/Metamodel/ModuleHOW.nqp src/Perl6/Metamodel/MROBasedMethodDispatch.nqp src/Perl6/Metamodel/MROBasedTypeChecking.nqp src/Perl6/Metamodel/MultiMethodContainer.nqp src/Perl6/Metamodel/MultipleInheritance.nqp src/Perl6/Metamodel/Naming.nqp src/Perl6/Metamodel/NativeHOW.nqp src/Perl6/Metamodel/NativeRefHOW.nqp src/Perl6/Metamodel/PackageHOW.nqp src/Perl6/Metamodel/ParametricRoleGroupHOW.nqp src/Perl6/Metamodel/ParametricRoleHOW.nqp src/Perl6/Metamodel/PrivateMethodContainer.nqp src/Perl6/Metamodel/REPRComposeProtocol.nqp src/Perl6/Metamodel/RoleContainer.nqp src/Perl6/Metamodel/RolePunning.nqp src/Perl6/Metamodel/RoleToClassApplier.nqp src/Perl6/Metamodel/RoleToRoleApplier.nqp src/Perl6/Metamodel/Stashing.nqp src/Perl6/Metamodel/SubsetHOW.nqp src/Perl6/Metamodel/Trusting.nqp src/Perl6/Metamodel/TypePretense.nqp src/Perl6/Metamodel/Versioning.nqp src/Perl6/ModuleLoader.nqp src/Perl6/Optimizer.nqp src/Perl6/Pod.nqp src/Perl6/World.nqp src/RESTRICTED.setting src/vm/jvm/CompUnit/Repository/Java.pm6 src/vm/jvm/CompUnit/Repository/JavaRuntime.pm6 src/vm/jvm/ModuleLoaderVMConfig.nqp src/vm/jvm/Perl6/JavaModuleLoader.nqp src/vm/jvm/Perl6/Metamodel/JavaHOW.nqp src/vm/jvm/Perl6/Ops.nqp src/vm/jvm/runtime/org/perl6/rakudo/Binder.java src/vm/jvm/runtime/org/perl6/rakudo/RakOps.java src/vm/jvm/runtime/org/perl6/rakudo/RakudoContainerConfigurer.java src/vm/jvm/runtime/org/perl6/rakudo/RakudoContainerSpec.java src/vm/jvm/runtime/org/perl6/rakudo/RakudoEvalServer.java src/vm/jvm/runtime/org/perl6/rakudo/RakudoJavaInterop.java src/vm/moar/ModuleLoaderVMConfig.nqp src/vm/moar/ops/container.c src/vm/moar/ops/container.h src/vm/moar/ops/perl6_ops.c src/vm/moar/Perl6/Ops.nqp t/01-sanity/01-literals.t t/01-sanity/02-op-math.t t/01-sanity/03-op-logic.t t/01-sanity/04-op-cmp.t t/01-sanity/05-var.t t/01-sanity/06-op-inplace.t t/01-sanity/07-op-string.t t/01-sanity/08-var-array.t t/01-sanity/09-end-blocks.t t/01-sanity/10-regex.t t/01-sanity/11-tap.t t/01-sanity/12-counter.t t/01-sanity/13-equal.t t/01-sanity/14-if.t t/01-sanity/15-sub.t t/01-sanity/16-eqv.t t/01-sanity/17-isa.t t/01-sanity/18-simple-multisubs.t t/01-sanity/19-say.t t/01-sanity/20-defined.t t/01-sanity/21-try.t t/01-sanity/53-transpose.t t/01-sanity/55-use-trace.t t/01-sanity/98-test-deprecated.t t/01-sanity/99-test-basic.t t/02-rakudo/01-is_approx.t t/02-rakudo/03-cmp-ok.t t/02-rakudo/04-diag.t t/02-rakudo/05-range-in-range.t t/02-rakudo/06-is.t t/02-rakudo/07-io-cathandle.t t/02-rakudo/08-inline-native-arith.t t/02-rakudo/08-repeat.t t/02-rakudo/08-slangs.t t/02-rakudo/09-thread-id-after-await.t t/02-rakudo/10-nqp-ops.t t/02-rakudo/11-deprecated.t t/02-rakudo/dd.t t/02-rakudo/dump.t t/02-rakudo/repl.t t/02-rakudo/test-packages/CustomOps.pm6 t/02-rakudo/v6.d-tests/01-deprecations.t t/03-jvm/01-interop.t t/03-jvm/Foo.java t/04-nativecall/00-misc.c t/04-nativecall/00-misc.t t/04-nativecall/01-argless.c t/04-nativecall/01-argless.t t/04-nativecall/02-simple-args.c t/04-nativecall/02-simple-args.t t/04-nativecall/03-simple-returns.c t/04-nativecall/03-simple-returns.t t/04-nativecall/04-pointers.c t/04-nativecall/04-pointers.t t/04-nativecall/05-arrays.c t/04-nativecall/05-arrays.t t/04-nativecall/06-struct.c t/04-nativecall/06-struct.t t/04-nativecall/07-writebarrier.c t/04-nativecall/07-writebarrier.t t/04-nativecall/08-callbacks.c t/04-nativecall/08-callbacks.t t/04-nativecall/09-nativecast.c t/04-nativecall/09-nativecast.t t/04-nativecall/10-cglobals.c t/04-nativecall/10-cglobals.t t/04-nativecall/11-cpp.cpp t/04-nativecall/11-cpp.t t/04-nativecall/12-sizeof.c t/04-nativecall/12-sizeof.t t/04-nativecall/13-cpp-mangling.cpp t/04-nativecall/13-cpp-mangling.t t/04-nativecall/13-union.c t/04-nativecall/13-union.t t/04-nativecall/14-rw-attrs.c t/04-nativecall/14-rw-attrs.t t/04-nativecall/15-rw-args.c t/04-nativecall/15-rw-args.t t/04-nativecall/16-rt125408.t t/04-nativecall/16-rt125729.t t/04-nativecall/17-libnames.t t/04-nativecall/18-routine-sig-sanity.t t/04-nativecall/19-function-pointers.c t/04-nativecall/19-function-pointers.t t/04-nativecall/20-concurrent.c t/04-nativecall/20-concurrent.t t/04-nativecall/21-callback-other-thread.c t/04-nativecall/21-callback-other-thread.t t/04-nativecall/22-method.c t/04-nativecall/22-method.t t/04-nativecall/CompileTestLib.pm6 t/05-messages/01-errors.t t/05-messages/02-errors.t t/05-messages/03-errors.t t/05-messages/10-warnings.t t/05-messages/11-overflow.t t/05-messages/moar/01-errors.t t/05-messages/v6.d-tests/01-errors.t t/06-telemetry/01-basic.t t/06-telemetry/02-usage.t t/06-telemetry/03-thread.t t/06-telemetry/04-threadpool.t t/07-pod-to-text/01-whitespace.t t/08-performance/01-iterators.t t/08-performance/02-qast-rewrites.t t/08-performance/99-misc.t t/09-moar/00-misc.t t/09-moar/General_Category__extracted-DerivedGeneralCategory.t t/09-moar/General_Category__UnicodeData__2.t t/09-moar/Line_Break__LineBreak.t t/09-moar/NAME__UnicodeData.t t/09-moar/UnipropCheck.pm6 t/10-qast/00-misc.t t/3rdparty/Unicode/10.0.0/extracted/DerivedGeneralCategory.txt t/3rdparty/Unicode/10.0.0/LineBreak.txt t/3rdparty/Unicode/10.0.0/UnicodeData.txt t/3rdparty/Unicode/LICENSE t/fudgeandrun t/harness5 t/harness6 tools/autounfudge.pl tools/benchmark.pl tools/build/common_bootstrap_sources tools/build/create-jvm-runner.pl tools/build/create-moar-runner.pl tools/build/gen-cat.nqp tools/build/gen-version.pl tools/build/install-core-dist.pl tools/build/jvm_core_d_sources tools/build/jvm_core_sources tools/build-localtest.pl tools/build/Makefile-common-macros.in tools/build/Makefile-common-rules.in tools/build/Makefile-JVM.in tools/build/Makefile-Moar.in tools/build/makeMAGIC_INC_DEC.pl6 tools/build/makeNATIVE_ARRAY.pl6 tools/build/makeNATIVE_SHAPED_ARRAY.pl6 tools/build/makeSLICE.pl6 tools/build/makeUNIPROP.pl6 tools/build/moar_core_d_sources tools/build/moar_core_sources tools/build/nqp-jvm-rr.pl tools/build/NQP_REVISION tools/build/upgrade-repository.pl tools/contributors.p6 tools/create-release-announcement.p6 tools/CREDITS.p6 tools/install-dist.pl tools/lib/NQP/Configure.pm tools/perl6-limited.pl tools/rakudo-swarm.config tools/release-dates.p6 tools/update-passing-test-data.pl tools/update-tai-utc.pl tools/util/perlcritic.conf t/packages/Test/Helpers.pm6 t/packages/Test/Helpers/QAST.pm6 t/spec/fudge t/spec/fudgeall t/spec/fudgeandrun t/spec/integration/99problems-01-to-10.t t/spec/integration/99problems-11-to-20.t t/spec/integration/99problems-21-to-30.t t/spec/integration/99problems-31-to-40.t t/spec/integration/99problems-41-to-50.t t/spec/integration/99problems-51-to-60.t t/spec/integration/99problems-61-to-70.t t/spec/integration/advent2009-day01.t t/spec/integration/advent2009-day02.t t/spec/integration/advent2009-day03.t t/spec/integration/advent2009-day04.t t/spec/integration/advent2009-day05.t t/spec/integration/advent2009-day06.t t/spec/integration/advent2009-day07.t t/spec/integration/advent2009-day08.t t/spec/integration/advent2009-day09.t t/spec/integration/advent2009-day10.t t/spec/integration/advent2009-day11.t t/spec/integration/advent2009-day12.t t/spec/integration/advent2009-day13.t t/spec/integration/advent2009-day14.t t/spec/integration/advent2009-day15.t t/spec/integration/advent2009-day16.t t/spec/integration/advent2009-day17.t t/spec/integration/advent2009-day18.t t/spec/integration/advent2009-day19.t t/spec/integration/advent2009-day20.t t/spec/integration/advent2009-day21.t t/spec/integration/advent2009-day22.t t/spec/integration/advent2009-day23.t t/spec/integration/advent2009-day24.t t/spec/integration/advent2010-day03.t t/spec/integration/advent2010-day04.t t/spec/integration/advent2010-day06.t t/spec/integration/advent2010-day07.t t/spec/integration/advent2010-day08.t t/spec/integration/advent2010-day10.t t/spec/integration/advent2010-day11.t t/spec/integration/advent2010-day12.t t/spec/integration/advent2010-day14.t t/spec/integration/advent2010-day16.t t/spec/integration/advent2010-day19.t t/spec/integration/advent2010-day21.t t/spec/integration/advent2010-day22.t t/spec/integration/advent2010-day23.t t/spec/integration/advent2011-day03.t t/spec/integration/advent2011-day04.t t/spec/integration/advent2011-day05.t t/spec/integration/advent2011-day07.t t/spec/integration/advent2011-day10.t t/spec/integration/advent2011-day11.t t/spec/integration/advent2011-day14.t t/spec/integration/advent2011-day15.t t/spec/integration/advent2011-day16.t t/spec/integration/advent2011-day20.t t/spec/integration/advent2011-day22.t t/spec/integration/advent2011-day23.t t/spec/integration/advent2011-day24.t t/spec/integration/advent2012-day02.t t/spec/integration/advent2012-day03.t t/spec/integration/advent2012-day04.t t/spec/integration/advent2012-day06.t t/spec/integration/advent2012-day09.t t/spec/integration/advent2012-day10.t t/spec/integration/advent2012-day12.t t/spec/integration/advent2012-day13.t t/spec/integration/advent2012-day14.t t/spec/integration/advent2012-day15.t t/spec/integration/advent2012-day16.t t/spec/integration/advent2012-day19.t t/spec/integration/advent2012-day20.t t/spec/integration/advent2012-day21.t t/spec/integration/advent2012-day22.t t/spec/integration/advent2012-day23.t t/spec/integration/advent2012-day24.t t/spec/integration/advent2013-day02.t t/spec/integration/advent2013-day04.t t/spec/integration/advent2013-day06.t t/spec/integration/advent2013-day07.t t/spec/integration/advent2013-day08.t t/spec/integration/advent2013-day09.t t/spec/integration/advent2013-day10.t t/spec/integration/advent2013-day12.t t/spec/integration/advent2013-day14.t t/spec/integration/advent2013-day15.t t/spec/integration/advent2013-day18.t t/spec/integration/advent2013-day19.t t/spec/integration/advent2013-day20.t t/spec/integration/advent2013-day21.t t/spec/integration/advent2013-day22.t t/spec/integration/advent2013-day23.t t/spec/integration/advent2014-day05.t t/spec/integration/advent2014-day13.t t/spec/integration/advent2014-day16.t t/spec/integration/code-blocks-as-sub-args.t t/spec/integration/error-reporting.t t/spec/integration/lazy-bentley-generator.t t/spec/integration/lexical-array-in-inner-block.t t/spec/integration/lexicals-and-attributes.t t/spec/integration/man-or-boy.t t/spec/integration/method-calls-and-instantiation.t t/spec/integration/no-indirect-new.t t/spec/integration/packages.t t/spec/integration/pair-in-array.t t/spec/integration/passing-pair-class-to-sub.t t/spec/integration/precompiled.t t/spec/integration/real-strings.t t/spec/integration/role-composition-vs-attribute.t t/spec/integration/rule-in-class-Str.t t/spec/integration/say-crash.t t/spec/integration/substr-after-match-in-gather-in-for.t t/spec/integration/topic_in_double_loop.t t/spec/integration/variables-in-do.t t/spec/integration/weird-errors.t t/spec/LICENSE t/spec/packages/A/A.pm t/spec/packages/A/B.pm t/spec/packages/Advent/GrammarProfiler.pm t/spec/packages/Advent/MetaBoundaryAspect.pm t/spec/packages/Advent/SingleInheritance.pm t/spec/packages/A.pm t/spec/packages/ArrayInit.pm t/spec/packages/Bar.pm t/spec/packages/Baz.pm t/spec/packages/B/Grammar.pm t/spec/packages/B.pm t/spec/packages/ContainsUnicode.pm t/spec/packages/Example2/A.pm t/spec/packages/Example2/B.pm t/spec/packages/Example2/C.pm t/spec/packages/Example2/D.pm t/spec/packages/Example2/E.pm t/spec/packages/Example2/F.pm t/spec/packages/Example2/G.pm t/spec/packages/Example2/H.pm t/spec/packages/Example2/K.pm t/spec/packages/Example2/N.pm t/spec/packages/Example2/P.pm t/spec/packages/Example2/R.pm t/spec/packages/Example2/S.pm t/spec/packages/Example2/T.pm t/spec/packages/Example2/U.pm t/spec/packages/Example/A.pm t/spec/packages/Example/B.pm t/spec/packages/Example/C.pm t/spec/packages/Exportops.pm t/spec/packages/Export_PackA.pm t/spec/packages/Export_PackB.pm t/spec/packages/Export_PackC.pm t/spec/packages/Export_PackD.pm t/spec/packages/Fancy/Utilities.pm t/spec/packages/FooBar.pm t/spec/packages/Foo.pm t/spec/packages/HasMain.pm t/spec/packages/Import.pm t/spec/packages/LoadCounter.pm t/spec/packages/LoadFromInsideAClass.pm t/spec/packages/LoadFromInsideAModule.pm t/spec/packages/OverrideTest.pm t/spec/packages/PackageTest.pm t/spec/packages/PM6.pm6 t/spec/packages/README t/spec/packages/RequireAndUse1.pm t/spec/packages/RequireAndUse2.pm t/spec/packages/RequireAndUse3.pm t/spec/packages/RoleA.pm t/spec/packages/RoleB.pm t/spec/packages/RT115240.pm t/spec/packages/RT122447.pm t/spec/packages/RT123276/B/C1.pm t/spec/packages/RT123276/B/C2.pm t/spec/packages/RT123276.pm t/spec/packages/RT124162.pm t/spec/packages/RT125090.pm t/spec/packages/RT125245.pm t/spec/packages/RT125715.pm6 t/spec/packages/RT126904/lib/Woohoo/Foo/Bar.pm t/spec/packages/RT126904/lib/Woohoo/Foo/Baz.pm t/spec/packages/RT126904/lib/Woohoo/Qux.pm t/spec/packages/RT76456.pm t/spec/packages/RT76606/a.pm t/spec/packages/RT76606.pm t/spec/packages/RT83354_A.pm t/spec/packages/RT83354_B.pm t/spec/packages/RT84280.pm t/spec/packages/S11-modules/Foo.pm t/spec/packages/Test/Assuming.pm t/spec/packages/Test/Compile.pm t/spec/packages/Test/Idempotence.pm t/spec/packages/Test/Tap.pm t/spec/packages/Test/Util.pm t/spec/packages/UseTest.pm t/spec/README t/spec/rosettacode/greatest_element_of_a_list.t t/spec/rosettacode/README t/spec/rosettacode/sierpinski_triangle.t t/spec/S01-perl-5-integration/array.t t/spec/S01-perl-5-integration/basic.t t/spec/S01-perl-5-integration/class.t t/spec/S01-perl-5-integration/exception_handling.t t/spec/S01-perl-5-integration/hash.t t/spec/S01-perl-5-integration/import.t t/spec/S01-perl-5-integration/method.t t/spec/S01-perl-5-integration/README t/spec/S01-perl-5-integration/return.t t/spec/S01-perl-5-integration/roundtrip.t t/spec/S01-perl-5-integration/strings.t t/spec/S01-perl-5-integration/subs.t t/spec/S02-lexical-conventions/begin_end_pod.t t/spec/S02-lexical-conventions/bom.t t/spec/S02-lexical-conventions/comments.t t/spec/S02-lexical-conventions/end-pod.t t/spec/S02-lexical-conventions/minimal-whitespace.t t/spec/S02-lexical-conventions/one-pass-parsing.t t/spec/S02-lexical-conventions/pod-in-multi-line-exprs.t t/spec/S02-lexical-conventions/sub-block-parsing.t t/spec/S02-lexical-conventions/unicode.t t/spec/S02-lexical-conventions/unicode-whitespace.t t/spec/S02-lexical-conventions/unspace.t t/spec/S02-lists/indexing.t t/spec/S02-lists/tree.t t/spec/S02-literals/adverbs.t t/spec/S02-literals/allomorphic.t t/spec/S02-literals/array-interpolation.t t/spec/S02-literals/autoref.t t/spec/S02-literals/char-by-name.t t/spec/S02-literals/char-by-number.t t/spec/S02-literals/fmt-interpolation.t t/spec/S02-literals/hash-interpolation.t t/spec/S02-literals/heredocs.t t/spec/S02-literals/hex_chars.t t/spec/S02-literals/listquote.t t/spec/S02-literals/listquote-whitespace.t t/spec/S02-literals/misc-interpolation.t t/spec/S02-literals/numeric.t t/spec/S02-literals/pair-boolean.t t/spec/S02-literals/pairs.t t/spec/S02-literals/pod.t t/spec/S02-literals/quoting.t t/spec/S02-literals/quoting-unicode.t t/spec/S02-literals/radix.t t/spec/S02-literals/string-interpolation.t t/spec/S02-literals/sub-calls.t t/spec/S02-literals/subscript.t t/spec/S02-literals/types.t t/spec/S02-literals/underscores.t t/spec/S02-literals/version.t t/spec/S02-magicals/78258.t t/spec/S02-magicals/args.t t/spec/S02-magicals/block.t t/spec/S02-magicals/DISTRO.t t/spec/S02-magicals/dollar_bang.t t/spec/S02-magicals/dollar-underscore.t t/spec/S02-magicals/env.t t/spec/S02-magicals/file_line.t t/spec/S02-magicals/KERNEL.t t/spec/S02-magicals/PERL.t t/spec/S02-magicals/pid.t t/spec/S02-magicals/progname.t t/spec/S02-magicals/subname.t t/spec/S02-magicals/sub.t t/spec/S02-magicals/UsedEnv.pm6 t/spec/S02-magicals/VM.t t/spec/S02-names/bare-sigil.t t/spec/S02-names/caller.t t/spec/S02-names/identifier.t t/spec/S02-names/indirect.t t/spec/S02-names/is_cached.t t/spec/S02-names/is_default.t t/spec/S02-names/is_dynamic.t t/spec/S02-names/name.t t/spec/S02-names/our.t t/spec/S02-names/pseudo.t t/spec/S02-names/strict.t t/spec/S02-names/symbolic-deref.t t/spec/S02-names-vars/contextual.t t/spec/S02-names-vars/fmt.t t/spec/S02-names-vars/list_array_perl.t t/spec/S02-names-vars/names.t t/spec/S02-names-vars/perl.t t/spec/S02-names-vars/signature.t t/spec/S02-names-vars/variables-and-packages.t t/spec/S02-names-vars/varnames.t t/spec/S02-one-pass-parsing/less-than.t t/spec/S02-packages/package-lookup.t t/spec/S02-types/anon_block.t t/spec/S02-types/array_extending.t t/spec/S02-types/array_ref.t t/spec/S02-types/array-shapes.t t/spec/S02-types/array.t t/spec/S02-types/assigning-refs.t t/spec/S02-types/autovivification.t t/spec/S02-types/baghash.t t/spec/S02-types/bag.t t/spec/S02-types/bool.t t/spec/S02-types/built-in.t t/spec/S02-types/capture.t t/spec/S02-types/catch_type_cast_mismatch.t t/spec/S02-types/compact.t t/spec/S02-types/declare.t t/spec/S02-types/fatrat.t t/spec/S02-types/flattening.t t/spec/S02-types/hash_ref.t t/spec/S02-types/hash.t t/spec/S02-types/infinity.t t/spec/S02-types/instants-and-durations.t t/spec/S02-types/int-uint.t t/spec/S02-types/isDEPRECATED.t t/spec/S02-types/is-type.t t/spec/S02-types/keyhash.t t/spec/S02-types/lazy-lists.t t/spec/S02-types/lists.t t/spec/S02-types/list.t t/spec/S02-types/mixed_multi_dimensional.t t/spec/S02-types/mixhash.t t/spec/S02-types/mix.t t/spec/S02-types/multi_dimensional_array.t t/spec/S02-types/nan.t t/spec/S02-types/native.t t/spec/S02-types/nested_arrays.t t/spec/S02-types/nested_pairs.t t/spec/S02-types/nil.t t/spec/S02-types/num.t t/spec/S02-types/pair.t t/spec/S02-types/parsing-bool.t t/spec/S02-types/range.t t/spec/S02-types/resolved-in-setting.t t/spec/S02-types/sethash.t t/spec/S02-types/set.t t/spec/S02-types/sigils-and-types.t t/spec/S02-types/stash.t t/spec/S02-types/subscripts_and_context.t t/spec/S02-types/subset.t t/spec/S02-types/type.t t/spec/S02-types/undefined-types.t t/spec/S02-types/unicode.t t/spec/S02-types/version.t t/spec/S02-types/whatever.t t/spec/S02-types/WHICH.t t/spec/S03-binding/arrays.t t/spec/S03-binding/attributes.t t/spec/S03-binding/closure.t t/spec/S03-binding/hashes.t t/spec/S03-binding/nested.t t/spec/S03-binding/ro.t t/spec/S03-binding/scalars.t t/spec/S03-feeds/basic.t t/spec/S03-junctions/associative.t t/spec/S03-junctions/autothreading.t t/spec/S03-junctions/boolean-context.t t/spec/S03-junctions/misc.t t/spec/S03-metaops/cross.t t/spec/S03-metaops/eager-hyper.t t/spec/S03-metaops/hyper.t t/spec/S03-metaops/not.t t/spec/S03-metaops/reduce.t t/spec/S03-metaops/reverse.t t/spec/S03-metaops/zip.t t/spec/S03-operators/adverbial-modifiers.t t/spec/S03-operators/also.t t/spec/S03-operators/andthen.t t/spec/S03-operators/arith.t t/spec/S03-operators/assign-is-not-binding.t t/spec/S03-operators/assign.t t/spec/S03-operators/autoincrement-range.t t/spec/S03-operators/autoincrement.t t/spec/S03-operators/autovivification.t t/spec/S03-operators/bag.t t/spec/S03-operators/basic-types.t t/spec/S03-operators/bit.t t/spec/S03-operators/boolean-bitwise.t t/spec/S03-operators/brainos.t t/spec/S03-operators/buf.t t/spec/S03-operators/chained-declarators.t t/spec/S03-operators/cmp.t t/spec/S03-operators/comparison-simple.t t/spec/S03-operators/comparison.t t/spec/S03-operators/composition.t t/spec/S03-operators/context-forcers.t t/spec/S03-operators/context.t t/spec/S03-operators/custom.t t/spec/S03-operators/div.t t/spec/S03-operators/equality.t t/spec/S03-operators/eqv.t t/spec/S03-operators/flip-flop.t t/spec/S03-operators/gcd.t t/spec/S03-operators/identity.t t/spec/S03-operators/increment.t t/spec/S03-operators/infixed-function.t t/spec/S03-operators/inplace.t t/spec/S03-operators/is-divisible-by.t t/spec/S03-operators/lcm.t t/spec/S03-operators/list-quote-junction.t t/spec/S03-operators/minmax.t t/spec/S03-operators/misc.t t/spec/S03-operators/mix.t t/spec/S03-operators/names.t t/spec/S03-operators/nesting.t t/spec/S03-operators/not.t t/spec/S03-operators/numeric-shift.t t/spec/S03-operators/orelse.t t/spec/S03-operators/overflow.t t/spec/S03-operators/precedence.t t/spec/S03-operators/range-basic.t t/spec/S03-operators/range-int.t t/spec/S03-operators/range.t t/spec/S03-operators/reduce-le1arg.t t/spec/S03-operators/relational.t t/spec/S03-operators/repeat.t t/spec/S03-operators/scalar-assign.t t/spec/S03-operators/set.t t/spec/S03-operators/short-circuit.t t/spec/S03-operators/so.t t/spec/S03-operators/spaceship-and-containers.t t/spec/S03-operators/spaceship.t t/spec/S03-operators/subscript-adverbs.t t/spec/S03-operators/subscript-vs-lt.t t/spec/S03-operators/ternary.t t/spec/S03-operators/value_equivalence.t t/spec/S03-sequence/arity0.t t/spec/S03-sequence/arity-2-or-more.t t/spec/S03-sequence/basic.t t/spec/S03-sequence/limit-arity-2-or-more.t t/spec/S03-sequence/misc.t t/spec/S03-sequence/nonnumeric.t t/spec/S03-smartmatch/any-any.t t/spec/S03-smartmatch/any-bool.t t/spec/S03-smartmatch/any-callable.t t/spec/S03-smartmatch/any-complex.t t/spec/S03-smartmatch/any-hash-pair.t t/spec/S03-smartmatch/any-method.t t/spec/S03-smartmatch/any-num.t t/spec/S03-smartmatch/any-pair.t t/spec/S03-smartmatch/any-str.t t/spec/S03-smartmatch/any-sub.t t/spec/S03-smartmatch/any-type.t t/spec/S03-smartmatch/array-array.t t/spec/S03-smartmatch/array-hash.t t/spec/S03-smartmatch/capture-signature.t t/spec/S03-smartmatch/disorganized.t t/spec/S03-smartmatch/hash-hash.t t/spec/S03-smartmatch/range-range.t t/spec/S03-smartmatch/regex-hash.t t/spec/S03-smartmatch/scalar-hash.t t/spec/S03-smartmatch/signature-signature.t t/spec/S04-blocks-and-statements/let.t t/spec/S04-blocks-and-statements/pointy-rw.t t/spec/S04-blocks-and-statements/pointy.t t/spec/S04-blocks-and-statements/temp.t t/spec/S04-declarations/constant.t t/spec/S04-declarations/implicit-parameter.t t/spec/S04-declarations/multiple.t t/spec/S04-declarations/my.t t/spec/S04-declarations/our.t t/spec/S04-declarations/smiley.t t/spec/S04-declarations/state.t t/spec/S04-declarations/will.t t/spec/S04-exception-handlers/catch.t t/spec/S04-exception-handlers/control.t t/spec/S04-exception-handlers/top-level.t t/spec/S04-exceptions/control_across_runloop.t t/spec/S04-exceptions/fail.t t/spec/S04-exceptions/pending.t t/spec/S04-phasers/ascending-order.t t/spec/S04-phasers/begin.t t/spec/S04-phasers/check.t t/spec/S04-phasers/descending-order.t t/spec/S04-phasers/end.t t/spec/S04-phasers/enter-leave.t t/spec/S04-phasers/eval-in-begin.t t/spec/S04-phasers/first.t t/spec/S04-phasers/in-eval.t t/spec/S04-phasers/init.t t/spec/S04-phasers/in-loop.t t/spec/S04-phasers/keep-undo.t t/spec/S04-phasers/multiple.t t/spec/S04-phasers/next.t t/spec/S04-phasers/pre-post.t t/spec/S04-phasers/rvalue.t t/spec/S04-statement-modifiers/for.t t/spec/S04-statement-modifiers/given.t t/spec/S04-statement-modifiers/if.t t/spec/S04-statement-modifiers/unless.t t/spec/S04-statement-modifiers/until.t t/spec/S04-statement-modifiers/values_in_bool_context.t t/spec/S04-statement-modifiers/while.t t/spec/S04-statement-modifiers/without.t t/spec/S04-statement-modifiers/with.t t/spec/S04-statement-parsing/hash.t t/spec/S04-statements/do.t t/spec/S04-statements/for-scope.t t/spec/S04-statements/for.t t/spec/S04-statements/for_with_only_one_item.t t/spec/S04-statements/gather.t t/spec/S04-statements/given.t t/spec/S04-statements/if.t t/spec/S04-statements/label.t t/spec/S04-statements/last.t t/spec/S04-statements/loop.t t/spec/S04-statements/map-and-sort-in-for.t t/spec/S04-statements/next.t t/spec/S04-statements/no-implicit-block.t t/spec/S04-statements/once.t t/spec/S04-statements/quietly.t t/spec/S04-statements/redo.t t/spec/S04-statements/repeat.t t/spec/S04-statements/return.t t/spec/S04-statements/sink.t t/spec/S04-statements/terminator.t t/spec/S04-statements/try.t t/spec/S04-statements/unless.t t/spec/S04-statements/until.t t/spec/S04-statements/when.t t/spec/S04-statements/while.t t/spec/S04-statements/with.t t/spec/S05-capture/alias.t t/spec/S05-capture/array-alias.t t/spec/S05-capture/caps.t t/spec/S05-capture/dot.t t/spec/S05-capture/match-object.t t/spec/S05-capture/named.t t/spec/S05-capture/subrule.t t/spec/S05-grammar/action-stubs.t t/spec/S05-grammar/example.t t/spec/S05-grammar/inheritance.t t/spec/S05-grammar/methods.t t/spec/S05-grammar/namespace.t t/spec/S05-grammar/parse_and_parsefile.t t/spec/S05-grammar/polymorphism.t t/spec/S05-grammar/protoregex.t t/spec/S05-grammar/protos.t t/spec/S05-grammar/signatures.t t/spec/S05-grammar/ws.t t/spec/S05-interpolation/lexicals.t t/spec/S05-interpolation/regex-in-variable.t t/spec/S05-mass/charsets.t t/spec/S05-mass/named-chars.t t/spec/S05-mass/properties-block.t t/spec/S05-mass/properties-derived.t t/spec/S05-mass/properties-general.t t/spec/S05-mass/properties-script.t t/spec/S05-mass/recursive.t t/spec/S05-mass/rx.t t/spec/S05-mass/stdrules.t t/spec/S05-match/arrayhash.t t/spec/S05-match/blocks.t t/spec/S05-match/capturing-contexts.t t/spec/S05-match/make.t t/spec/S05-match/non-capturing.t t/spec/S05-match/perl.t t/spec/S05-match/positions.t t/spec/S05-metachars/closure.t t/spec/S05-metachars/line-anchors.t t/spec/S05-metachars/newline.t t/spec/S05-metachars/tilde.t t/spec/S05-metasyntax/angle-brackets.t t/spec/S05-metasyntax/assertions.t t/spec/S05-metasyntax/changed.t t/spec/S05-metasyntax/charset.t t/spec/S05-metasyntax/delimiters.t t/spec/S05-metasyntax/interpolating-closure.t t/spec/S05-metasyntax/litvar.t t/spec/S05-metasyntax/longest-alternative.t t/spec/S05-metasyntax/lookaround.t t/spec/S05-metasyntax/null.t t/spec/S05-metasyntax/proto-token-ltm.t t/spec/S05-metasyntax/regex.t t/spec/S05-metasyntax/repeat.t t/spec/S05-metasyntax/sequential-alternation.t t/spec/S05-metasyntax/single-quotes.t t/spec/S05-metasyntax/unicode-property-pair.t t/spec/S05-metasyntax/unknown.t t/spec/S05-modifier/continue.t t/spec/S05-modifier/counted-match.t t/spec/S05-modifier/counted.t t/spec/S05-modifier/global.t t/spec/S05-modifier/ignorecase-and-ignoremark.t t/spec/S05-modifier/ignorecase.t t/spec/S05-modifier/ignoremark.t t/spec/S05-modifier/ii.t t/spec/S05-modifier/my.t t/spec/S05-modifier/overlapping.t t/spec/S05-modifier/perl5_0.t t/spec/S05-modifier/perl5_1.t t/spec/S05-modifier/perl5_2.t t/spec/S05-modifier/perl5_3.t t/spec/S05-modifier/perl5_4.t t/spec/S05-modifier/perl5_5.t t/spec/S05-modifier/perl5_6.t t/spec/S05-modifier/perl5_7.t t/spec/S05-modifier/perl5_8.t t/spec/S05-modifier/perl5_9.t t/spec/S05-modifier/pos.t t/spec/S05-modifier/repetition-exhaustive.t t/spec/S05-modifier/repetition.t t/spec/S05-modifier/sigspace.t t/spec/S05-substitution/67222.t t/spec/S05-substitution/match.t t/spec/S05-substitution/subst.t t/spec/S05-transliteration/79778.t t/spec/S05-transliteration/trans.t t/spec/S05-transliteration/with-closure.t t/spec/S06-advanced/callframe.t t/spec/S06-advanced/callsame.t t/spec/S06-advanced/lexical-subs.t t/spec/S06-advanced/recurse.t t/spec/S06-advanced/return.t t/spec/S06-advanced/stub.t t/spec/S06-advanced/wrap.t t/spec/S06-currying/assuming-and-mmd.t t/spec/S06-currying/misc.t t/spec/S06-currying/named.t t/spec/S06-currying/positional.t t/spec/S06-currying/slurpy.t t/spec/S06-macros/errors.t t/spec/S06-macros/opaque-ast.t t/spec/S06-macros/quasi-blocks.t t/spec/S06-macros/unquoting.t t/spec/S06-multi/by-trait.t t/spec/S06-multi/lexical-multis.t t/spec/S06-multi/positional-vs-named.t t/spec/S06-multi/proto.t t/spec/S06-multi/redispatch.t t/spec/S06-multi/subsignature.t t/spec/S06-multi/syntax.t t/spec/S06-multi/type-based.t t/spec/S06-multi/unpackability.t t/spec/S06-multi/value-based.t t/spec/S06-operator-overloading/imported-subs.t t/spec/S06-operator-overloading/methods.t t/spec/S06-operator-overloading/semicolon.t t/spec/S06-operator-overloading/sub.t t/spec/S06-operator-overloading/term.t t/spec/S06-operator-overloading/workout.t t/spec/S06-other/anon-hashes-vs-blocks.t t/spec/S06-other/introspection.t t/spec/S06-other/main-eval.t t/spec/S06-other/main-semicolon.t t/spec/S06-other/main.t t/spec/S06-other/main-usage.t t/spec/S06-other/misc.t t/spec/S06-other/pairs-as-lvalues.t t/spec/S06-parameters/smiley.t t/spec/S06-routine-modifiers/lvalue-subroutines.t t/spec/S06-routine-modifiers/native-lvalue-subroutines.t t/spec/S06-routine-modifiers/proxy.t t/spec/S06-routine-modifiers/scoped-named-subs.t t/spec/S06-signature/arity.t t/spec/S06-signature/caller-param.t t/spec/S06-signature/closure-over-parameters.t t/spec/S06-signature/closure-parameters.t t/spec/S06-signature/code.t t/spec/S06-signature/defaults.t t/spec/S06-signature/definite-return.t t/spec/S06-signature/errors.t t/spec/S06-signature/introspection.t t/spec/S06-signature/mixed-placeholders.t t/spec/S06-signature/multidimensional.t t/spec/S06-signature/multi-invocant.t t/spec/S06-signature/named-parameters.t t/spec/S06-signature/named-placeholders.t t/spec/S06-signature/named-renaming.t t/spec/S06-signature/optional.t t/spec/S06-signature/outside-subroutine.t t/spec/S06-signature/passing-arrays.t t/spec/S06-signature/passing-hashes.t t/spec/S06-signature/positional-placeholders.t t/spec/S06-signature/positional.t t/spec/S06-signature/scalar-type.t t/spec/S06-signature/shape.t t/spec/S06-signature/sigilless.t t/spec/S06-signature/slurpy-and-interpolation.t t/spec/S06-signature/slurpy-params.t t/spec/S06-signature/slurpy-placeholders.t t/spec/S06-signature/sub-ref.t t/spec/S06-signature/tree-node-parameters.t t/spec/S06-signature/type-capture.t t/spec/S06-signature/types.t t/spec/S06-signature/unpack-array.t t/spec/S06-signature/unpack-object.t t/spec/S06-signature/unspecified.t t/spec/S06-traits/as.t t/spec/S06-traits/is-assoc.t t/spec/S06-traits/is-copy.t t/spec/S06-traits/is-readonly.t t/spec/S06-traits/is-rw.t t/spec/S06-traits/misc.t t/spec/S06-traits/native-is-copy.t t/spec/S06-traits/native-is-rw.t t/spec/S06-traits/precedence.t t/spec/S06-traits/slurpy-is-rw.t t/spec/S07-hyperrace/hyper.t t/spec/S07-hyperrace/race.t t/spec/S07-slip/slip.t t/spec/S09-autovivification/autoincrement.t t/spec/S09-autovivification/autovivification.t t/spec/S09-hashes/objecthash.t t/spec/S09-multidim/assign.t t/spec/S09-multidim/decl.t t/spec/S09-multidim/indexing.t t/spec/S09-multidim/methods.t t/spec/S09-multidim/subs.t t/spec/S09-multidim/XX-POS-on-dimensioned.t t/spec/S09-multidim/XX-POS-on-undimensioned.t t/spec/S09-subscript/multidim-assignment.t t/spec/S09-subscript/slice.t t/spec/S09-typed-arrays/arrays.t t/spec/S09-typed-arrays/hashes.t t/spec/S09-typed-arrays/native-decl.t t/spec/S09-typed-arrays/native-int.t t/spec/S09-typed-arrays/native-num.t t/spec/S09-typed-arrays/native.t t/spec/S10-packages/basic.t t/spec/S10-packages/joined-namespaces.t t/spec/S10-packages/precompilation.t t/spec/S10-packages/README t/spec/S10-packages/use-with-class.t t/spec/S11-compunit/compunit-dependencyspecification.t t/spec/S11-compunit/compunit-repository.t t/spec/S11-compunit/rt126904.t t/spec/S11-modules/export.t t/spec/S11-modules/importing.t t/spec/S11-modules/import-multi.t t/spec/S11-modules/import.t t/spec/S11-modules/import-tag.t t/spec/S11-modules/InnerModule.pm t/spec/S11-modules/lexical.t t/spec/S11-modules/need.t t/spec/S11-modules/nested.t t/spec/S11-modules/OuterModule.pm t/spec/S11-modules/require.t t/spec/S11-repository/curli-install.t t/spec/S12-attributes/class.t t/spec/S12-attributes/clone.t t/spec/S12-attributes/defaults.t t/spec/S12-attributes/delegation.t t/spec/S12-attributes/inheritance.t t/spec/S12-attributes/instance.t t/spec/S12-attributes/mutators.t t/spec/S12-attributes/native.t t/spec/S12-attributes/recursive.t t/spec/S12-attributes/smiley.t t/spec/S12-attributes/undeclared.t t/spec/S12-class/anonymous.t t/spec/S12-class/attributes-required.t t/spec/S12-class/attributes.t t/spec/S12-class/augment-supersede.t t/spec/S12-class/basic.t t/spec/S12-class/declaration-order.t t/spec/S12-class/extending-arrays.t t/spec/S12-class/inheritance-class-methods.t t/spec/S12-class/inheritance.t t/spec/S12-class/instantiate.t t/spec/S12-class/interface-consistency.t t/spec/S12-class/lexical.t t/spec/S12-class/literal.t t/spec/S12-class/magical-vars.t t/spec/S12-class/mro.t t/spec/S12-class/namespaced.t t/spec/S12-class/open.t t/spec/S12-class/parent_attributes.t t/spec/S12-class/rw.t t/spec/S12-class/self-inheritance.t t/spec/S12-class/stubs.t t/spec/S12-class/type-object.t t/spec/S12-coercion/coercion-types.t t/spec/S12-construction/autopairs.t t/spec/S12-construction/BUILD.t t/spec/S12-construction/construction.t t/spec/S12-construction/named-params-in-BUILD.t t/spec/S12-construction/new.t t/spec/S12-enums/anonymous.t t/spec/S12-enums/as-role.t t/spec/S12-enums/basic.t t/spec/S12-enums/misc.t t/spec/S12-enums/non-int.t t/spec/S12-enums/pseudo-functional.t t/spec/S12-enums/thorough.t t/spec/S12-introspection/attributes.t t/spec/S12-introspection/can.t t/spec/S12-introspection/definite.t t/spec/S12-introspection/meta-class.t t/spec/S12-introspection/methods.t t/spec/S12-introspection/parents.t t/spec/S12-introspection/roles.t t/spec/S12-introspection/walk.t t/spec/S12-introspection/WHAT.t t/spec/S12-meta/DeclareBad.pm t/spec/S12-meta/Declare.pm t/spec/S12-meta/exporthow.t t/spec/S12-meta/grammarhow.t t/spec/S12-meta/InvalidDirective.pm t/spec/S12-meta/primitives.t t/spec/S12-meta/Supersede1.pm t/spec/S12-meta/Supersede2.pm t/spec/S12-meta/SupersedeBad.pm t/spec/S12-methods/accessors.t t/spec/S12-methods/attribute-params.t t/spec/S12-methods/calling_sets.t t/spec/S12-methods/calling_syntax.t t/spec/S12-methods/chaining.t t/spec/S12-methods/class-and-instance.t t/spec/S12-methods/default-trait.t t/spec/S12-methods/defer-call.t t/spec/S12-methods/defer-next.t t/spec/S12-methods/delegation.t t/spec/S12-methods/fallback.t t/spec/S12-methods/how.t t/spec/S12-methods/indirect_notation.t t/spec/S12-methods/instance.t t/spec/S12-methods/lastcall.t t/spec/S12-methods/lvalue.t t/spec/S12-methods/method-vs-sub.t t/spec/S12-methods/multi.t t/spec/S12-methods/parallel-dispatch.t t/spec/S12-methods/private.t t/spec/S12-methods/qualified.t t/spec/S12-methods/submethods.t t/spec/S12-methods/syntax.t t/spec/S12-methods/topic.t t/spec/S12-methods/trusts.t t/spec/S12-methods/typed-attributes.t t/spec/S12-methods/what.t t/spec/S12-subset/multi-dispatch.t t/spec/S12-subset/subtypes.t t/spec/S13-overloading/metaoperators.t t/spec/S13-overloading/operators.t t/spec/S13-overloading/typecasting-long.t t/spec/S13-type-casting/methods.t t/spec/S14-roles/anonymous.t t/spec/S14-roles/attributes.t t/spec/S14-roles/basic.t t/spec/S14-roles/bool.t t/spec/S14-roles/composition.t t/spec/S14-roles/conflicts.t t/spec/S14-roles/crony.t t/spec/S14-roles/instantiation.t t/spec/S14-roles/lexical.t t/spec/S14-roles/mixin.t t/spec/S14-roles/namespaced.t t/spec/S14-roles/parameterized-basic.t t/spec/S14-roles/parameterized-mixin.t t/spec/S14-roles/parameterized-type.t t/spec/S14-roles/parameter-subtyping.t t/spec/S14-roles/stubs.t t/spec/S14-roles/submethods.t t/spec/S14-traits/attributes.t t/spec/S14-traits/routines.t t/spec/S15-literals/identifiers.t t/spec/S15-literals/numbers.t t/spec/S15-nfg/case-change.t t/spec/S15-nfg/cgj.t t/spec/S15-nfg/concatenation.t t/spec/S15-nfg/crlf-encoding.t t/spec/S15-nfg/from-buf.t t/spec/S15-nfg/from-file.t t/spec/S15-nfg/grapheme-break.t t/spec/S15-nfg/grapheme-break-test-gen.p6 t/spec/S15-nfg/long-uni.t t/spec/S15-nfg/many-combiners.t t/spec/S15-nfg/many-threads.t t/spec/S15-nfg/mass-chars.t t/spec/S15-nfg/mass-equality.t t/spec/S15-nfg/mass-roundtrip-nfc.t t/spec/S15-nfg/mass-roundtrip-nfd.t t/spec/S15-nfg/mass-roundtrip-nfkc.t t/spec/S15-nfg/mass-roundtrip-nfkd.t t/spec/S15-nfg/regex.t t/spec/S15-nfg/test-gen.p6 t/spec/S15-normalization/nfc-0.t t/spec/S15-normalization/nfc-1.t t/spec/S15-normalization/nfc-2.t t/spec/S15-normalization/nfc-3.t t/spec/S15-normalization/nfc-4.t t/spec/S15-normalization/nfc-5.t t/spec/S15-normalization/nfc-6.t t/spec/S15-normalization/nfc-7.t t/spec/S15-normalization/nfc-8.t t/spec/S15-normalization/nfc-9.t t/spec/S15-normalization/nfc-sanity.t t/spec/S15-normalization/nfd-0.t t/spec/S15-normalization/nfd-1.t t/spec/S15-normalization/nfd-2.t t/spec/S15-normalization/nfd-3.t t/spec/S15-normalization/nfd-4.t t/spec/S15-normalization/nfd-5.t t/spec/S15-normalization/nfd-6.t t/spec/S15-normalization/nfd-7.t t/spec/S15-normalization/nfd-8.t t/spec/S15-normalization/nfd-9.t t/spec/S15-normalization/nfd-sanity.t t/spec/S15-normalization/nfkc-0.t t/spec/S15-normalization/nfkc-1.t t/spec/S15-normalization/nfkc-2.t t/spec/S15-normalization/nfkc-3.t t/spec/S15-normalization/nfkc-4.t t/spec/S15-normalization/nfkc-5.t t/spec/S15-normalization/nfkc-6.t t/spec/S15-normalization/nfkc-7.t t/spec/S15-normalization/nfkc-8.t t/spec/S15-normalization/nfkc-9.t t/spec/S15-normalization/nfkc-sanity.t t/spec/S15-normalization/nfkd-0.t t/spec/S15-normalization/nfkd-1.t t/spec/S15-normalization/nfkd-2.t t/spec/S15-normalization/nfkd-3.t t/spec/S15-normalization/nfkd-4.t t/spec/S15-normalization/nfkd-5.t t/spec/S15-normalization/nfkd-6.t t/spec/S15-normalization/nfkd-7.t t/spec/S15-normalization/nfkd-8.t t/spec/S15-normalization/nfkd-9.t t/spec/S15-normalization/nfkd-sanity.t t/spec/S15-normalization/test-gen.p6 t/spec/S15-string-types/Str.t t/spec/S15-string-types/Uni.t t/spec/S15-unicode-information/unimatch-general.t t/spec/S15-unicode-information/uniname.t t/spec/S15-unicode-information/uniprop.t t/spec/S15-unicode-information/unival.t t/spec/S16-filehandles/argfiles.t t/spec/S16-filehandles/chmod.t t/spec/S16-filehandles/filestat.t t/spec/S16-filehandles/filetest.t t/spec/S16-filehandles/io_in_for_loops.t t/spec/S16-filehandles/io_in_while_loops.t t/spec/S16-filehandles/io.t t/spec/S16-filehandles/mkdir_rmdir.t t/spec/S16-filehandles/open.t t/spec/S16-filehandles/unlink.t t/spec/S16-io/bare-say.t t/spec/S16-io/basic-open.t t/spec/S16-io/bom.t t/spec/S16-io/comb.t t/spec/S16-io/cwd.t t/spec/S16-io/getc.t t/spec/S16-io/lines.t t/spec/S16-io/newline.t t/spec/S16-io/note.t t/spec/S16-io/print.t t/spec/S16-io/say-and-ref.t t/spec/S16-io/say.t t/spec/S16-io/split.t t/spec/S16-io/supply.t t/spec/S16-io/test-data t/spec/S16-io/tmpdir.t t/spec/S16-io/words.t t/spec/S16-unfiled/rebindstdhandles.t t/spec/S17-channel/basic.t t/spec/S17-lowlevel/lock.t t/spec/S17-lowlevel/thread-start-join-stress.t t/spec/S17-lowlevel/thread.t t/spec/S17-procasync/basic.t t/spec/S17-procasync/kill.t t/spec/S17-procasync/many-processes-no-close-stdin.t t/spec/S17-procasync/no-runaway-file-limit.t t/spec/S17-procasync/print.t t/spec/S17-promise/allof.t t/spec/S17-promise/anyof.t t/spec/S17-promise/at.t t/spec/S17-promise/basic.t t/spec/S17-promise/in.t t/spec/S17-promise/start.t t/spec/S17-promise/stress.t t/spec/S17-promise/then.t t/spec/S17-scheduler/at.t t/spec/S17-scheduler/basic.t t/spec/S17-scheduler/every.t t/spec/S17-scheduler/in.t t/spec/S17-scheduler/times.t t/spec/S17-supply/act.t t/spec/S17-supply/basic.t t/spec/S17-supply/batch.t t/spec/S17-supply/categorize.t t/spec/S17-supply/Channel.t t/spec/S17-supply/classify.t t/spec/S17-supply/delayed.t t/spec/S17-supply/do.t t/spec/S17-supply/elems.t t/spec/S17-supply/flat.t t/spec/S17-supply/from-list.t t/spec/S17-supply/grab.t t/spec/S17-supply/grep.t t/spec/S17-supply/head.t t/spec/S17-supply/interval.t t/spec/S17-supply/lines.t t/spec/S17-supply/list.t t/spec/S17-supply/map.t t/spec/S17-supply/max.t t/spec/S17-supply/merge.t t/spec/S17-supply/migrate.t t/spec/S17-supply/minmax.t t/spec/S17-supply/min.t t/spec/S17-supply/on-demand.t t/spec/S17-supply/produce.t t/spec/S17-supply/Promise.t t/spec/S17-supply/reduce.t t/spec/S17-supply/reverse.t t/spec/S17-supply/rotor.t t/spec/S17-supply/schedule-on.t t/spec/S17-supply/sort.t t/spec/S17-supply/squish.t t/spec/S17-supply/stable.t t/spec/S17-supply/start.t t/spec/S17-supply/syntax.t t/spec/S17-supply/tail.t t/spec/S17-supply/throttle.t t/spec/S17-supply/unique.t t/spec/S17-supply/wait.t t/spec/S17-supply/watch-path.t t/spec/S17-supply/words.t t/spec/S17-supply/zip-latest.t t/spec/S17-supply/zip.t t/spec/S19-command-line/arguments.t t/spec/S19-command-line/dash-e.t t/spec/S19-command-line/help.t t/spec/S19-command-line-options/02-dash-n.t t/spec/S19-command-line-options/03-dash-p.t t/spec/S19-command-line/repl.t t/spec/S22-package-format/local.t t/spec/S24-testing/0-compile.t t/spec/S24-testing/3-output.t t/spec/S24-testing/line-numbers.t t/spec/S24-testing/test-data/line-number-cmp-ok.txt t/spec/S24-testing/test-data/line-number-dies-ok.txt t/spec/S24-testing/test-data/line-number-eval-dies-ok.txt t/spec/S24-testing/test-data/line-number-eval-lives-ok.txt t/spec/S24-testing/test-data/line-number-isa-ok.txt t/spec/S24-testing/test-data/line-number-is_approx.txt t/spec/S24-testing/test-data/line-number-is-deeply.txt t/spec/S24-testing/test-data/line-number-isnt.txt t/spec/S24-testing/test-data/line-number-is.txt t/spec/S24-testing/test-data/line-number-lives-ok.txt t/spec/S24-testing/test-data/line-number-nok.txt t/spec/S24-testing/test-data/line-number-ok.txt t/spec/S24-testing/test-data/line-number-throws-like.txt t/spec/S24-testing/test-data/README t/spec/S24-testing/test-data/todo-passed.txt t/spec/S24-testing/use_ok_test.pm t/spec/S26-documentation/01-delimited.t t/spec/S26-documentation/02-paragraph.t t/spec/S26-documentation/03-abbreviated.t t/spec/S26-documentation/04-code.t t/spec/S26-documentation/05-comment.t t/spec/S26-documentation/06-lists.t t/spec/S26-documentation/07-tables.t t/spec/S26-documentation/08-formattingcodes.t t/spec/S26-documentation/09-configuration.t t/spec/S26-documentation/10-doc-cli.t t/spec/S26-documentation/block-leading.t t/spec/S26-documentation/block-trailing.t t/spec/S26-documentation/module-comment.t t/spec/S26-documentation/multiline-leading.t t/spec/S26-documentation/multiline-trailing.t t/spec/S26-documentation/wacky.t t/spec/S26-documentation/why-both.t t/spec/S26-documentation/why-leading.t t/spec/S26-documentation/why-trailing.t t/spec/S28-named-variables/cwd.t t/spec/S28-named-variables/slangs.t t/spec/S29-any/cmp.t t/spec/S29-any/isa.t t/spec/S29-context/die.t t/spec/S29-context/evalfile.t t/spec/S29-context/eval.t t/spec/S29-context/exit-in-if.t t/spec/S29-context/exit.t t/spec/S29-context/sleep.t t/spec/S29-conversions/hash.t t/spec/S29-conversions/ord_and_chr.t t/spec/S29-os/system.t t/spec/S32-array/adverbs.t t/spec/S32-array/bool.t t/spec/S32-array/create.t t/spec/S32-array/delete-adverb-native.t t/spec/S32-array/delete-adverb.t t/spec/S32-array/delete.t t/spec/S32-array/elems.t t/spec/S32-array/end.t t/spec/S32-array/exists-adverb.t t/spec/S32-array/keys_values.t t/spec/S32-array/kv.t t/spec/S32-array/pairs.t t/spec/S32-array/perl.t t/spec/S32-array/pop.t t/spec/S32-array/push.t t/spec/S32-array/rotate.t t/spec/S32-array/shift.t t/spec/S32-array/splice.t t/spec/S32-array/unshift.t t/spec/S32-basics/warn.t t/spec/S32-basics/xxKEY.t t/spec/S32-basics/xxPOS-native.t t/spec/S32-basics/xxPOS.t t/spec/S32-container/cat.t t/spec/S32-container/roundrobin.t t/spec/S32-container/stringify.t t/spec/S32-container/zip.t t/spec/S32-exceptions/misc.t t/spec/S32-hash/adverbs.t t/spec/S32-hash/antipairs.t t/spec/S32-hash/delete-adverb.t t/spec/S32-hash/delete.t t/spec/S32-hash/exists-adverb.t t/spec/S32-hash/exists.t t/spec/S32-hash/invert.t t/spec/S32-hash/keys_values.t t/spec/S32-hash/kv.t t/spec/S32-hash/pairs.t t/spec/S32-hash/perl.t t/spec/S32-hash/push.t t/spec/S32-hash/slice.t t/spec/S32-io/chdir.t t/spec/S32-io/copy.t t/spec/S32-io/dir.t t/spec/S32-io/empty.txt t/spec/S32-io/file-tests.t t/spec/S32-io/io-handle.t t/spec/S32-io/io-path-cygwin.t t/spec/S32-io/io-path.t t/spec/S32-io/io-path-unix.t t/spec/S32-io/io-path-win.t t/spec/S32-io/IO-Socket-Async.t t/spec/S32-io/IO-Socket-Async-UDP.t t/spec/S32-io/IO-Socket-INET.bat t/spec/S32-io/IO-Socket-INET.pl t/spec/S32-io/IO-Socket-INET.sh t/spec/S32-io/IO-Socket-INET.t t/spec/S32-io/io-spec-cygwin.t t/spec/S32-io/io-spec-unix.t t/spec/S32-io/io-spec-win.t t/spec/S32-io/move.t t/spec/S32-io/native-descriptor.t t/spec/S32-io/note.t t/spec/S32-io/open.t t/spec/S32-io/other.t t/spec/S32-io/pipe.t t/spec/S32-io/pi.txt t/spec/S32-io/rename.t t/spec/S32-io/slurp.t t/spec/S32-io/socket-recv-vs-read.t t/spec/S32-io/socket-test.bin t/spec/S32-io/spurt.t t/spec/S32-list/categorize.t t/spec/S32-list/classify.t t/spec/S32-list/combinations.t t/spec/S32-list/create.t t/spec/S32-list/end.t t/spec/S32-list/first-end-k.t t/spec/S32-list/first-end-p.t t/spec/S32-list/first-end.t t/spec/S32-list/first-end-v.t t/spec/S32-list/first-k.t t/spec/S32-list/first-p.t t/spec/S32-list/first.t t/spec/S32-list/first-v.t t/spec/S32-list/grep-k.t t/spec/S32-list/grep-kv.t t/spec/S32-list/grep-p.t t/spec/S32-list/grep.t t/spec/S32-list/grep-v.t t/spec/S32-list/head.t t/spec/S32-list/join.t t/spec/S32-list/map_function_return_values.t t/spec/S32-list/map.t t/spec/S32-list/minmax.t t/spec/S32-list/numbers.data t/spec/S32-list/permutations.t t/spec/S32-list/pick.t t/spec/S32-list/produce.t t/spec/S32-list/reduce.t t/spec/S32-list/repeated.t t/spec/S32-list/reverse.t t/spec/S32-list/roll.t t/spec/S32-list/rotor.t t/spec/S32-list/seq.t t/spec/S32-list/sort.t t/spec/S32-list/squish.t t/spec/S32-list/tail.t t/spec/S32-list/unique.t t/spec/S32-num/abs.t t/spec/S32-num/base.t t/spec/S32-num/complex.t t/spec/S32-num/cool-num.t t/spec/S32-num/expmod.t t/spec/S32-num/exp.t t/spec/S32-num/fatrat.t t/spec/S32-num/int.t t/spec/S32-num/is-prime.t t/spec/S32-num/log.t t/spec/S32-num/narrow.t t/spec/S32-num/pi.t t/spec/S32-num/polar.t t/spec/S32-num/polymod.t t/spec/S32-num/power.t t/spec/S32-num/rand.t t/spec/S32-num/rat.t t/spec/S32-num/real-bridge.t t/spec/S32-num/roots.t t/spec/S32-num/rounders.t t/spec/S32-num/rshift_pos_amount.t t/spec/S32-num/sign.t t/spec/S32-num/sqrt.t t/spec/S32-num/stringify.t t/spec/S32-num/unpolar.t t/spec/S32-scalar/defined.t t/spec/S32-scalar/perl.t t/spec/S32-scalar/undef.t t/spec/S32-str/append.t t/spec/S32-str/bool.t t/spec/S32-str/capitalize.t t/spec/S32-str/chomp.t t/spec/S32-str/chop.t t/spec/S32-str/comb.t t/spec/S32-str/contains.t t/spec/S32-str/encode.t t/spec/S32-str/ends-with.t t/spec/S32-str/fc.t t/spec/S32-str/flip.t t/spec/S32-str/indent.t t/spec/S32-str/index.t t/spec/S32-str/indices.t t/spec/S32-str/lc.t t/spec/S32-str/length.t t/spec/S32-str/lines.t t/spec/S32-str/numeric.t t/spec/S32-str/ords.t t/spec/S32-str/pack.t t/spec/S32-str/pos.t t/spec/S32-str/rindex.t t/spec/S32-str/samecase.t t/spec/S32-str/samemark.t t/spec/S32-str/split-simple.t t/spec/S32-str/split.t t/spec/S32-str/sprintf-b.t t/spec/S32-str/sprintf.t t/spec/S32-str/starts-with.t t/spec/S32-str/substr-eq.t t/spec/S32-str/substr-rw.t t/spec/S32-str/substr.t t/spec/S32-str/tclc.t t/spec/S32-str/tc.t t/spec/S32-str/trim.t t/spec/S32-str/uc.t t/spec/S32-str/unpack.t t/spec/S32-str/utf8-c8.t t/spec/S32-str/words.t t/spec/S32-temporal/calendar.t t/spec/S32-temporal/Date.t t/spec/S32-temporal/DateTime-Instant-Duration.t t/spec/S32-temporal/DateTime.t t/spec/S32-temporal/local.t t/spec/S32-trig/atan2.t t/spec/S32-trig/cosech.t t/spec/S32-trig/cosec.t t/spec/S32-trig/cosh.t t/spec/S32-trig/cos.t t/spec/S32-trig/cotanh.t t/spec/S32-trig/cotan.t t/spec/S32-trig/e.t t/spec/S32-trig/generate-tests.pl t/spec/S32-trig/pi.t t/spec/S32-trig/sech.t t/spec/S32-trig/sec.t t/spec/S32-trig/simple.t t/spec/S32-trig/sinh.t t/spec/S32-trig/sin.t t/spec/S32-trig/tanh.t t/spec/S32-trig/tan.t t/spec/S32-trig/trig_functions t/spec/S32-trig/TrigTestSupport t/spec/t/01-implname.in t/spec/t/01-implname.out_impl-1 t/spec/t/01-implname.out_impl-2 t/spec/t/02-version.in t/spec/t/02-version.out_v6.0.0 t/spec/t/02-version.out_v6.0.3 t/spec/t/02-version.out_v6.1.0 t/spec/t/03-count.in t/spec/t/03-count.out_v6.0.0 t/spec/t/04-combinations.in t/spec/t/04-combinations.out_impl.1 t/spec/t/04-combinations.out_impl.2 t/spec/t/05-skip.in t/spec/t/05-skip.out_impl-1 t/spec/t/06-todo.in t/spec/t/06-todo.out_impl-1 t/spec/t/07-register_function.in t/spec/t/07-register_function.out_impl-1 t/spectest.data t/spectest.data.6.c t/spec/test_summary t/spec/t/fudge.t t/spec/TODO t/spec/t/README t/spec/VERSION VERSION rakudo-2018.03/README.md0000644000175000017500000001542613253717231013113 0ustar alexalex# Rakudo Perl 6 This is Rakudo Perl 6, a Perl 6 compiler for the MoarVM and JVM. Rakudo Perl 6 is Copyright © 2008-2018, The Perl Foundation. Rakudo Perl 6 is distributed under the terms of the Artistic License 2.0. For more details, see the full text of the license in the file LICENSE. This directory contains only the Rakudo Perl 6 compiler itself; it does not contain any of the modules, documentation, or other items that would normally come with a full Perl 6 distribution. If you're after more than just the bare compiler, please download [the latest Rakudo Star package](http://rakudo.org/downloads/star). Note that different backends implement slightly different sets of features. For a high-level overview of implemented and missing features, please visit [the features page on perl6.org](http://perl6.org/compilers/features). Recent changes and feature additions are documented in the `docs/ChangeLog` text file. To receive important notifications from the core developer team, please subscribe to [the p6lert service](https://alerts.perl6.org) using the RSS feed, twitter, or [the p6lert commandline script](https://github.com/zoffixznet/perl6-p6lert). ## Building and Installing Rakudo [![Build Status](https://travis-ci.org/rakudo/rakudo.svg?branch=master)](https://travis-ci.org/rakudo/rakudo) [![Build status](https://ci.appveyor.com/api/projects/status/github/rakudo/rakudo?svg=true)](https://ci.appveyor.com/project/rakudo/rakudo/branch/master) See the INSTALL.txt file for detailed prerequisites and build and installation instructions. The general process for building is running `perl Configure.pl` with the desired configuration options (common options listed below), and then running `make` or `make install`. Optionally, you may run `make spectest` to test your build on [Roast](http://github.com/perl6/roast), the Official Perl 6 test suite. To update the test suite, run `make spectest_update`. Installation of Rakudo simply requires building and running `make install`. Note that this step is necessary for running Rakudo from outside the build directory. But don't worry, it installs locally by default, so you don't need any administrator privileges for carrying out this step. ### Configuring Rakudo to run on MoarVM To automatically download, build, and install a fresh MoarVM and NQP, run: $ perl Configure.pl --gen-moar --gen-nqp --backends=moar Please be aware, that this will install MoarVM and NQP into your given --prefix before Configure.pl exits. Alternatively, feel free to git clone https://github.com/perl6/nqp and https://github.com/MoarVM/MoarVM manually and install them individually. Configuration flags can be passed to MoarVM's Configure.pl using the --moar-option flag. For example, if you wish to use Clang when GCC is the default compiler selected for your OS, use the --compiler flag: $ perl Configure.pl --gen-moar --moar-option='--compiler=clang' \ --gen-nqp --backends=moar If the compiler you want to use isn't known by MoarVM or you have multiple versions of the same compiler installed, the --cc flag can be used to pass its exact binary: $ perl Configure.pl --gen-moar --moar-option='--cc=egcc' \ --gen-nqp --backends=moar Custom optimization and debugging levels may also be passed through: $ perl Configure.pl --gen-moar --moar-option='--optimize=0 --debug=3' \ --gen-nqp --backends=moar For more information on how MoarVM can be configured, view MoarVM's Configure.pl. ### Configuring Rakudo to run on the JVM Note that to run Rakudo on JVM, JDK 1.8 must be installed. To automatically download, build, and install a fresh NQP, run: $ perl Configure.pl --gen-nqp --backends=jvm If you get an out of memory error building rakudo on the JVM, you may need to modify your NQP runner to limit memory use. e.g. edit the nqp-j / nqp-j.bat executable (found wherever you installed to, or in the `install/bin` directory) to include `-Xms500m -Xmx2g` as options passed to java. Please be aware, that this will install NQP into your given --prefix before Configure.pl exits. Alternatively, feel free to git clone https://github.com/perl6/nqp manually and install it individually. ### Multiple backends at the same time By supplying combinations of backends to the `--backends` flag, you can get two or three backends built in the same prefix. The first backend you supply in the list is the one that gets the `perl6` name as a symlink, and all backends are installed separately as `perl6-m` or `perl6-j` for Rakudo on MoarVM, or JVM respectively. The format for the `--backends` flag is: $ perl Configure.pl --backends=moar,jvm $ perl Configure.pl --backends=ALL ## Where to get help or answers to questions There are several mailing lists, IRC channels, and wikis available with help for Perl 6 and Rakudo. Figuring out the right one to use is often the biggest battle. Here are some rough guidelines: The central hub for Perl 6 information is [perl6.org](http://perl6.org/). This is always a good starting point. If you have a question about Perl 6 syntax or the right way to approach a problem using Perl 6, you probably want the “perl6-users@perl.org” mailing list or the [irc.freenode.net/#perl6 IRC channel](https://webchat.freenode.net/?channels=#perl6). The perl6-users list is primarily for the people who want to use Perl 6 to write programs, so newbie questions are welcomed there. Newbie questions are also welcome on the #perl6 channel; the Rakudo and Perl 6 development teams tend to hang out there and are generally glad to help. You can follow [@perl6org](https://twitter.com/perl6org) and on Twitter, there's a Perl 6 news aggregator at [Planet Perl 6](http://pl6anet.org/). Questions about NQP can also be posted to the #perl6 IRC channel. For questions about MoarVM, you can join #moarvm on freenode. ## Reporting bugs Please see https://github.com/rakudo/rakudo/wiki/rt-introduction for more information about how and where to report issues with Rakudo, its components, and the Perl 6 language specification. ## Submitting patches If you have a patch that fixes a bug or adds a new feature, please create a pull request using github's pull request infrastructure. See [our contribution guidelines](https://github.com/rakudo/rakudo/blob/master/CONTRIBUTING.md) for more information. ## Line editing and tab completion If you would like simple history and tab completion in the perl6 executable, you need to install the Linenoise module. The recommended way to install Linenoise is via [zef](https://github.com/ugexe/zef): $ zef install Linenoise An alternative is to use a third-party program such as [rlwrap](http://utopia.knoware.nl/~hlub/uck/rlwrap/#rlwrap). ## AUTHOR Jonathan Worthington is the current pumpking for Rakudo Perl 6. See CREDITS for the many people that have contributed to the development of the Rakudo compiler. rakudo-2018.03/src/core/allomorphs.pm60000644000175000017500000005503113253717231016153 0ustar alexalex# the uses of add_I in this class are a trick to make bigints work right my class IntStr is Int is Str { method new(Int:D $i, Str:D $s) { my \SELF = nqp::add_I($i, 0, self); nqp::bindattr_s(SELF, Str, '$!value', $s); SELF; } multi method ACCEPTS(IntStr:D: Any:D \a) { nqp::if( nqp::istype(a, Numeric), self.Int.ACCEPTS(a), nqp::if( nqp::istype(a, Str), self.Str.ACCEPTS(a), self.Str.ACCEPTS(a) && self.Int.ACCEPTS(a))) } multi method Numeric(IntStr:D:) { self.Int } multi method Numeric(IntStr:U:) { self.Mu::Numeric; # issue warning; 0 } multi method Real(IntStr:D:) { self.Int } multi method Real(IntStr:U:) { self.Mu::Real; # issue warning; 0 } method Int(IntStr:D:) { nqp::add_I(self, 0, Int) } multi method Str(IntStr:D:) { nqp::getattr_s(self, Str, '$!value') } multi method perl(IntStr:D:) { self.^name ~ '.new(' ~ self.Int.perl ~ ', ' ~ self.Str.perl ~ ')' } } my class NumStr is Num is Str { method new(Num $n, Str $s) { my \SELF = nqp::create(self); nqp::bindattr_n(SELF, Num, '$!value', $n); nqp::bindattr_s(SELF, Str, '$!value', $s); SELF; } multi method ACCEPTS(NumStr:D: Any:D \a) { nqp::if( nqp::istype(a, Numeric), self.Num.ACCEPTS(a), nqp::if( nqp::istype(a, Str), self.Str.ACCEPTS(a), self.Str.ACCEPTS(a) && self.Num.ACCEPTS(a))) } multi method Numeric(NumStr:D:) { self.Num } multi method Numeric(NumStr:U:) { self.Mu::Numeric; # issue warning; 0e0 } multi method Real(NumStr:D:) { self.Num } multi method Real(NumStr:U:) { self.Mu::Real; # issue warning; 0e0 } method Num(NumStr:D:) { nqp::getattr_n(self, Num, '$!value') } multi method Str(NumStr:D:) { nqp::getattr_s(self, Str, '$!value') } multi method perl(NumStr:D:) { self.^name ~ '.new(' ~ self.Num.perl ~ ', ' ~ self.Str.perl ~ ')' } } my class RatStr is Rat is Str { method new(Rat $r, Str $s) { my \SELF = nqp::create(self); nqp::bindattr(SELF, Rat, '$!numerator', $r.numerator); nqp::bindattr(SELF, Rat, '$!denominator', $r.denominator); nqp::bindattr_s(SELF, Str, '$!value', $s); SELF; } multi method ACCEPTS(RatStr:D: Any:D \a) { nqp::if( nqp::istype(a, Numeric), self.Rat.ACCEPTS(a), nqp::if( nqp::istype(a, Str), self.Str.ACCEPTS(a), self.Str.ACCEPTS(a) && self.Rat.ACCEPTS(a))) } method succ(RatStr:D: --> Rat:D) { nqp::p6bindattrinvres( nqp::p6bindattrinvres(nqp::create(Rat), Rat, '$!numerator', nqp::add_I( nqp::getattr(self, Rat, '$!numerator'), nqp::getattr(self, Rat, '$!denominator'), Int)), Rat, '$!denominator', nqp::getattr(self, Rat, '$!denominator')) } method pred(RatStr:D: --> Rat:D) { nqp::p6bindattrinvres( nqp::p6bindattrinvres(nqp::create(Rat), Rat, '$!numerator', nqp::sub_I( nqp::getattr(self, Rat, '$!numerator'), nqp::getattr(self, Rat, '$!denominator'), Int)), Rat, '$!denominator', nqp::getattr(self, Rat, '$!denominator')) } method Capture(RatStr:D:) { self.Mu::Capture } multi method Numeric(RatStr:D:) { self.Rat } multi method Numeric(RatStr:U:) { self.Mu::Numeric; # issue warning; 0.0 } multi method Real(RatStr:D:) { self.Rat } multi method Real(RatStr:U:) { self.Mu::Real; # issue warning; 0.0 } method Rat(RatStr:D:) { Rat.new(nqp::getattr(self, Rat, '$!numerator'), nqp::getattr(self, Rat, '$!denominator')) } multi method Str(RatStr:D:) { nqp::getattr_s(self, Str, '$!value') } multi method perl(RatStr:D:) { self.^name ~ '.new(' ~ self.Rat.perl ~ ', ' ~ self.Str.perl ~ ')' } } my class ComplexStr is Complex is Str { method new(Complex $c, Str $s) { my \SELF = nqp::create(self); nqp::bindattr_n(SELF, Complex, '$!re', $c.re); nqp::bindattr_n(SELF, Complex, '$!im', $c.im); nqp::bindattr_s(SELF, Str, '$!value', $s); SELF; } multi method ACCEPTS(ComplexStr:D: Any:D \a) { nqp::if( nqp::istype(a, Numeric), self.Complex.ACCEPTS(a), nqp::if( nqp::istype(a, Str), self.Str.ACCEPTS(a), self.Str.ACCEPTS(a) && self.Complex.ACCEPTS(a))) } method Capture(ComplexStr:D:) { self.Mu::Capture } multi method Numeric(ComplexStr:D:) { self.Complex } multi method Numeric(ComplexStr:U:) { self.Mu::Numeric; # issue warning; <0+0i> } multi method Real(ComplexStr:D:) { self.Complex.Real } multi method Real(ComplexStr:U:) { self.Mu::Real; # issue warning; <0+0i>.Real } method Complex(ComplexStr:D:) { Complex.new(nqp::getattr_n(self, Complex, '$!re'), nqp::getattr_n(self, Complex, '$!im')) } multi method Str(ComplexStr:D:) { nqp::getattr_s(self, Str, '$!value') } multi method perl(ComplexStr:D:) { self.^name ~ '.new(' ~ self.Complex.perl ~ ', ' ~ self.Str.perl ~ ')' } } # we define cmp ops for these allomorphic types as numeric first, then Str. If # you want just one half of the cmp, you'll need to coerce the args multi sub infix:(IntStr:D $a, IntStr:D $b) { $a.Int cmp $b.Int || $a.Str cmp $b.Str } multi sub infix:(IntStr:D $a, RatStr:D $b) { $a.Int cmp $b.Rat || $a.Str cmp $b.Str } multi sub infix:(IntStr:D $a, NumStr:D $b) { $a.Int cmp $b.Num || $a.Str cmp $b.Str } multi sub infix:(IntStr:D $a, ComplexStr:D $b) { $a.Int cmp $b.Complex || $a.Str cmp $b.Str } multi sub infix:(RatStr:D $a, IntStr:D $b) { $a.Rat cmp $b.Int || $a.Str cmp $b.Str } multi sub infix:(RatStr:D $a, RatStr:D $b) { $a.Rat cmp $b.Rat || $a.Str cmp $b.Str } multi sub infix:(RatStr:D $a, NumStr:D $b) { $a.Rat cmp $b.Num || $a.Str cmp $b.Str } multi sub infix:(RatStr:D $a, ComplexStr:D $b) { $a.Rat cmp $b.Complex || $a.Str cmp $b.Str } multi sub infix:(NumStr:D $a, IntStr:D $b) { $a.Num cmp $b.Int || $a.Str cmp $b.Str } multi sub infix:(NumStr:D $a, RatStr:D $b) { $a.Num cmp $b.Rat || $a.Str cmp $b.Str } multi sub infix:(NumStr:D $a, NumStr:D $b) { $a.Num cmp $b.Num || $a.Str cmp $b.Str } multi sub infix:(NumStr:D $a, ComplexStr:D $b) { $a.Num cmp $b.Complex || $a.Str cmp $b.Str } multi sub infix:(ComplexStr:D $a, IntStr:D $b) { $a.Complex cmp $b.Int || $a.Str cmp $b.Str } multi sub infix:(ComplexStr:D $a, RatStr:D $b) { $a.Complex cmp $b.Rat || $a.Str cmp $b.Str } multi sub infix:(ComplexStr:D $a, NumStr:D $b) { $a.Complex cmp $b.Num || $a.Str cmp $b.Str } multi sub infix:(ComplexStr:D $a, ComplexStr:D $b) { $a.Complex cmp $b.Complex || $a.Str cmp $b.Str } multi sub infix:(IntStr:D $a, IntStr:D $b) { $a.Int eqv $b.Int && $a.Str eqv $b.Str } multi sub infix:(IntStr:D $a, RatStr:D $b --> False) {} multi sub infix:(IntStr:D $a, NumStr:D $b --> False) {} multi sub infix:(IntStr:D $a, ComplexStr:D $b --> False) {} multi sub infix:(RatStr:D $a, IntStr:D $b --> False) {} multi sub infix:(RatStr:D $a, RatStr:D $b) { $a.Rat eqv $b.Rat && $a.Str eqv $b.Str } multi sub infix:(RatStr:D $a, NumStr:D $b --> False) {} multi sub infix:(RatStr:D $a, ComplexStr:D $b --> False) {} multi sub infix:(NumStr:D $a, IntStr:D $b --> False) {} multi sub infix:(NumStr:D $a, RatStr:D $b --> False) {} multi sub infix:(NumStr:D $a, NumStr:D $b) { $a.Num eqv $b.Num && $a.Str eqv $b.Str } multi sub infix:(NumStr:D $a, ComplexStr:D $b --> False) {} multi sub infix:(ComplexStr:D $a, IntStr:D $b --> False) {} multi sub infix:(ComplexStr:D $a, RatStr:D $b --> False) {} multi sub infix:(ComplexStr:D $a, NumStr:D $b --> False) {} multi sub infix:(ComplexStr:D $a, ComplexStr:D $b) { $a.Complex eqv $b.Complex && $a.Str eqv $b.Str } multi sub infix:<===>(IntStr:D $a, IntStr:D $b) { $a.Int === $b.Int && $a.Str === $b.Str } multi sub infix:<===>(RatStr:D $a, RatStr:D $b) { $a.Rat === $b.Rat && $a.Str === $b.Str } multi sub infix:<===>(NumStr:D $a, NumStr:D $b) { $a.Num === $b.Num && $a.Str === $b.Str } multi sub infix:<===>(ComplexStr:D $a, ComplexStr:D $b) { $a.Complex === $b.Complex && $a.Str === $b.Str } multi sub val(*@maybevals) { @maybevals.list.map({ val($_) }).eager; } multi sub val(Mu) { warn "Value of type Mu uselessly passed to val()"; Mu } # if Slip, preserve slipness multi sub val(List:D $maybevals) { nqp::stmts( (my $output := val(|$maybevals)), nqp::if( nqp::istype($maybevals, Slip), $output.Slip, $output ) ) } multi sub val(Pair:D \ww-thing) is raw { # this is a Pair object possible in «» constructs; just pass it through. We # capture this specially from the below sub to avoid emitting a warning # whenever an affected «» construct is being processed. ww-thing } multi sub val(\one-thing) { warn "Value of type {one-thing.WHAT.perl} uselessly passed to val()"; one-thing; } multi sub val(Str:D $MAYBEVAL, :$val-or-fail) { # TODO: # * Additional numeric styles: # + fractions in [] radix notation: :100[10,'.',53] # * Performance tuning # * Fix remaining XXXX my str $str = nqp::unbox_s($MAYBEVAL); my int $eos = nqp::chars($str); return IntStr.new(0,"") unless $eos; # handle "" # S02:3276-3277: Ignore leading and trailing whitespace my int $pos = nqp::findnotcclass(nqp::const::CCLASS_WHITESPACE, $str, 0, $eos); my int $end = nqp::sub_i($eos, 1); $end = nqp::sub_i($end, 1) while nqp::isge_i($end, $pos) && nqp::iscclass(nqp::const::CCLASS_WHITESPACE, $str, $end); # Fail all the way out when parse failures occur. Return the original # string, or a failure if we're Str.Numeric my &parse_fail := -> \msg { $val-or-fail ?? fail X::Str::Numeric.new(:source($MAYBEVAL),:reason(msg),:$pos) !! return $MAYBEVAL } # Str.Numeric should handle blank string before val() parse_fail "Empty string not properly caught before val()" if nqp::islt_i($end, $pos); # Reset end-of-string after trimming $eos = nqp::add_i($end, 1); # return an appropriate type when we've found a number. Allomorphic unless # Str.Numeric is calling my &parse_win := -> \newval { $val-or-fail ?? return newval !! nqp::istype(newval, Num) ?? return NumStr.new(newval, $MAYBEVAL) !! nqp::istype(newval, Rat) ?? return RatStr.new(newval, $MAYBEVAL) !! nqp::istype(newval, Complex) ?? return ComplexStr.new(newval, $MAYBEVAL) !! nqp::istype(newval, Int) ?? return IntStr.new(newval, $MAYBEVAL) !! die "Unknown type {newval.^name} found in val() processing" } my sub parse-simple-number() { # Handle NaN here, to make later parsing simpler if nqp::eqat($str,'NaN',$pos) { $pos = nqp::add_i($pos, 3); return nqp::p6box_n(nqp::nan()); } # Handle any leading +/-/− sign my int $ch = nqp::ord($str, $pos); my int $neg = nqp::iseq_i($ch, 45) || nqp::iseq_i($ch, 8722); # '-', '−' if $neg || nqp::iseq_i($ch, 43) { # '-', '−', '+' $pos = nqp::add_i($pos, 1); $ch = nqp::islt_i($pos, $eos) && nqp::ord($str, $pos); } # nqp::radix_I parse results, and helper values my Mu $parse; my str $prefix; my int $radix; my int $p; my sub parse-int-frac-exp() { # Integer part, if any my Int $int := 0; if nqp::isne_i($ch, 46) { # '.' parse_fail "Cannot convert radix of $radix (max 36)" if nqp::isgt_i($radix, 36); $parse := nqp::radix_I($radix, $str, $pos, $neg, Int); $p = nqp::atpos($parse, 2); parse_fail "base-$radix number must begin with valid digits or '.'" if nqp::iseq_i($p, -1); $pos = $p; $int := nqp::atpos($parse, 0); nqp::isge_i($pos, $eos) ?? return $int !! ($ch = nqp::ord($str, $pos)); } # Fraction, if any my Int $frac := 0; my Int $base := 0; if nqp::iseq_i($ch, 46) { # '.' $pos = nqp::add_i($pos, 1); $parse := nqp::radix_I($radix, $str, $pos, nqp::add_i($neg, 4), Int); $p = nqp::atpos($parse, 2); parse_fail 'radix point must be followed by one or more valid digits' if nqp::iseq_i($p, -1); $pos = $p; $frac := nqp::atpos($parse, 0); $base := nqp::atpos($parse, 1); $ch = nqp::islt_i($pos, $eos) && nqp::ord($str, $pos); } # Exponent, if 'E' or 'e' are present (forces return type Num) if nqp::iseq_i($ch, 69) || nqp::iseq_i($ch, 101) { # 'E', 'e' parse_fail "'E' or 'e' style exponent only allowed on decimal (base-10) numbers, not base-$radix" unless nqp::iseq_i($radix, 10); $pos = nqp::add_i($pos, 1); # handle the sign # XXX TODO: teach radix_I to handle '−' (U+2212) minus? my int $ch = nqp::islt_i($pos, $eos) && nqp::ord($str, $pos); my int $neg-e = nqp::if( nqp::iseq_i($ch, 43), # '+' nqp::stmts(($pos = nqp::add_i($pos, 1)), 0), nqp::if( # '-', '−' nqp::iseq_i($ch, 45) || nqp::iseq_i($ch, 8722), nqp::stmts(($pos = nqp::add_i($pos, 1)), 1), 0, ) ); $parse := nqp::radix_I(10, $str, $pos, $neg-e, Int); $p = nqp::atpos($parse, 2); parse_fail "'E' or 'e' must be followed by decimal (base-10) integer" if nqp::iseq_i($p, -1); $pos = $p; return nqp::p6box_n(nqp::mul_n( $frac ?? nqp::add_n( $int.Num, nqp::div_n($frac.Num, $base.Num) ) !! $int.Num, nqp::pow_n(10e0, nqp::atpos($parse, 0).Num) )) # if we have a zero, handle the sign correctly || nqp::if(nqp::iseq_i($neg, 1), -0e0, 0e0); } # Multiplier with exponent, if single '*' is present # (but skip if current token is '**', as otherwise we # get recursive multiplier parsing stupidity) if nqp::iseq_i($ch, 42) && nqp::isne_s(substr($str, $pos, 2), '**') { # '*' $pos = nqp::add_i($pos, 1); my $mult_base := parse-simple-number(); parse_fail "'*' multiplier base must be an integer" unless nqp::istype($mult_base, Int); parse_fail "'*' multiplier base must be followed by '**' and exponent" unless nqp::eqat($str,'**',$pos); $pos = nqp::add_i($pos, 2); my $mult_exp := parse-simple-number(); parse_fail "'**' multiplier exponent must be an integer" unless nqp::istype($mult_exp, Int); my $mult := $mult_base ** $mult_exp; $int := $int * $mult; $frac := $frac * $mult; } # Return an Int if there was no radix point, otherwise, return a Rat nqp::unless($base, $int, Rat.new($int * $base + $frac, $base)); } # Look for radix specifiers if nqp::iseq_i($ch, 58) { # ':' # A string of the form :16 or :60[12,34,56] $pos = nqp::add_i($pos, 1); $parse := nqp::radix_I(10, $str, $pos, 0, Int); $p = nqp::atpos($parse, 2); parse_fail "radix (in decimal) expected after ':'" if nqp::iseq_i($p, -1); $pos = $p; $radix = nqp::atpos($parse, 0); $ch = nqp::islt_i($pos, $eos) && nqp::ord($str, $pos); if nqp::iseq_i($ch, 60) { # '<' $pos = nqp::add_i($pos, 1); my $result := parse-int-frac-exp(); parse_fail "malformed ':$radix<>' style radix number, expecting '>' after the body" unless nqp::islt_i($pos, $eos) && nqp::iseq_i(nqp::ord($str, $pos), 62); # '>' $pos = nqp::add_i($pos, 1); return $result; } elsif nqp::iseq_i($ch, 171) { # '«' $pos = nqp::add_i($pos, 1); my $result := parse-int-frac-exp(); parse_fail "malformed ':$radix«»' style radix number, expecting '»' after the body" unless nqp::islt_i($pos, $eos) && nqp::iseq_i(nqp::ord($str, $pos), 187); # '»' $pos = nqp::add_i($pos, 1); return $result; } elsif nqp::iseq_i($ch, 91) { # '[' $pos = nqp::add_i($pos, 1); my Int $result := 0; my Int $digit := 0; while nqp::islt_i($pos, $eos) && nqp::isne_i(nqp::ord($str, $pos), 93) { # ']' $parse := nqp::radix_I(10, $str, $pos, 0, Int); $p = nqp::atpos($parse, 2); parse_fail "malformed ':$radix[]' style radix number, expecting comma separated decimal values after opening '['" if nqp::iseq_i($p, -1); $pos = $p; $digit := nqp::atpos($parse, 0); parse_fail "digit is larger than {$radix - 1} in ':$radix[]' style radix number" if nqp::isge_i($digit, $radix); $result := $result * $radix + $digit; $pos = nqp::add_i($pos, 1) if nqp::islt_i($pos, $eos) && nqp::iseq_i(nqp::ord($str, $pos), 44); # ',' } parse_fail "malformed ':$radix[]' style radix number, expecting ']' after the body" unless nqp::islt_i($pos, $eos) && nqp::iseq_i(nqp::ord($str, $pos), 93); # ']' $pos = nqp::add_i($pos, 1); # XXXX: Handle fractions! # XXXX: Handle exponents! return $neg ?? -$result !! $result; } else { parse_fail "malformed ':$radix' style radix number, expecting '<' or '[' after the base"; } } elsif nqp::iseq_i($ch, 48) # '0' and $radix = nqp::index(' b o d x', nqp::substr($str, nqp::add_i($pos, 1), 1)) and nqp::isge_i($radix, 2) { # A string starting with 0x, 0d, 0o, or 0b, # followed by one optional '_' $pos = nqp::add_i($pos, 2); $pos = nqp::add_i($pos, 1) if nqp::islt_i($pos, $eos) && nqp::iseq_i(nqp::ord($str, $pos), 95); # '_' parse-int-frac-exp(); } elsif nqp::eqat($str,'Inf',$pos) { # 'Inf' $pos = nqp::add_i($pos, 3); $neg ?? -Inf !! Inf; } else { # Last chance: a simple decimal number $radix = 10; parse-int-frac-exp(); } } my sub parse-real() { # Parse a simple number or a Rat numerator my $result := parse-simple-number(); return $result if nqp::iseq_i($pos, $eos); # Check for '/' indicating Rat denominator if nqp::iseq_i(nqp::ord($str, $pos), 47) { # '/' $pos = nqp::add_i($pos, 1); parse_fail "denominator expected after '/'" unless nqp::islt_i($pos, $eos); my $denom := parse-simple-number(); $result := nqp::istype($result, Int) && nqp::istype($denom, Int) ?? Rat.new($result, $denom) !! $result / $denom; } $result; } # Parse a real number, magnitude of a pure imaginary number, # or real part of a complex number my $result := parse-real(); parse_win $result if nqp::iseq_i($pos, $eos); # Check for 'i' or '\\i' indicating first parsed number was # the magnitude of a pure imaginary number if nqp::iseq_i(nqp::ord($str, $pos), 105) { # 'i' parse_fail "Imaginary component of 'NaN' or 'Inf' must be followed by \\i" if nqp::isnanorinf($result.Num); $pos = nqp::add_i($pos, 1); $result := Complex.new(0, $result); } elsif nqp::eqat($str,'\\i',$pos) { $pos = nqp::add_i($pos, 2); $result := Complex.new(0, $result); } # Check for '+' or '-' indicating first parsed number was # the real part of a complex number elsif nqp::iseq_i(nqp::ord($str, $pos), 45) # '-' || nqp::iseq_i(nqp::ord($str, $pos), 43) # '+' || nqp::iseq_i(nqp::ord($str, $pos), 8722) { # '−' # Don't move $pos -- we want parse-real() to see the sign my $im := parse-real(); parse_fail "imaginary part of complex number must be followed by 'i' or '\\i'" unless nqp::islt_i($pos, $eos); if nqp::iseq_i(nqp::ord($str, $pos), 105) { # 'i' parse_fail "Imaginary component of 'NaN' or 'Inf' must be followed by \\i" if nqp::isnanorinf($im.Num); $pos = nqp::add_i($pos, 1); } elsif nqp::eqat($str,'\\i',$pos) { $pos = nqp::add_i($pos, 2); } else { parse_fail "imaginary part of complex number must be followed by 'i' or '\\i'" } $result := Complex.new($result, $im); } # Check for trailing garbage parse_fail "trailing characters after number" if nqp::islt_i($pos, $eos); parse_win $result; } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Any-iterable-methods.pm60000644000175000017500000021114113253717231017744 0ustar alexalex# Now that Iterable is defined, we add extra methods into Any for the list # operations. (They can't go into Any right away since we need Attribute to # define the various roles, and Attribute inherits from Any. We will do a # re-compose of Attribute to make sure it gets the list methods at the end # of this file. Note the general pattern for these list-y methods is that # they check if they have an Iterable already, and if not obtain one to # work on by doing a .list coercion. use MONKEY-TYPING; augment class Any { proto method map(|) is nodal {*} multi method map(Hash \h) { die "Cannot map a {self.^name} to a {h.^name}. Did you mean to add a stub (\{...\}) or did you mean to .classify?" } multi method map(\SELF: █; :$label, :$item) { sequential-map(($item ?? (SELF,) !! SELF).iterator, &block, $label); } my class IterateOneWithPhasers does SlippyIterator { has &!block; has $!source; has $!label; has Int $!NEXT; # SHOULD BE int, but has Int performs better has Int $!did-init; # SHOULD BE int, but has Int performs better has Int $!did-iterate; # SHOULD BE int, but has Int performs better method !SET-SELF(\block,\source,\label) { nqp::stmts( (&!block := block), ($!source := source), ($!label := label), ($!NEXT = block.has-phaser('NEXT')), self ) } method new(\bl,\sou,\la) { nqp::create(self)!SET-SELF(bl,sou,la) } method is-lazy() { $!source.is-lazy } method pull-one() is raw { my int $stopped; my $value; my $result; nqp::unless( $!did-init, nqp::stmts( ($!did-init = 1), nqp::if( &!block.has-phaser('FIRST'), nqp::p6setfirstflag(&!block) ) ) ); if $!slipping && nqp::not_i(nqp::eqaddr(($result := self.slip-one),IterationEnd)) { # $result will be returned at the end } elsif nqp::eqaddr(($value := $!source.pull-one),IterationEnd) { $result := IterationEnd } else { nqp::until( $stopped, nqp::handle( nqp::stmts( ($stopped = 1), ($result := &!block($value)), ($!did-iterate = 1), nqp::if( nqp::istype($result, Slip), nqp::if( nqp::eqaddr(($result := self.start-slip($result)), IterationEnd), nqp::if( nqp::not_i(nqp::eqaddr(($value := $!source.pull-one),IterationEnd)), ($stopped = 0) ), ) ), nqp::if($!NEXT, &!block.fire_phasers('NEXT')), ), 'LABELED', $!label, 'NEXT', nqp::stmts( ($!did-iterate = 1), nqp::if($!NEXT, &!block.fire_phasers('NEXT')), nqp::eqaddr(($value := $!source.pull-one), IterationEnd) ?? ($result := IterationEnd) !! ($stopped = 0) ), 'REDO', ($stopped = 0), 'LAST', nqp::stmts( ($!did-iterate = 1), ($result := IterationEnd) ) ), :nohandler ) } nqp::if( $!did-iterate && nqp::eqaddr($result,IterationEnd), &!block.fire_if_phasers('LAST') ); $result } method push-all($target --> IterationEnd) { nqp::unless( $!did-init, nqp::stmts( ($!did-init = 1), nqp::if( &!block.has-phaser('FIRST'), nqp::p6setfirstflag(&!block) ) ) ); my int $stopped; my int $done; my $pulled; my $value; nqp::if( $!slipping, nqp::until( nqp::eqaddr(($value := self.slip-one),IterationEnd), $target.push($value) ) ); until $done || nqp::eqaddr(($value := $!source.pull-one),IterationEnd) { nqp::stmts( ($stopped = 0), nqp::until( $stopped, nqp::stmts( ($stopped = 1), nqp::handle( nqp::stmts( # doesn't sink ($pulled := &!block($value)), ($!did-iterate = 1), nqp::if($!NEXT, &!block.fire_phasers('NEXT')), nqp::if( nqp::istype($pulled,Slip), self.slip-all($pulled,$target), $target.push($pulled) ) ), 'LABELED', $!label, 'NEXT', nqp::stmts( ($!did-iterate = 1), nqp::if($!NEXT, &!block.fire_phasers('NEXT')), nqp::eqaddr( ($value := $!source.pull-one), IterationEnd ) ?? ($done = 1) !! ($stopped = 0)), 'REDO', ($stopped = 0), 'LAST', ($done = $!did-iterate = 1) ) ), :nohandler ) ) } nqp::if($!did-iterate,&!block.fire_if_phasers('LAST')) } method sink-all(--> IterationEnd) { nqp::unless( $!did-init, nqp::stmts( ($!did-init = 1), nqp::if( &!block.has-phaser('FIRST'), nqp::p6setfirstflag(&!block) ) ) ); nqp::if( $!slipping, nqp::until( nqp::eqaddr(self.slip-one,IterationEnd), nqp::null ) ); my int $stopped; my int $done; my $value; until $done || nqp::eqaddr(($value := $!source.pull-one()),IterationEnd) { nqp::stmts( ($stopped = 0), nqp::until( $stopped, nqp::stmts( ($stopped = 1), nqp::handle( nqp::stmts( # doesn't sink (&!block($value)), ($!did-iterate = 1), nqp::if($!NEXT, &!block.fire_phasers('NEXT')), ), 'LABELED', $!label, 'NEXT', nqp::stmts( ($!did-iterate = 1), nqp::if($!NEXT, &!block.fire_phasers('NEXT')), nqp::eqaddr( ($value := $!source.pull-one), IterationEnd ) ?? ($done = 1) !! ($stopped = 0)), 'REDO', ($stopped = 0), 'LAST', ($done = $!did-iterate = 1) ) ), :nohandler ) ) } nqp::if($!did-iterate,&!block.fire_if_phasers('LAST')) } } my class IterateOneNotSlippingWithoutPhasers does Iterator { has &!block; has $!source; has $!label; method new(&block,$source,$label) { my $iter := nqp::create(self); nqp::bindattr($iter, self, '&!block', &block); nqp::bindattr($iter, self, '$!source', $source); nqp::bindattr($iter, self, '$!label', nqp::decont($label)); $iter } method is-lazy() { $!source.is-lazy } method pull-one() is raw { if nqp::eqaddr((my $pulled := $!source.pull-one),IterationEnd) { IterationEnd } else { my $result; my int $stopped; nqp::stmts( nqp::until( $stopped, nqp::stmts( ($stopped = 1), nqp::handle( ($result := &!block($pulled)), 'LABELED', $!label, 'NEXT', nqp::if( nqp::eqaddr( ($pulled := $!source.pull-one), IterationEnd ), ($result := IterationEnd), ($stopped = 0) ), 'REDO', ($stopped = 0), 'LAST', ($result := IterationEnd) ), ), :nohandler ), $result ) } } method push-all($target --> IterationEnd) { my $pulled; my int $stopped; nqp::until( nqp::eqaddr(($pulled := $!source.pull-one),IterationEnd), nqp::stmts( ($stopped = 0), nqp::until( $stopped, nqp::stmts( ($stopped = 1), nqp::handle( $target.push(&!block($pulled)), 'LABELED', $!label, 'REDO', ($stopped = 0), 'NEXT', nqp::null, # need NEXT for next LABEL support 'LAST', return ) ), :nohandler ) ) ) } method sink-all(--> IterationEnd) { my $pulled; my int $stopped; nqp::until( nqp::eqaddr(($pulled := $!source.pull-one),IterationEnd), nqp::stmts( ($stopped = 0), nqp::until( $stopped, nqp::stmts( ($stopped = 1), nqp::handle( &!block($pulled), 'LABELED', $!label, 'REDO', ($stopped = 0), 'NEXT', nqp::null, # need NEXT for next LABEL support 'LAST', return ) ), :nohandler ) ) ) } } my class IterateOneWithoutPhasers does SlippyIterator { has &!block; has $!source; has $!label; method new(&block,$source,$label) { my $iter := nqp::create(self); nqp::bindattr($iter, self, '&!block', &block); nqp::bindattr($iter, self, '$!source', $source); nqp::bindattr($iter, self, '$!label', nqp::decont($label)); $iter } method is-lazy() { $!source.is-lazy } method pull-one() is raw { my int $redo = 1; my $value; my $result; if $!slipping && nqp::not_i(nqp::eqaddr( ($result := self.slip-one), IterationEnd )) { # $result will be returned at the end } elsif nqp::eqaddr( ($value := $!source.pull-one), IterationEnd ) { $result := $value } else { nqp::while( $redo, nqp::stmts( $redo = 0, nqp::handle( nqp::if( nqp::istype(($result := &!block($value)),Slip), nqp::if( nqp::eqaddr( ($result := self.start-slip($result)), IterationEnd), nqp::if( nqp::not_i(nqp::eqaddr( ($value := $!source.pull-one), IterationEnd )), $redo = 1 ) ) ), 'LABELED', $!label, 'NEXT', nqp::if( nqp::eqaddr( ($value := $!source.pull-one),IterationEnd ), ($result := IterationEnd), ($redo = 1) ), 'REDO', ($redo = 1), 'LAST', ($result := IterationEnd) ), ), :nohandler); } $result } method push-all($target --> IterationEnd) { nqp::stmts( (my $value), nqp::if( $!slipping, nqp::until( nqp::eqaddr(($value := self.slip-one),IterationEnd), $target.push($value) ) ), nqp::until( nqp::eqaddr(($value := $!source.pull-one),IterationEnd), nqp::stmts( (my int $redo = 1), nqp::while( $redo, nqp::stmts( ($redo = 0), nqp::handle( nqp::if( nqp::istype((my $result := &!block($value)),Slip), self.slip-all($result,$target), $target.push($result) ), 'LABELED', $!label, 'REDO', ($redo = 1), 'LAST', return, 'NEXT', nqp::null, # need NEXT for next LABEL support ) ), :nohandler ) ) ) ) } method sink-all(--> IterationEnd) { nqp::stmts( nqp::if( $!slipping, nqp::until( nqp::eqaddr(self.slip-one,IterationEnd), nqp::null ) ), nqp::until( nqp::eqaddr((my $value := $!source.pull-one()),IterationEnd), nqp::stmts( (my int $redo = 1), nqp::while( $redo, nqp::stmts( ($redo = 0), nqp::handle( # doesn't sink &!block($value), 'LABELED', $!label, 'NEXT', nqp::null, # need NEXT for next LABEL support 'REDO', ($redo = 1), 'LAST', return ), :nohandler ) ) ) ) ) } } my class IterateTwoWithoutPhasers does SlippyIterator { has &!block; has $!source; has $!label; method new(&block,$source,$label) { my $iter := nqp::create(self); nqp::bindattr($iter, self, '&!block', &block); nqp::bindattr($iter, self, '$!source', $source); nqp::bindattr($iter, self, '$!label', nqp::decont($label)); $iter } method is-lazy() { $!source.is-lazy } method pull-one() is raw { my int $redo = 1; my $value; my $value2; my $result; if $!slipping && nqp::not_i(nqp::eqaddr( ($result := self.slip-one), IterationEnd )) { # $result will be returned at the end } elsif nqp::eqaddr( ($value := $!source.pull-one), IterationEnd ) { $result := IterationEnd; } else { nqp::while( $redo, nqp::stmts( $redo = 0, nqp::handle( nqp::stmts( nqp::if( nqp::eqaddr(($value2 := $!source.pull-one),IterationEnd), nqp::if( # don't have 2 params nqp::istype(($result := &!block($value)),Slip), ($result := self.start-slip($result)) # don't care if empty ), nqp::if( nqp::istype(($result := &!block($value,$value2)),Slip), nqp::if( nqp::eqaddr(($result := self.start-slip($result)),IterationEnd), nqp::unless( nqp::eqaddr(($value := $!source.pull-one),IterationEnd), ($redo = 1) ) ) ) ) ), 'LABELED', $!label, 'NEXT', nqp::if( nqp::eqaddr( ($value := $!source.pull-one),IterationEnd ), ($result := IterationEnd), ($redo = 1) ), 'REDO', ($redo = 1), 'LAST', ($result := IterationEnd) ), ), :nohandler); } $result } method push-all($target --> IterationEnd) { nqp::stmts( (my $value), nqp::if( $!slipping, nqp::until( nqp::eqaddr(($value := self.slip-one),IterationEnd), $target.push($value) ) ), nqp::until( nqp::eqaddr(($value := $!source.pull-one),IterationEnd), nqp::stmts( (my int $redo = 1), nqp::while( $redo, nqp::stmts( ($redo = 0), nqp::handle( nqp::if( nqp::eqaddr( (my $value2 := $!source.pull-one), IterationEnd ), nqp::stmts( (my $result := &!block($value)), nqp::if( nqp::istype($result,Slip), self.slip-all($result,$target), $target.push($result) ), return ), nqp::if( nqp::istype( ($result := &!block($value,$value2)), Slip ), self.slip-all($result,$target), $target.push($result) ) ), 'LABELED', $!label, 'REDO', ($redo = 1), 'LAST', return, 'NEXT', nqp::null, # need NEXT for next LABEL support ) ), :nohandler ) ) ) ) } method sink-all(--> IterationEnd) { nqp::stmts( nqp::if( $!slipping, nqp::until( nqp::eqaddr(self.slip-one,IterationEnd), nqp::null, ) ), nqp::until( nqp::eqaddr((my $value := $!source.pull-one()),IterationEnd), nqp::stmts( (my int $redo = 1), nqp::while( $redo, nqp::stmts( ($redo = 0), nqp::handle( # doesn't sink nqp::if( nqp::eqaddr( (my $value2 := $!source.pull-one), IterationEnd ), nqp::stmts( (&!block($value)), return ), (&!block($value,$value2)) ), 'LABELED', $!label, 'NEXT', nqp::null, # need NEXT for next LABEL support 'REDO', ($redo = 1), 'LAST', return ) ), :nohandler ) ) ) ) } } my class IterateMoreWithPhasers does SlippyIterator { has &!block; has $!source; has $!count; has $!label; has $!value-buffer; has $!did-init; has $!did-iterate; has $!NEXT; has $!CAN_FIRE_PHASERS; method new(&block, $source, $count, $label) { my $iter := nqp::create(self); nqp::bindattr($iter, self, '&!block', &block); nqp::bindattr($iter, self, '$!source', $source); nqp::bindattr($iter, self, '$!count', $count); nqp::bindattr($iter, self, '$!label', nqp::decont($label)); $iter } method is-lazy() { $!source.is-lazy } method pull-one() is raw { $!value-buffer.DEFINITE ?? nqp::setelems($!value-buffer, 0) !! ($!value-buffer := IterationBuffer.new); my int $redo = 1; my $result; if !$!did-init && nqp::can(&!block, 'fire_phasers') { $!did-init = 1; $!CAN_FIRE_PHASERS = 1; $!NEXT = &!block.has-phaser('NEXT'); nqp::p6setfirstflag(&!block) if &!block.has-phaser('FIRST'); } if $!slipping && !(($result := self.slip-one()) =:= IterationEnd) { # $result will be returned at the end } elsif $!source.push-exactly($!value-buffer, $!count) =:= IterationEnd && nqp::elems($!value-buffer) == 0 { $result := IterationEnd } else { nqp::while( $redo, nqp::stmts( $redo = 0, nqp::handle( nqp::stmts( ($result := nqp::p6invokeflat(&!block, $!value-buffer)), ($!did-iterate = 1), nqp::if( nqp::istype($result, Slip), nqp::stmts( ($result := self.start-slip($result)), nqp::if( nqp::eqaddr($result, IterationEnd), nqp::stmts( (nqp::setelems($!value-buffer, 0)), ($redo = 1 unless nqp::eqaddr( $!source.push-exactly($!value-buffer, $!count), IterationEnd) && nqp::elems($!value-buffer) == 0) ) ) ) ), nqp::if($!NEXT, &!block.fire_phasers('NEXT')), ), 'LABELED', $!label, 'NEXT', nqp::stmts( ($!did-iterate = 1), nqp::if($!NEXT, &!block.fire_phasers('NEXT')), (nqp::setelems($!value-buffer, 0)), nqp::eqaddr($!source.push-exactly($!value-buffer, $!count), IterationEnd) && nqp::elems($!value-buffer) == 0 ?? ($result := IterationEnd) !! ($redo = 1)), 'REDO', $redo = 1, 'LAST', nqp::stmts( ($!did-iterate = 1), ($result := IterationEnd) ) ) ), :nohandler); } &!block.fire_if_phasers('LAST') if $!CAN_FIRE_PHASERS && $!did-iterate && nqp::eqaddr($result, IterationEnd); $result } } sub sequential-map(\source, &block, $label) { # We want map to be fast, so we go to some effort to build special # case iterators that can ignore various interesting cases. my $count = &block.count; Seq.new( nqp::istype(&block,Block) && &block.has-phasers ?? $count < 2 || $count === Inf ?? IterateOneWithPhasers.new(&block,source,$label) !! IterateMoreWithPhasers.new(&block,source,$count,$label) !! $count < 2 || $count === Inf ?? nqp::istype(Slip,&block.returns) ?? IterateOneWithoutPhasers.new(&block,source,$label) !! IterateOneNotSlippingWithoutPhasers.new(&block,source,$label) !! $count == 2 ?? IterateTwoWithoutPhasers.new(&block,source,$label) !! IterateMoreWithPhasers.new(&block,source,$count,$label) ) } proto method flatmap (|) is nodal {*} multi method flatmap(&block, :$label) { self.map(&block, :$label).flat } method !grep-k(Callable:D $test) { Seq.new(class :: does Iterator { has Mu $!iter; has Mu $!test; has int $!index; method !SET-SELF(\list,Mu \test) { $!iter = list.iterator; $!test := test; $!index = -1; self } method new(\list,Mu \test) { nqp::create(self)!SET-SELF(list,test) } method pull-one() is raw { $!index = $!index + 1 until ($_ := $!iter.pull-one) =:= IterationEnd || $!test($_); $_ =:= IterationEnd ?? IterationEnd !! nqp::p6box_i($!index = $!index + 1) } method push-all($target --> IterationEnd) { until ($_ := $!iter.pull-one) =:= IterationEnd { $!index = $!index + 1; $target.push(nqp::p6box_i($!index)) if $!test($_); } } }.new(self, $test)) } method !grep-kv(Callable:D $test) { Seq.new(class :: does Iterator { has Mu $!iter; has Mu $!test; has int $!index; has Mu $!value; method !SET-SELF(\list,Mu \test) { $!iter = list.iterator; $!test := test; $!index = -1; self } method new(\list,Mu \test) { nqp::create(self)!SET-SELF(list,test) } method pull-one() is raw { if $!value.DEFINITE { my \tmp = $!value; $!value := nqp::null; tmp } else { $!index = $!index + 1 until ($_ := $!iter.pull-one) =:= IterationEnd || $!test($_); if $_ =:= IterationEnd { IterationEnd; } else { $!value := $_; nqp::p6box_i($!index = $!index + 1) } } } method push-all($target --> IterationEnd) { nqp::until( nqp::eqaddr(($_ := $!iter.pull-one),IterationEnd), nqp::stmts( $!index = nqp::add_i($!index,1); nqp::if( $!test($_), nqp::stmts( # doesn't sink $target.push(nqp::p6box_i($!index)); $target.push($_); ) ) ) ); } }.new(self, $test)) } method !grep-p(Callable:D $test) { Seq.new(class :: does Iterator { has Mu $!iter; has Mu $!test; has int $!index; method !SET-SELF(\list,Mu \test) { $!iter = list.iterator; $!test := test; $!index = -1; self } method new(\list,Mu \test) { nqp::create(self)!SET-SELF(list,test) } method pull-one() is raw { $!index = $!index + 1 until ($_ := $!iter.pull-one) =:= IterationEnd || $!test($_); $_ =:= IterationEnd ?? IterationEnd !! Pair.new($!index = $!index + 1,$_) } method push-all($target --> IterationEnd) { until ($_ := $!iter.pull-one) =:= IterationEnd { $!index = $!index + 1; $target.push(Pair.new($!index,$_)) if $!test($_); } } }.new(self, $test)) } role Grepper does Iterator { has Mu $!iter; has Mu $!test; method SET-SELF(\list,Mu \test) { $!iter = list.iterator; $!test := test; self } method new(\list,Mu \test) { nqp::create(self).SET-SELF(list,test) } method is-lazy() { $!iter.is-lazy } } method !grep-callable(Callable:D $test) { nqp::if( $test.count == 1, sequential-map( self.iterator, { nqp::if($test($_),$_,Empty) }, Any) , nqp::stmts( (my role CheatArity { has $!arity; has $!count; method set-cheat($new-arity, $new-count --> Nil) { $!arity = $new-arity; $!count = $new-count; } method arity(Code:D:) { $!arity } method count(Code:D:) { $!count } }), (my &tester = -> |c { #note "*cough* {c.perl} -> {$test(|c).perl}"; next unless $test(|c); c.list } but CheatArity), &tester.set-cheat($test.arity, $test.count), self.map(&tester) ) ) } method !grep-accepts(Mu $test) { Seq.new(class :: does Grepper { method pull-one() is raw { nqp::until( nqp::eqaddr(($_ := $!iter.pull-one),IterationEnd) || $!test.ACCEPTS($_), nqp::null ); $_ } method push-all($target --> IterationEnd) { nqp::until( nqp::eqaddr(($_ := $!iter.pull-one),IterationEnd), nqp::if( # doesn't sink $!test.ACCEPTS($_), $target.push($_) ) ); } }.new(self, $test)) } method !first-result(\index,\value,$what,%a) is raw { nqp::stmts( (my $storage := nqp::getattr(%a,Map,'$!storage')), nqp::if( nqp::elems($storage), # some adverb nqp::if( nqp::iseq_i(nqp::elems($storage),1), # one adverb nqp::if( nqp::atkey($storage,"k"), # :k nqp::p6box_i(index), nqp::if( nqp::atkey($storage,"p"), # :p Pair.new(index,value), nqp::if( nqp::atkey($storage,"v"), # :v value, nqp::if( nqp::atkey($storage,"kv"), # :kv (index,value), nqp::stmts( # no truthy or different (my str $key = nqp::iterkey_s(nqp::shift(nqp::iterator($storage)))), nqp::if( (nqp::iseq_s($key,"k") # :!k || :!p || :!kv || nqp::iseq_s($key,"p") || nqp::iseq_s($key,"kv")), value, nqp::if( nqp::iseq_s($key,"v"), # :!v Failure.new("Specified a negated :v adverb"), Failure.new(X::Adverb.new( # :foo ?? :$what, :source(try { self.VAR.name } // self.WHAT.perl), :unexpected(%a.keys))) ) ) ) ) ) ) ), Failure.new(X::Adverb.new( # multiple adverbs ?? :$what, :source(try { self.VAR.name } // self.WHAT.perl), :nogo(%a.keys.grep: /k|v|p/) :unexpected(%a.keys.grep: { !.match(/k|v|p/) } ))) ), value # no adverb ) ) } proto method grep(|) is nodal {*} multi method grep(Bool:D $t) { X::Match::Bool.new( type => '.grep').throw } multi method grep(Mu $t) { my $storage := nqp::getattr(%_,Map,'$!storage'); if nqp::iseq_i(nqp::elems($storage),0) { nqp::istype($t,Regex:D) ?? self!grep-accepts: $t !! nqp::istype($t,Callable:D) ?? self!grep-callable: $t !! self!grep-accepts: $t } elsif nqp::iseq_i(nqp::elems($storage),1) { if nqp::atkey($storage,"k") { nqp::istype($t,Regex:D) ?? self!grep-k: { $t.ACCEPTS($_) } !! nqp::istype($t,Callable:D) ?? self!grep-k: $t !! self!grep-k: { $t.ACCEPTS($_) } } elsif nqp::atkey($storage,"kv") { nqp::istype($t,Regex:D) ?? self!grep-kv: { $t.ACCEPTS($_) } !! nqp::istype($t,Callable:D) ?? self!grep-kv: $t !! self!grep-kv: { $t.ACCEPTS($_) } } elsif nqp::atkey($storage,"p") { nqp::istype($t,Regex:D) ?? self!grep-p: { $t.ACCEPTS($_) } !! nqp::istype($t,Callable:D) ?? self!grep-p: $t !! self!grep-p: { $t.ACCEPTS($_) } } elsif nqp::atkey($storage,"v") { nqp::istype($t,Regex:D) ?? self!grep-accepts: $t !! nqp::istype($t,Callable:D) ?? self!grep-callable: $t !! self!grep-accepts: $t } else { my str $key = nqp::iterkey_s(nqp::shift(nqp::iterator($storage))); if nqp::iseq_s($key,"k") || nqp::iseq_s($key,"kv") || nqp::iseq_s($key,"p") { nqp::istype($t,Regex:D) ?? self!grep-accepts: $t !! nqp::istype($t,Callable:D) ?? self!grep-callable: $t !! self!grep-accepts: $t } else { nqp::iseq_s($key,"k") ?? die "Specified a negated :v adverb" !! X::Adverb.new( :what, :source(try { self.VAR.name } // self.WHAT.perl), :unexpected($key) ).throw } } } else { X::Adverb.new( :what, :source(try { self.VAR.name } // self.WHAT.perl), :nogo(%_.keys.grep: /k|v|kv|p/) :unexpected(%_.keys.grep: { !.match(/k|v|kv|p/) } ) ).throw } } proto method first(|) is nodal {*} multi method first(Bool:D $t) { Failure.new(X::Match::Bool.new( type => '.first' )) } # need to handle Regex differently, since it is also Callable multi method first(Regex:D $test, :$end, *%a) is raw { $end ?? self!first-accepts-end($test,%a) !! self!first-accepts($test,%a) } multi method first(Callable:D $test, :$end, *%a is copy) is raw { if $end { nqp::stmts( (my $elems = self.elems), nqp::if( ($elems && nqp::not_i($elems == Inf)), nqp::stmts( (my int $index = $elems), nqp::while( nqp::isge_i(($index = nqp::sub_i($index,1)),0), nqp::if( $test(self.AT-POS($index)), return self!first-result( $index,self.AT-POS($index),'first :end',%a) ) ), Nil ), Nil ) ) } else { nqp::stmts( (my $iter := self.iterator), (my int $index), nqp::until( (nqp::eqaddr(($_ := $iter.pull-one),IterationEnd) || $test($_)), ($index = nqp::add_i($index,1)) ), nqp::if( nqp::eqaddr($_,IterationEnd), Nil, self!first-result($index,$_,'first',%a) ) ) } } multi method first(Mu $test = True, :$end, *%a) is raw { $end ?? self!first-accepts-end($test,%a) !! self!first-accepts($test,%a) } method !first-accepts(Mu $test,%a) is raw { nqp::stmts( (my $iter := self.iterator), (my int $index), nqp::until( (nqp::eqaddr(($_ := $iter.pull-one),IterationEnd) || $test.ACCEPTS($_)), ($index = nqp::add_i($index,1)) ), nqp::if( nqp::eqaddr($_,IterationEnd), Nil, self!first-result($index,$_,'first',%a) ) ) } method !first-accepts-end(Mu $test,%a) is raw { nqp::stmts( (my $elems = self.elems), nqp::if( ($elems && nqp::not_i($elems == Inf)), nqp::stmts( (my int $index = $elems), nqp::while( nqp::isge_i(($index = nqp::sub_i($index,1)),0), nqp::if( $test.ACCEPTS(self.AT-POS($index)), return self!first-result( $index,self.AT-POS($index),'first :end',%a) ) ), Nil ), Nil ) ) } method !iterator-and-first($action,\first) is raw { nqp::if( self.is-lazy, X::Cannot::Lazy.new(:$action).throw, nqp::stmts( (my $iterator := self.iterator), nqp::until( nqp::eqaddr((my $pulled := $iterator.pull-one),IterationEnd), nqp::if( nqp::isconcrete($pulled), nqp::stmts( (first = $pulled), (return $iterator) ) ) ), Mu ) ) } proto method min (|) is nodal {*} multi method min() { nqp::stmts( nqp::if( (my $iter := self!iterator-and-first(".min",my $min)), nqp::until( nqp::eqaddr((my $pulled := $iter.pull-one),IterationEnd), nqp::if( (nqp::isconcrete($pulled) && $pulled cmp $min < 0), $min = $pulled ) ) ), nqp::if(nqp::defined($min),$min,Inf) ) } multi method min(&by) { nqp::stmts( (my $cmp := nqp::if( nqp::iseq_i(&by.arity,2),&by,{ &by($^a) cmp &by($^b) })), nqp::if( (my $iter := self!iterator-and-first(".min",my $min)), nqp::until( nqp::eqaddr((my $pulled := $iter.pull-one),IterationEnd), nqp::if( (nqp::isconcrete($pulled) && $cmp($pulled,$min) < 0), $min = $pulled ) ) ), nqp::if(nqp::defined($min),$min,Inf) ) } proto method max (|) is nodal {*} multi method max() { nqp::stmts( nqp::if( (my $iter := self!iterator-and-first(".max",my $max)), nqp::until( nqp::eqaddr((my $pulled := $iter.pull-one),IterationEnd), nqp::if( (nqp::isconcrete($pulled) && $pulled cmp $max > 0), $max = $pulled ) ) ), nqp::if(nqp::defined($max),$max,-Inf) ) } multi method max(&by) { nqp::stmts( (my $cmp := nqp::if( nqp::iseq_i(&by.arity,2),&by,{ &by($^a) cmp &by($^b) })), nqp::if( (my $iter := self!iterator-and-first(".max",my $max)), nqp::until( nqp::eqaddr((my $pulled := $iter.pull-one),IterationEnd), nqp::if( (nqp::isconcrete($pulled) && $cmp($pulled,$max) > 0), $max = $pulled ) ) ), nqp::if(nqp::defined($max),$max,-Inf) ) } method !minmax-range-init(\value,\mi,\exmi,\ma,\exma --> Nil) { mi = value.min; exmi = value.excludes-min; ma = value.max; exma = value.excludes-max; } method !minmax-range-check(\value,\mi,\exmi,\ma,\exma --> Nil) { nqp::stmts( nqp::if( ((value.min cmp mi) < 0), nqp::stmts( (mi = value.min), (exmi = value.excludes-min) ) ), nqp::if( ((value.max cmp ma) > 0), nqp::stmts( (ma = value.max), (exma = value.excludes-max) ) ) ) } method !cmp-minmax-range-check(\value,$cmp,\mi,\exmi,\ma,\exma --> Nil) { nqp::stmts( # $cmp sigillless confuses the optimizer nqp::if( ($cmp(value.min,mi) < 0), nqp::stmts( (mi = value.min), (exmi = value.excludes-min) ) ), nqp::if( ($cmp(value.max,ma) > 0), nqp::stmts( (ma = value.max), (exma = value.excludes-max) ) ) ) } proto method minmax (|) is nodal {*} multi method minmax() { nqp::stmts( nqp::if( (my $iter := self!iterator-and-first(".minmax",my $pulled)), nqp::stmts( nqp::if( nqp::istype($pulled,Range), self!minmax-range-init($pulled, my $min,my int $excludes-min,my $max,my int $excludes-max), nqp::if( nqp::istype($pulled,Positional), self!minmax-range-init($pulled.minmax, # recurse for min/max $min,$excludes-min,$max,$excludes-max), ($min = $max = $pulled) ) ), nqp::until( nqp::eqaddr(($pulled := $iter.pull-one),IterationEnd), nqp::if( nqp::isconcrete($pulled), nqp::if( nqp::istype($pulled,Range), self!minmax-range-check($pulled, $min,$excludes-min,$max,$excludes-max), nqp::if( nqp::istype($pulled,Positional), self!minmax-range-check($pulled.minmax, $min,$excludes-min,$max,$excludes-max), nqp::if( (($pulled cmp $min) < 0), ($min = $pulled), nqp::if( (($pulled cmp $max) > 0), ($max = $pulled) ) ) ) ) ) ) ) ), nqp::if( nqp::defined($min), Range.new($min,$max,:$excludes-min,:$excludes-max), Range.new(Inf,-Inf) ) ) } multi method minmax(&by) { nqp::stmts( nqp::if( (my $iter := self!iterator-and-first(".minmax",my $pulled)), nqp::stmts( (my $cmp = nqp::if( nqp::iseq_i(&by.arity,2),&by,{ &by($^a) cmp &by($^b) }) ), nqp::if( nqp::istype($pulled,Range), self!minmax-range-init($pulled, my $min,my int $excludes-min,my $max,my int $excludes-max), nqp::if( nqp::istype($pulled,Positional), self!minmax-range-init($pulled.minmax(&by), # recurse min/max $min,$excludes-min,$max,$excludes-max), ($min = $max = $pulled) ) ), nqp::until( nqp::eqaddr(($pulled := $iter.pull-one),IterationEnd), nqp::if( nqp::isconcrete($pulled), nqp::if( nqp::istype($pulled,Range), self!cmp-minmax-range-check($pulled, $cmp,$min,$excludes-min,$max,$excludes-max), nqp::if( nqp::istype($pulled,Positional), self!cmp-minmax-range-check($pulled.minmax(&by), $cmp,$min,$excludes-min,$max,$excludes-max), nqp::if( ($cmp($pulled,$min) < 0), ($min = $pulled), nqp::if( ($cmp($pulled,$max) > 0), ($max = $pulled) ) ) ) ) ) ) ) ), nqp::if( nqp::defined($min), Range.new($min,$max,:$excludes-min,:$excludes-max), Range.new(Inf,-Inf) ) ) } proto method sort(|) is nodal {*} multi method sort() { nqp::if( nqp::eqaddr( self.iterator.push-until-lazy(my $list := IterationBuffer.new), IterationEnd ), Seq.new( Rakudo::Iterator.ReifiedList( Rakudo::Sorting.MERGESORT-REIFIED-LIST( nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',$list) ) ) ), X::Cannot::Lazy.new(:action).throw ) } multi method sort(&by) { nqp::stmts( nqp::unless( nqp::eqaddr( self.iterator.push-until-lazy(my $list := IterationBuffer.new), IterationEnd ), X::Cannot::Lazy.new(:action).throw ), Seq.new( Rakudo::Iterator.ReifiedList( nqp::if( nqp::eqaddr(&by,&infix:), Rakudo::Sorting.MERGESORT-REIFIED-LIST( nqp::p6bindattrinvres( nqp::create(List),List,'$!reified',$list) ), nqp::if( &by.count < 2, Rakudo::Sorting.MERGESORT-REIFIED-LIST-AS( nqp::p6bindattrinvres( nqp::create(List),List,'$!reified',$list), &by ), Rakudo::Sorting.MERGESORT-REIFIED-LIST-WITH( nqp::p6bindattrinvres( nqp::create(List),List,'$!reified',$list), &by ) ) ) ) ) ) } method collate { self.sort(&[coll]); } sub find-reducer-for-op(&op) { nqp::if( nqp::iseq_s(&op.prec("prec"),"f="), &METAOP_REDUCE_LISTINFIX, nqp::if( nqp::iseq_i(nqp::chars(my str $assoc = &op.prec("assoc")),0), &METAOP_REDUCE_LEFT, ::(nqp::concat('&METAOP_REDUCE_',nqp::uc($assoc))) ) ) } proto method reduce(|) {*} multi method reduce(&with) is nodal { return unless self.DEFINITE; my $reducer := find-reducer-for-op(&with); $reducer(&with)(self) if $reducer; } proto method produce(|) {*} multi method produce(&with) is nodal { return unless self.DEFINITE; my $reducer := find-reducer-for-op(&with); $reducer(&with,1)(self) if $reducer; } proto method unique(|) is nodal {*} multi method unique() { Seq.new(class :: does Iterator { has $!iter; has $!seen; method !SET-SELF(\list) { nqp::stmts( ($!iter := list.iterator), ($!seen := nqp::hash), self ) } method new(\list) { nqp::create(self)!SET-SELF(list) } method pull-one() is raw { nqp::stmts( nqp::until( nqp::eqaddr((my $pulled := $!iter.pull-one),IterationEnd) || (nqp::not_i(nqp::existskey( $!seen, (my $needle := $pulled.WHICH) )) && nqp::bindkey($!seen,$needle,1)), nqp::null ), $pulled ) } method push-all($target --> IterationEnd) { nqp::until( nqp::eqaddr((my $pulled := $!iter.pull-one),IterationEnd), nqp::unless( nqp::existskey($!seen,(my $needle := $pulled.WHICH)), nqp::stmts( nqp::bindkey($!seen,$needle,1), $target.push($pulled) ) ) ) } method is-lazy() { $!iter.is-lazy } method sink-all(--> IterationEnd) { $!iter.sink-all } }.new(self)) } multi method unique( :&as!, :&with! ) { nqp::if( nqp::eqaddr(&with,&[===]), # use optimized version self.unique(:&as), Seq.new( Rakudo::Iterator.UniqueRepeatedAsWith(self.iterator,&as,&with,1) ) ) } multi method unique( :&as! ) { Seq.new(class :: does Iterator { has Mu $!iter; has &!as; has $!seen; method !SET-SELF(\list, &!as) { $!iter = list.iterator; $!seen := nqp::hash(); self } method new(\list, &as) { nqp::create(self)!SET-SELF(list, &as) } method pull-one() is raw { nqp::stmts( nqp::until( nqp::eqaddr((my $value := $!iter.pull-one),IterationEnd), nqp::unless( nqp::existskey($!seen,my $needle := &!as($value).WHICH), nqp::stmts( nqp::bindkey($!seen,$needle,1), return-rw $value ) ) ), IterationEnd ) } method push-all($target --> IterationEnd) { nqp::until( nqp::eqaddr((my $value := $!iter.pull-one),IterationEnd), nqp::unless( nqp::existskey($!seen,my $needle := &!as($value).WHICH), nqp::stmts( # doesn't sink nqp::bindkey($!seen,$needle,1), $target.push($value) ) ) ) } }.new(self, &as)) } multi method unique( :&with! ) { nqp::if( nqp::eqaddr(&with,&[===]), # use optimized version self.unique, Seq.new(Rakudo::Iterator.UniqueRepeatedWith(self.iterator,&with,1)) ) } proto method repeated(|) is nodal {*} multi method repeated() { Seq.new(class :: does Iterator { has Mu $!iter; has $!seen; method !SET-SELF(\list) { $!iter = list.iterator; $!seen := nqp::hash(); self } method new(\list) { nqp::create(self)!SET-SELF(list) } method pull-one() is raw { my Mu $value; my str $needle; nqp::until( nqp::eqaddr(($value := $!iter.pull-one),IterationEnd), nqp::existskey($!seen,$needle = nqp::unbox_s($value.WHICH)) ?? return-rw $value !! nqp::bindkey($!seen, $needle, 1) ); IterationEnd } method push-all($target --> IterationEnd) { my Mu $value; my str $needle; nqp::until( # doesn't sink nqp::eqaddr(($value := $!iter.pull-one),IterationEnd), nqp::existskey($!seen,$needle = nqp::unbox_s($value.WHICH)) ?? $target.push($value) !! nqp::bindkey($!seen, $needle, 1) ); } method is-lazy() { $!iter.is-lazy } }.new(self)) } multi method repeated( :&as!, :&with! ) { nqp::if( nqp::eqaddr(&with,&[===]), # use optimized version self.repeated(:&as), Seq.new( Rakudo::Iterator.UniqueRepeatedAsWith(self.iterator,&as,&with,0) ) ) } multi method repeated( :&as! ) { Seq.new(class :: does Iterator { has Mu $!iter; has &!as; has $!seen; method !SET-SELF(\list, &!as) { $!iter = list.iterator; $!seen := nqp::hash(); self } method new(\list, &as) { nqp::create(self)!SET-SELF(list, &as) } method pull-one() is raw { my Mu $value; my str $needle; nqp::until( nqp::eqaddr(($value := $!iter.pull-one),IterationEnd), nqp::existskey($!seen,$needle = nqp::unbox_s(&!as($value).WHICH)) ?? return-rw $value !! nqp::bindkey($!seen, $needle, 1) ); IterationEnd } method push-all($target --> IterationEnd) { my Mu $value; my str $needle; nqp::until( # doesn't sink nqp::eqaddr(($value := $!iter.pull-one),IterationEnd), nqp::existskey($!seen,$needle = nqp::unbox_s(&!as($value).WHICH)) ?? $target.push($value) !! nqp::bindkey($!seen, $needle, 1) ); } method is-lazy() { $!iter.is-lazy } }.new(self, &as)) } multi method repeated( :&with! ) { nqp::if( nqp::eqaddr(&with,&[===]), # use optimized version self.repeated, Seq.new(Rakudo::Iterator.UniqueRepeatedWith(self.iterator,&with,0)) ) } proto method squish(|) is nodal {*} multi method squish( :&as!, :&with = &[===] ) { Seq.new(class :: does Iterator { has Mu $!iter; has &!as; has &!with; has $!last_as; has int $!first; method !SET-SELF(\list, &!as, &!with) { $!iter = list.iterator; $!first = 1; self } method new(\list, &as, &with) { nqp::create(self)!SET-SELF(list, &as, &with) } method pull-one() is raw { my Mu $value := $!iter.pull-one; unless nqp::eqaddr($value,IterationEnd) { my $which := &!as($value); if $!first { $!first = 0; } else { until !with($!last_as, $which) or ($value := $!iter.pull-one) =:= IterationEnd { $!last_as = $which; $which := &!as($value); } } $!last_as = $which; } $value; } method push-all($target --> IterationEnd) { my Mu $value := $!iter.pull-one; unless nqp::eqaddr($value,IterationEnd) { my $which; my $last_as := $!last_as; nqp::if( $!first, nqp::stmts( # doesn't sink ($target.push($value)), ($which := &!as($value)), ($last_as := $which), ($value := $!iter.pull-one) ) ); nqp::until( nqp::eqaddr($value,IterationEnd), nqp::stmts( nqp::unless( # doesn't sink with($last_as,$which := &!as($value)), $target.push($value) ), ($last_as := $which), ($value := $!iter.pull-one) ) ); } } method is-lazy() { $!iter.is-lazy } }.new(self, &as, &with)) } multi method squish( :&with = &[===] ) { Seq.new(class :: does Iterator { has Mu $!iter; has &!with; has Mu $!last; has int $!first; method !SET-SELF(\list, &!with) { $!iter = list.iterator; $!first = 1; self } method new(\list, &with) { nqp::create(self)!SET-SELF(list, &with) } method pull-one() is raw { my Mu $value := $!iter.pull-one; unless nqp::eqaddr($value,IterationEnd) { if $!first { $!first = 0; } else { my $ov = $value; until !with($!last, $value) or ($value := $!iter.pull-one) =:= IterationEnd { $!last = $ov; $ov = $value; } } $!last = $value } $value; } method push-all($target --> IterationEnd) { my Mu $value := $!iter.pull-one; unless nqp::eqaddr($value,IterationEnd) { my $last_val = $!last; nqp::if( $!first, nqp::stmts( # doesn't sink ($target.push($value)), ($last_val := $value), ($value := $!iter.pull-one) ) ); nqp::until( nqp::eqaddr($value,IterationEnd), nqp::stmts( nqp::unless( # doesn't sink with($last_val, $value), $target.push($value) ), ($last_val := $value), ($value := $!iter.pull-one) ) ); } } method is-lazy() { $!iter.is-lazy } }.new(self, &with)) } proto method pairup(|) is nodal {*} multi method pairup(Any:U:) { () } multi method pairup(Any:D:) { my \iter := self.iterator; gather { nqp::until( nqp::eqaddr((my $pulled := iter.pull-one),IterationEnd), nqp::if( nqp::istype($pulled,Pair), (take nqp::p6bindattrinvres( nqp::clone($pulled), Pair, '$!value', nqp::clone(nqp::decont(nqp::getattr($pulled,Pair,'$!value'))) )), nqp::if( nqp::istype($pulled,Map) && nqp::not_i(nqp::iscont($pulled)), (take Slip.from-iterator($pulled.iterator)), nqp::if( nqp::eqaddr((my $value := iter.pull-one),IterationEnd), X::Pairup::OddNumber.new.throw, take Pair.new($pulled,$value) ) ) ) ) } } proto method toggle(|) {*} multi method toggle(Any:D: Callable:D \condition, :$off!) { Seq.new( $off ?? Rakudo::Iterator.Until(self.iterator, condition) !! Rakudo::Iterator.While(self.iterator, condition) ) } multi method toggle(Any:D: Callable:D \condition) { Seq.new(Rakudo::Iterator.While(self.iterator, condition)) } multi method toggle(Any:D: *@conditions, :$off) { Seq.new( Rakudo::Iterator.Toggle(self.iterator, @conditions.iterator, !$off) ) } proto method head(|) {*} multi method head(Any:D:) is raw { nqp::if( nqp::eqaddr((my $pulled := self.iterator.pull-one),IterationEnd), Nil, $pulled ) } multi method head(Any:D: Callable:D $w) { Seq.new( Rakudo::Iterator.AllButLastNValues(self.iterator,-($w(0).Int)) ) } multi method head(Any:D: $n) { Seq.new(Rakudo::Iterator.NextNValues(self.iterator,$n)) } proto method tail(|) {*} multi method tail() is raw { nqp::if( nqp::eqaddr((my $pulled := Rakudo::Iterator.LastValue(self.iterator,'tail')), IterationEnd ), Nil, $pulled ) } multi method tail($n) { Seq.new( nqp::if( nqp::istype($n,Callable), nqp::stmts( (my $iterator := self.iterator), nqp::if( nqp::isgt_i((my $skip := -($n(0).Int)),0), nqp::if( $iterator.skip-at-least($skip), $iterator, Rakudo::Iterator.Empty), $iterator)), Rakudo::Iterator.LastNValues(self.iterator,$n,'tail') ) ) } proto method skip(|) {*} multi method skip() { my $iter := self.iterator; Seq.new( $iter.skip-one ?? $iter !! Rakudo::Iterator.Empty ) } multi method skip(Whatever) { Seq.new(Rakudo::Iterator.Empty) } multi method skip(Callable:D $w) { nqp::if( nqp::isgt_i((my $tail := -($w(0).Int)),0), self.tail($tail), Seq.new(Rakudo::Iterator.Empty) ) } multi method skip(Int() $n) { my $iter := self.iterator; Seq.new( $iter.skip-at-least($n) ?? $iter !! Rakudo::Iterator.Empty ) } proto method minpairs(|) {*} multi method minpairs(Any:D:) { my @found; for self.pairs { my $value := .value; state $min = $value; nqp::if( nqp::iseq_i( (my $cmp := $value cmp $min), -1 ), nqp::stmts((@found = $_), ($min = $value)), nqp::if( nqp::iseq_i($cmp, 0), @found.push($_) ) ) } Seq.new(@found.iterator) } proto method maxpairs(|) {*} multi method maxpairs(Any:D:) { my @found; for self.pairs { my $value := .value; state $max = $value; nqp::if( nqp::iseq_i( (my $cmp := $value cmp $max), 1 ), nqp::stmts((@found = $_), ($max = $value)), nqp::if( nqp::iseq_i($cmp, 0), @found.push($_) ) ) } Seq.new(@found.iterator) } proto method batch(|) is nodal {*} multi method batch(Any:D: Int:D :$elems!) { Seq.new(Rakudo::Iterator.Batch(self.iterator,$elems,1)) } multi method batch(Any:D: Int:D $batch) { Seq.new(Rakudo::Iterator.Batch(self.iterator,$batch,1)) } proto method rotor(|) is nodal {*} multi method rotor(Any:D: Int:D $batch, :$partial) { Seq.new(Rakudo::Iterator.Batch(self.iterator,$batch,$partial)) } multi method rotor(Any:D: *@cycle, :$partial) { Seq.new(Rakudo::Iterator.Rotor(self.iterator,@cycle,$partial)) } } BEGIN Attribute.^compose; proto sub infix:(|) is pure {*} multi sub infix:(Mu:D \a, Mu:U) { a } multi sub infix:(Mu:U, Mu:D \b) { b } multi sub infix:(Mu:D \a, Mu:D \b) { (a cmp b) < 0 ?? a !! b } multi sub infix:(Int:D \a, Int:D \b) { nqp::if(nqp::islt_i(nqp::cmp_I(nqp::decont(a), nqp::decont(b)), 0), a, b) } multi sub infix:(int \a, int \b) { nqp::if(nqp::islt_i(nqp::cmp_i(a, b), 0), a, b) } multi sub infix:(Num:D \a, Num:D \b) { nqp::if(nqp::islt_i(nqp::cmp_n(a, b), 0), a, b) } multi sub infix:(num \a, num \b) { nqp::if(nqp::islt_i(nqp::cmp_n(a, b), 0), a, b) } multi sub infix:(+args is raw) { args.min } proto sub min(|) is pure {*} multi sub min(+args, :&by!) { args.min(&by) } multi sub min(+args) { args.min } proto sub infix:(|) is pure {*} multi sub infix:(Mu:D \a, Mu:U) { a } multi sub infix:(Mu:U, Mu:D \b) { b } multi sub infix:(Mu:D \a, Mu:D \b) { (a cmp b) > 0 ?? a !! b } multi sub infix:(Int:D \a, Int:D \b) { nqp::if(nqp::isgt_i(nqp::cmp_I(nqp::decont(a), nqp::decont(b)), 0), a, b) } multi sub infix:(int \a, int \b) { nqp::if(nqp::isgt_i(nqp::cmp_i(a, b), 0), a, b) } multi sub infix:(Num:D \a, Num:D \b) { nqp::if(nqp::isgt_i(nqp::cmp_n(a, b), 0), a, b) } multi sub infix:(num \a, num \b) { nqp::if(nqp::isgt_i(nqp::cmp_n(a, b), 0), a, b) } multi sub infix:(+args) { args.max } proto sub max(|) is pure {*} multi sub max(+args, :&by!) { args.max(&by) } multi sub max(+args) { args.max } proto sub infix:(|) is pure {*} multi sub infix:(+args) { args.minmax } proto sub minmax(|) is pure {*} multi sub minmax(+args, :&by!) { args.minmax(&by) } multi sub minmax(+args) { args.minmax } proto sub map(|) {*} multi sub map(&code, +values) { my $laze = values.is-lazy; values.map(&code).lazy-if($laze) } proto sub grep(|) {*} multi sub grep(Mu $test, +values, *%a) { my $laze = values.is-lazy; values.grep($test,|%a).lazy-if($laze) } multi sub grep(Bool:D $t, |) { X::Match::Bool.new(:type).throw } proto sub first(|) {*} multi sub first(Bool:D $t, |) { Failure.new(X::Match::Bool.new(:type)) } multi sub first(Mu $test, +values, *%a) { values.first($test,|%a) } proto sub join(|) {*} multi sub join($sep = '', *@values) { @values.join($sep) } proto sub reduce (|) {*} multi sub reduce (&with, +list) { list.reduce(&with) } proto sub produce (|) {*} multi sub produce (&with, +list) { list.produce(&with) } proto sub unique(|) {*} multi sub unique(+values, |c) { my $laze = values.is-lazy; values.unique(|c).lazy-if($laze) } proto sub squish(|) {*} multi sub squish(+values, |c) { my $laze = values.is-lazy; values.squish(|c).lazy-if($laze) } proto sub repeated(|) {*} multi sub repeated(+values, |c) { my $laze = values.is-lazy; values.repeated(|c).lazy-if($laze) } proto sub sort(|) {*} multi sub sort(&by, @values) { @values.sort(&by) } multi sub sort(&by, +values) { values.sort(&by) } multi sub sort(@values) { @values.sort } multi sub sort(+values) { values.sort } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Any.pm60000644000175000017500000004762513253717231014534 0ustar alexalexmy class Pair { ... } my class Range { ... } my class Seq { ... } my class X::Adverb { ... } my class X::Bind { ... } my class X::Bind::Slice { ... } my class X::Bind::ZenSlice { ... } my class X::Item { ... } my class X::Match::Bool { ... } my class X::Pairup::OddNumber { ... } my class X::Subscript::Negative { ... } my role Numeric { ... } my class Any { # declared in BOOTSTRAP # my class Any is Mu multi method ACCEPTS(Any:D: Mu:D \a) { self === a } multi method ACCEPTS(Any:D: Mu:U $ --> False) { } multi method ACCEPTS(Any:U: Any \topic) { # use of Any on topic to force autothreading nqp::p6bool(nqp::istype(topic, self)) # so that all(@foo) ~~ Type works as expected } proto method EXISTS-KEY(|) is nodal {*} multi method EXISTS-KEY(Any:U: $ --> False) { } multi method EXISTS-KEY(Any:D: $ --> False) { } proto method DELETE-KEY(|) is nodal {*} multi method DELETE-KEY(Any:U: $ --> Nil) { } multi method DELETE-KEY(Any:D: $) { Failure.new("Can not remove values from a {self.^name}") } proto method DELETE-POS(|) is nodal {*} multi method DELETE-POS(Any:U: $pos --> Nil) { } multi method DELETE-POS(Any:D: $pos) { Failure.new("Can not remove elements from a {self.^name}") } multi method DELETE-POS(Any:D: \one, \two) is raw { self.AT-POS(one).DELETE-POS(two) } multi method DELETE-POS(Any:D: \one, \two, \three) is raw { self.AT-POS(one).AT-POS(two).DELETE-POS(three) } multi method DELETE-POS(Any:D: **@indices) { my $final := @indices.pop; Rakudo::Internals.WALK-AT-POS(self,@indices).DELETE-POS($final) } method cache() { self.list } proto method list(|) is nodal {*} multi method list(Any:U:) { infix:<,>(self) } multi method list(Any:D \SELF:) { infix:<,>(SELF) } proto method flat(|) is nodal {*} multi method flat() { self.list.flat } proto method eager(|) is nodal {*} multi method eager() { self.list.eager } proto method serial(|) is nodal {*} multi method serial() { self } # derived from .list proto method List(|) is nodal {*} multi method List() { self.list } proto method Slip(|) is nodal {*} multi method Slip() { self.list.Slip } proto method Array(|) is nodal {*} multi method Array() { self.list.Array } proto method Seq(|) is nodal {*} multi method Seq() { Seq.new(self.iterator) } proto method hash(|) is nodal {*} multi method hash(Any:U:) { my % = () } multi method hash(Any:D:) { my % = self } # derived from .hash proto method Hash(|) is nodal {*} multi method Hash() { self.hash.Hash } proto method Map(|) is nodal {*} multi method Map() { self.hash.Map } proto method elems(|) is nodal {*} multi method elems(Any:U: --> 1) { } multi method elems(Any:D:) { self.list.elems } proto method end(|) is nodal {*} multi method end(Any:U: --> 0) { } multi method end(Any:D:) { self.list.end } proto method keys(|) is nodal {*} multi method keys(Any:U:) { () } multi method keys(Any:D:) { self.list.keys } proto method kv(|) is nodal {*} multi method kv(Any:U:) { () } multi method kv(Any:D:) { self.list.kv } proto method values(|) is nodal {*} multi method values(Any:U:) { () } multi method values(Any:D:) { self.list } proto method pairs(|) is nodal {*} multi method pairs(Any:U:) { () } multi method pairs(Any:D:) { self.list.pairs } proto method antipairs(|) is nodal {*} multi method antipairs(Any:U:) { () } multi method antipairs(Any:D:) { self.list.antipairs } proto method invert(|) is nodal {*} multi method invert(Any:U:) { () } multi method invert(Any:D:) { self.list.invert } proto method pick(|) is nodal {*} multi method pick() { self.list.pick } multi method pick($n) { self.list.pick($n) } proto method roll(|) is nodal {*} multi method roll() { self.list.roll } multi method roll($n) { self.list.roll($n) } multi method iterator(Any:) { self.list.iterator } method match(Any:U: |) { self.Str; nqp::getlexcaller('$/') = Nil } proto method classify(|) is nodal {*} multi method classify() { die "Must specify something to classify with, a Callable, Hash or List"; } multi method classify(Whatever) { die "Doesn't make sense to classify with itself"; } multi method classify($test, :$into!, :&as) { ( $into // $into.new ).classify-list( $test, self, :&as); } multi method classify($test, :&as) { Hash.^parameterize(Any,Any).new.classify-list( $test, self, :&as ); } proto method categorize(|) is nodal {*} multi method categorize() { die "Must specify something to categorize with, a Callable, Hash or List"; } multi method categorize(Whatever) { die "Doesn't make sense to categorize with itself"; } multi method categorize($test, :$into!, :&as) { ( $into // $into.new ).categorize-list( $test, self.list, :&as ); } multi method categorize($test, :&as) { Hash.^parameterize(Any,Any).new.categorize-list($test, self.list, :&as); } method reverse() is nodal { self.list.reverse } method combinations(|c) is nodal { self.list.combinations(|c) } method permutations(|c) is nodal { self.list.permutations(|c) } method join($separator = '') is nodal { self.list.join($separator) } # XXX GLR should move these method nodemap(&block) is nodal { nodemap(&block, self) } method duckmap(&block) is nodal { duckmap(&block, self) } method deepmap(&block) is nodal { deepmap(&block, self) } # XXX GLR Do we need tree post-GLR? proto method tree(|) is nodal {*} multi method tree(Any:U:) { self } multi method tree(Any:D:) { nqp::istype(self, Iterable) ?? self.map({ .tree }).item !! self } multi method tree(Any:D: Whatever ) { self.tree } multi method tree(Any:D: Int(Cool) $count) { nqp::istype(self, Iterable) && $count > 0 ?? self.map({ .tree($count - 1) }).item !! self } multi method tree(Any:D: @ [&first, *@rest]) { self.tree(&first, |@rest); } multi method tree(Any:D: &first, *@rest) { nqp::istype(self, Iterable) ?? @rest ?? first(self.map({ .tree(|@rest) })) !! first(self) !! self } # auto-vivifying proto method push(|) is nodal {*} multi method push(Any:U \SELF: |values) { SELF = nqp::istype(SELF,Positional) ?? SELF.new !! Array.new; SELF.push(|values); } proto method append(|) is nodal {*} multi method append(Any:U \SELF: |values) { SELF = nqp::istype(SELF,Positional) ?? SELF.new !! Array.new; SELF.append(|values); } proto method unshift(|) is nodal {*} multi method unshift(Any:U \SELF: |values) { SELF = Array.new; SELF.unshift(|values); } proto method prepend(|) is nodal {*} multi method prepend(Any:U \SELF: |values) { SELF = Array.new; SELF.prepend(|values); } proto method EXISTS-POS(|) is nodal {*} multi method EXISTS-POS(Any:U: Any:D $ --> False) { } multi method EXISTS-POS(Any:U: Any:U $pos) { die "Cannot use '{$pos.^name}' as an index"; } multi method EXISTS-POS(Any:D: int \pos) { nqp::p6bool(nqp::iseq_i(pos,0)); } multi method EXISTS-POS(Any:D: Int:D \pos) { pos == 0; } multi method EXISTS-POS(Any:D: Num:D \pos) { X::Item.new(aggregate => self, index => pos).throw if nqp::isnanorinf(pos); self.AT-POS(nqp::unbox_i(pos.Int)); pos == 0; } multi method EXISTS-POS(Any:D: Any:D \pos) { pos.Int == 0; } multi method EXISTS-POS(Any:D: Any:U \pos) { die "Cannot use '{pos.^name}' as an index"; } multi method EXISTS-POS(Any:D: \one, \two) is raw { self.AT-POS(one).EXISTS-POS(two) } multi method EXISTS-POS(Any:D: \one, \two,\three) is raw { self.AT-POS(one).AT-POS(two).EXISTS-POS(three) } multi method EXISTS-POS(Any:D: **@indices) { my $final := @indices.pop; Rakudo::Internals.WALK-AT-POS(self,@indices).EXISTS-POS($final) } proto method AT-POS(|) is nodal {*} multi method AT-POS(Any:U \SELF: int \pos) is raw { nqp::p6bindattrinvres( my $scalar, Scalar, '$!whence', -> { nqp::if( nqp::isconcrete(SELF), SELF, (SELF = Array.new) ).BIND-POS(pos, $scalar) } ) } multi method AT-POS(Any:U \SELF: Int:D \pos) is raw { nqp::p6bindattrinvres( my $scalar, Scalar, '$!whence', -> { nqp::if( nqp::isconcrete(SELF), SELF, (SELF = Array.new) ).BIND-POS(pos, $scalar) } ) } multi method AT-POS(Any:U: Num:D \pos) is raw { nqp::isnanorinf(pos) ?? Failure.new(X::Item.new(aggregate => self, index => pos)) !! self.AT-POS(nqp::unbox_i(pos.Int)) } multi method AT-POS(Any:U: Any:D \pos) is raw { self.AT-POS(nqp::unbox_i(pos.Int)); } multi method AT-POS(Any:D: int \pos) is raw { pos ?? Failure.new(X::OutOfRange.new( :what($*INDEX // 'Index'), :got(pos), :range<0..0>)) !! self } multi method AT-POS(Any:D: Int:D \pos) is raw { pos ?? Failure.new(X::OutOfRange.new( :what($*INDEX // 'Index'), :got(pos), :range<0..0>)) !! self } multi method AT-POS(Any:D: Num:D \pos) is raw { nqp::isnanorinf(pos) ?? Failure.new(X::Item.new(aggregate => self, index => pos)) !! self.AT-POS(nqp::unbox_i(pos.Int)) } multi method AT-POS(Any:D: Any:D \pos) is raw { self.AT-POS(nqp::unbox_i(pos.Int)); } multi method AT-POS(Any: Any:U \pos) is raw { die "Cannot use '{pos.^name}' as an index"; } multi method AT-POS(Any:D: \one, \two) is raw { self.AT-POS(one).AT-POS(two) } multi method AT-POS(Any:D: \one, \two, \three) is raw { self.AT-POS(one).AT-POS(two).AT-POS(three) } multi method AT-POS(Any:D: **@indices) is raw { my $final := @indices.pop; Rakudo::Internals.WALK-AT-POS(self,@indices).AT-POS($final) } proto method ZEN-POS(|) {*} multi method ZEN-POS(*%unexpected) { %unexpected ?? Failure.new(X::Adverb.new( :what('[] slice'), :source(try { self.VAR.name } // self.WHAT.perl), :unexpected(%unexpected.keys))) !! self } proto method ZEN-KEY(|) {*} multi method ZEN-KEY(*%unexpected) { %unexpected ?? Failure.new(X::Adverb.new( :what('{} slice'), :source(try { self.VAR.name } // self.WHAT.perl), :unexpected(%unexpected.keys))) !! self } proto method ASSIGN-POS(|) is nodal {*} multi method ASSIGN-POS(Any:U \SELF: \pos, Mu \assignee) { SELF.AT-POS(pos) = assignee; # defer < 0 check } multi method ASSIGN-POS(Any:D: int \pos, Mu \assignee) { self.AT-POS(pos) = assignee; # defer < 0 check } multi method ASSIGN-POS(Any:D: Int:D \pos, Mu \assignee) { self.AT-POS(pos) = assignee; # defer < 0 check } multi method ASSIGN-POS(Any:D: Num:D \pos, Mu \assignee) { nqp::isnanorinf(pos) ?? Failure.new(X::Item.new(aggregate => self, index => pos)) !! self.AT-POS(nqp::unbox_i(pos.Int)) = assignee; # defer < 0 check } multi method ASSIGN-POS(Any:D: Any:D \pos, Mu \assignee) { self.AT-POS(nqp::unbox_i(pos.Int)) = assignee; # defer < 0 check } multi method ASSIGN-POS(Any:D: Any:U \pos, Mu \assignee) { die "Cannot use '{pos.^name}' as an index"; } multi method ASSIGN-POS(Any:D: \one, \two, Mu \assignee) is raw { self.AT-POS(one).ASSIGN-POS(two, assignee) } multi method ASSIGN-POS(Any:D: \one, \two, \three, Mu \assignee) is raw { self.AT-POS(one).AT-POS(two).ASSIGN-POS(three, assignee) } multi method ASSIGN-POS(Any:D: **@indices) { my \value := @indices.pop; my $final := @indices.pop; Rakudo::Internals.WALK-AT-POS(self,@indices).ASSIGN-POS($final,value) } proto method BIND-POS(|) {*} multi method BIND-POS(Any:D: **@indices is raw) is raw { # looks like Array.pop doesn't really return a bindable container # my \value := @indices.pop; # my $final := @indices.pop; # Rakudo::Internals.WALK-AT-POS(self,@indices).BIND-POS($final,value) my int $elems = @indices.elems; # reifies my \value := @indices.AT-POS(--$elems); my $final := @indices.AT-POS(--$elems); my $target := self; my int $i = -1; $target := $target.AT-POS(@indices.AT-POS($i)) while nqp::islt_i(++$i,$elems); X::Bind.new.throw if $target =:= self; $target.BIND-POS($final, value) } method all() is nodal { Junction.new("all", self) } method any() is nodal { Junction.new("any", self) } method one() is nodal { Junction.new("one", self) } method none() is nodal { Junction.new("none",self) } # internals proto method AT-KEY(|) is nodal {*} multi method AT-KEY(Any:D: $key) is raw { Failure.new( self ~~ Associative ?? "Associative indexing implementation missing from type {self.WHAT.perl}" !! "Type {self.WHAT.perl} does not support associative indexing." ) } multi method AT-KEY(Any:U \SELF: \key) is raw { nqp::p6bindattrinvres( my $scalar, Scalar, '$!whence', # NOTE: even though the signature indicates a non-concrete SELF, # by the time the below code is executed, it *may* have become # concrete: and then we don't want the execution to reset it to # an empty Hash. -> { nqp::if( nqp::isconcrete(SELF), SELF, (SELF = nqp::create(Hash)) ).BIND-KEY(key, $scalar) } ) } proto method BIND-KEY(|) is nodal {*} multi method BIND-KEY(Any:D: \k, \v) is raw { X::Bind.new(target => self.^name).throw } multi method BIND-KEY(Any:U \SELF: $key, $BIND ) is raw { SELF = Hash.new; SELF.BIND-KEY($key, $BIND); $BIND } proto method ASSIGN-KEY(|) is nodal {*} multi method ASSIGN-KEY(\SELF: \key, Mu \assignee) is raw { SELF.AT-KEY(key) = assignee; } # XXX GLR review these method FLATTENABLE_LIST() is nodal { my $list := self.list; nqp::findmethod($list, 'FLATTENABLE_LIST')($list); } method FLATTENABLE_HASH() is nodal { nqp::hash() } proto method Set(|) is nodal {*} multi method Set(Any:) { Set.new-from-pairs(self.list) } proto method SetHash(|) is nodal {*} multi method SetHash(Any:) { SetHash.new-from-pairs(self.list) } proto method Bag(|) is nodal {*} multi method Bag(Any:) { Bag.new-from-pairs(self.list) } proto method BagHash(|) is nodal {*} multi method BagHash(Any:) { BagHash.new-from-pairs(self.list) } proto method Mix(|) is nodal {*} multi method Mix(Any:) { Mix.new-from-pairs(self.list) } proto method MixHash(|) is nodal {*} multi method MixHash() { MixHash.new-from-pairs(self.list) } # XXX GLR does this really need to force a list? proto method Supply(|) is nodal {*} multi method Supply() { self.list.Supply } method nl-out() { "\n" } method print-nl() { self.print(self.nl-out) } method lazy-if($flag) { self } # no-op on non-Iterables method sum() is nodal { my \iter = self.iterator; my $sum = 0; my Mu $value; nqp::until( nqp::eqaddr(($value := iter.pull-one),IterationEnd), ($sum = $sum + $value) ); $sum; } } Metamodel::ClassHOW.exclude_parent(Any); # builtin ops proto sub infix:<===>(Mu $?, Mu $?) is pure {*} multi sub infix:<===>($?) { Bool::True } multi sub infix:<===>(\a, \b) { nqp::p6bool( nqp::eqaddr(nqp::decont(a),nqp::decont(b)) || (nqp::eqaddr(a.WHAT,b.WHAT) && nqp::iseq_s(nqp::unbox_s(a.WHICH), nqp::unbox_s(b.WHICH))) ) } proto sub infix:(Mu $?, Mu $?) is pure {*} multi sub infix:($?) { Bool::True } multi sub infix:(\a, \b) { (a cmp b) < 0 } proto sub infix:(Mu $?, Mu $?) is pure {*} multi sub infix:($x?) { Bool::True } multi sub infix:(\a, \b) { (a cmp b) > 0 } proto prefix:<++>(Mu) {*} multi prefix:<++>(Mu:D $a is rw) { $a = $a.succ } multi prefix:<++>(Mu:U $a is rw) { $a = 1 } proto prefix:<-->(Mu) {*} multi prefix:<-->(Mu:D $a is rw) { $a = $a.pred } multi prefix:<-->(Mu:U $a is rw) { $a = -1 } proto postfix:<++>(Mu) {*} multi postfix:<++>(Mu:D $a is rw) { my $b = $a; $a = $a.succ; $b } multi postfix:<++>(Mu:U $a is rw) { $a = 1; 0 } proto postfix:<-->(Mu) {*} multi postfix:<-->(Mu:D $a is rw) { my $b = $a; $a = $a.pred; $b } multi postfix:<-->(Mu:U $a is rw) { $a = -1; 0 } proto sub pick(|) {*} multi sub pick($n, +values) { values.pick($n) } proto sub roll(|) {*} multi sub roll($n, +values) { values.roll($n) } proto sub keys(|) {*} multi sub keys($x) { $x.keys } proto sub values(|) {*} multi sub values($x) { $x.values } proto sub pairs(|) {*} multi sub pairs($x) { $x.pairs } proto sub kv(|) {*} multi sub kv($x) { $x.kv } proto sub elems(|) is nodal {*} multi sub elems($a) { $a.elems } proto sub end(|) {*} multi sub end($a) { $a.end } proto sub sum(|) {*} multi sub sum() { 0 } multi sub sum(\SELF) { SELF.sum } multi sub sum(+SELF) { SELF.sum } proto sub classify(|) {*} multi sub classify($test, +items, :$into!, *%named ) { ( $into // $into.new).classify-list($test, items, |%named) } multi sub classify($test, +items, *%named ) { Hash.^parameterize(Any,Any).new.classify-list($test, items, |%named); } proto sub categorize(|) {*} multi sub categorize($test, +items, :$into!, *%named ) { ( $into // $into.new).categorize-list($test, items, |%named) } multi sub categorize($test, +items, *%named ) { Hash.^parameterize(Any,Any).new.categorize-list($test, items, |%named) } proto sub item(|) is pure {*} multi sub item(\x) { my $ = x } multi sub item(|c) { my $ = c.list } multi sub item(Mu $a) { $a } sub SLICE_HUH(\SELF, @nogo, %d, %adv) { @nogo.unshift('delete') # recover any :delete if necessary if @nogo && @nogo[0] ne 'delete' && %adv.EXISTS-KEY('delete'); for -> $valid { # check all valid params if nqp::existskey(%d,nqp::unbox_s($valid)) { nqp::deletekey(%d,nqp::unbox_s($valid)); @nogo.push($valid); } } Failure.new(X::Adverb.new( :what, :source(try { SELF.VAR.name } // SELF.WHAT.perl), :unexpected(%d.keys), :nogo(@nogo), )) } #SLICE_HUH sub dd(|) { my Mu $args := nqp::p6argvmarray(); if nqp::elems($args) { while $args { my $var := nqp::shift($args); my $name := ! nqp::istype($var.VAR, Failure) && try $var.VAR.name; my $type := $var.WHAT.^name; my $what := nqp::can($var, 'is-lazy') && $var.is-lazy ?? $var[^10].perl.chop ~ "... lazy list)" !! nqp::can($var, 'perl') ?? $var.perl !! "($var.^name() without .perl method)"; note $name ?? "$type $name = $what" !! $what; } } else { # tell where we are note .name ?? "{lc .^name} {.name}{.signature.gist}" !! "{lc .^name} {.signature.gist}" with callframe(1).code; } return } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Argfiles.pm60000644000175000017500000000141113253717231015520 0ustar alexalexRakudo::Internals.REGISTER-DYNAMIC: '@*ARGS', { my @ARGS; my Mu $argiter := nqp::getcurhllsym('$!ARGITER'); @ARGS.push(nqp::p6box_s(nqp::shift($argiter))) while $argiter; PROCESS::<@ARGS> := @ARGS; } Rakudo::Internals.REGISTER-DYNAMIC: '$*ARGFILES', { # Here, we use $*IN's attributes to init the arg files because # the $*ARGFILES won't get instantiated until first access and by that # time the user may have already modified $*IN's attributes to their liking PROCESS::<$ARGFILES> = @*ARGS ?? IO::ArgFiles.new(@*ARGS) !! IO::ArgFiles.new: (my $in := $*IN), :nl-in($in.nl-in), :chomp($in.chomp), :encoding($in.encoding), :bin(nqp::p6bool(nqp::isfalse($in.encoding))); } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/array_operators.pm60000644000175000017500000000420713253717231017206 0ustar alexalex# The [...] term creates an Array. proto circumfix:<[ ]>(|) {*} multi circumfix:<[ ]>() { nqp::create(Array) } multi circumfix:<[ ]>(Iterable:D \iterable) { my $reified; nqp::if( nqp::iscont(iterable), nqp::p6bindattrinvres( nqp::create(Array),List,'$!reified', nqp::stmts( nqp::push( ($reified := nqp::create(IterationBuffer)), nqp::assign(nqp::p6scalarfromdesc(nqp::null),iterable) ), $reified ) ), nqp::if( nqp::eqaddr(iterable.WHAT,List), nqp::if( iterable.is-lazy, Array.from-iterator(iterable.iterator), nqp::stmts( # immutable List (my int $elems = iterable.elems), # reifies (my $params := nqp::getattr(iterable,List,'$!reified')), (my int $i = -1), ($reified := nqp::setelems(nqp::create(IterationBuffer),$elems)), nqp::while( nqp::islt_i(($i = nqp::add_i($i,1)),$elems), nqp::bindpos($reified,$i,nqp::assign( nqp::p6scalarfromdesc(nqp::null),nqp::atpos($params,$i)) ) ), nqp::p6bindattrinvres(nqp::create(Array),List,'$!reified',$reified) ), ), Array.from-iterator(iterable.iterator) ) ) } multi circumfix:<[ ]>(Mu \x) { # really only for [$foo] nqp::p6bindattrinvres( nqp::create(Array),List,'$!reified', nqp::stmts( nqp::push( (my $reified := nqp::create(IterationBuffer)), nqp::assign(nqp::p6scalarfromdesc(nqp::null),x) ), $reified ) ) } proto sub pop(@) {*} multi sub pop(@a) { @a.pop } proto sub shift(@) {*} multi sub shift(@a) { @a.shift } proto sub push(|) {*} multi sub push(\a, |elems) { a.push: |elems } proto sub append(|) {*} multi sub append(\a, |elems) { a.append: |elems } proto sub unshift(|) {*} multi sub unshift(\a, |elems) { a.unshift: |elems } proto sub prepend(|) {*} multi sub prepend(\a, |elems) { a.prepend: |elems } proto sub splice(|) {*} multi sub splice(@arr, |c) { @arr.splice(|c) } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Array.pm60000644000175000017500000013141413253717231015051 0ustar alexalex# for our tantrums my class X::TypeCheck { ... }; my class X::TypeCheck::Splice { ... } my class X::Subscript::Negative { ... }; my class X::NotEnoughDimensions { ... }; my class X::Assignment::ArrayShapeMismatch { ... }; # stub what we need now my class array is repr('VMArray') { ... }; # An Array is a List that ensures every item added to it is in a Scalar # container. It also supports push, pop, shift, unshift, splice, BIND-POS, # and so forth. my class Array { # declared in BOOTSTRAP # class Array is List # has Mu $!descriptor; my class ArrayReificationTarget { has $!target; has $!descriptor; method new(\target, Mu \descriptor) { nqp::stmts( nqp::bindattr((my \rt = nqp::create(self)), self,'$!target',target), nqp::p6bindattrinvres(rt, self,'$!descriptor',descriptor) ) } method push(Mu \value) { nqp::push($!target, nqp::assign(nqp::p6scalarfromdesc($!descriptor), value)); } } my class ListReificationTarget { has $!target; method new(\target) { nqp::p6bindattrinvres(nqp::create(self), self, '$!target', target); } method push(Mu \value) { nqp::push($!target, nqp::decont(value)); } } multi method clone(Array:D:) { nqp::stmts( (my \iter := self.iterator), (my \result := nqp::p6bindattrinvres(nqp::create(self), Array, '$!descriptor', nqp::isnull($!descriptor) ?? (nqp::null) !! nqp::clone($!descriptor))), nqp::if( nqp::eqaddr( IterationEnd, iter.push-until-lazy: my \target := ArrayReificationTarget.new( (my \buffer := nqp::create(IterationBuffer)), nqp::isnull($!descriptor) ?? (nqp::null) !! nqp::clone($!descriptor))), nqp::p6bindattrinvres(result, List, '$!reified', buffer), nqp::stmts( nqp::bindattr(result, List, '$!reified', buffer), nqp::bindattr((my \todo := nqp::create(List::Reifier)), List::Reifier,'$!current-iter', iter), nqp::bindattr(todo, List::Reifier,'$!reified', buffer), nqp::bindattr(todo, List::Reifier,'$!reification-target', target), nqp::p6bindattrinvres(result, List, '$!todo', todo)))) } method iterator(Array:D:) { # something to iterate over in the future if nqp::getattr(self,List,'$!todo').DEFINITE { class :: does Iterator { has int $!i; has $!array; has $!reified; has $!todo; has $!descriptor; method !SET-SELF(\array) { $!i = -1; $!array := array; $!reified := nqp::ifnull( nqp::getattr( array,List,'$!reified'), nqp::bindattr(array,List,'$!reified', nqp::create(IterationBuffer)) ); $!todo := nqp::getattr(array,List, '$!todo'); $!descriptor := nqp::getattr(array,Array,'$!descriptor'); self } method new(\array) { nqp::create(self)!SET-SELF(array) } method pull-one() is raw { nqp::ifnull( nqp::atpos($!reified,$!i = nqp::add_i($!i,1)), nqp::islt_i($!i,nqp::elems($!reified)) ?? self!hole($!i) !! $!todo.DEFINITE ?? nqp::islt_i($!i,$!todo.reify-at-least(nqp::add_i($!i,1))) ?? nqp::atpos($!reified,$!i) # cannot be nqp::null !! self!done !! IterationEnd ) } method !hole(int $i) { nqp::p6bindattrinvres( (my \v := nqp::p6scalarfromdesc($!descriptor)), Scalar, '$!whence', -> { nqp::bindpos($!reified,$i,v) } ) } method !done() is raw { $!todo := nqp::bindattr($!array,List,'$!todo',Mu); IterationEnd } method push-until-lazy($target) { nqp::if( nqp::isconcrete($!todo), nqp::stmts( (my int $elems = $!todo.reify-until-lazy), (my int $i = $!i), # lexicals faster than attributes nqp::while( # doesn't sink nqp::islt_i($i = nqp::add_i($i,1),$elems), $target.push(nqp::atpos($!reified,$i)) ), nqp::if( $!todo.fully-reified, nqp::stmts( ($!i = $i), self!done ), nqp::stmts( ($!i = nqp::sub_i($elems,1)), Mu ) ) ), nqp::stmts( ($elems = nqp::elems($!reified)), ($i = $!i), nqp::while( # doesn't sink nqp::islt_i($i = nqp::add_i($i,1),$elems), $target.push( nqp::ifnull(nqp::atpos($!reified,$i),self!hole($i)) ) ), ($!i = $i), IterationEnd ) ) } method is-lazy() { $!todo.DEFINITE && $!todo.is-lazy } }.new(self) } # everything we need is already there elsif nqp::getattr(self,List,'$!reified').DEFINITE { Rakudo::Iterator.ReifiedArray( self, nqp::getattr(self,Array,'$!descriptor') ) } # nothing now or in the future to iterate over else { Rakudo::Iterator.Empty } } method from-iterator(Array:U: Iterator $iter) { nqp::if( nqp::eqaddr( $iter.push-until-lazy( my \target := ArrayReificationTarget.new( (my \buffer := nqp::create(IterationBuffer)), nqp::null ) ), IterationEnd ), nqp::p6bindattrinvres(nqp::create(self),List,'$!reified',buffer), nqp::stmts( nqp::bindattr((my \result := nqp::create(self)), List,'$!reified',buffer), nqp::bindattr((my \todo := nqp::create(List::Reifier)), List::Reifier,'$!current-iter',$iter), nqp::bindattr(todo, List::Reifier,'$!reified',buffer), nqp::bindattr(todo, List::Reifier,'$!reification-target',target), nqp::p6bindattrinvres(result,List,'$!todo',todo) ) ) } proto method new(|) {*} multi method new(:$shape!) { nqp::if( nqp::defined($shape), set-shape(self,$shape), nqp::if( Metamodel::EnumHOW.ACCEPTS($shape.HOW), set-shape(self,$shape.^elems), nqp::create(self) ) ) } multi method new() { nqp::create(self) } multi method new(\values, :$shape!) { nqp::if( nqp::defined($shape), set-shape(self,$shape), nqp::if( Metamodel::EnumHOW.ACCEPTS($shape.HOW), set-shape(self,$shape.^elems), nqp::create(self) ) ).STORE(values) } multi method new(\values) { nqp::create(self).STORE(values) } multi method new(**@values is raw, :$shape!) { nqp::if( nqp::defined($shape), set-shape(self,$shape), nqp::if( Metamodel::EnumHOW.ACCEPTS($shape.HOW), set-shape(self,$shape.^elems), nqp::create(self) ) ).STORE(@values) } multi method new(**@values is raw) { nqp::create(self).STORE(@values) } proto method STORE(|) {*} multi method STORE(Array:D: Iterable:D \iterable) { nqp::iscont(iterable) ?? self!STORE-ONE(iterable) !! self!STORE-ITERABLE(iterable) } multi method STORE(Array:D: Mu \item) { self!STORE-ONE(item) } method !STORE-ITERABLE(\iterable) { my \new-storage = nqp::create(IterationBuffer); my \iter = iterable.iterator; my \target = ArrayReificationTarget.new(new-storage, nqp::decont($!descriptor)); if iter.push-until-lazy(target) =:= IterationEnd { nqp::bindattr(self, List, '$!todo', Mu); } else { my \new-todo = nqp::create(List::Reifier); nqp::bindattr(new-todo, List::Reifier, '$!reified', new-storage); nqp::bindattr(new-todo, List::Reifier, '$!current-iter', iter); nqp::bindattr(new-todo, List::Reifier, '$!reification-target', target); nqp::bindattr(self, List, '$!todo', new-todo); } nqp::bindattr(self, List, '$!reified', new-storage); self } method !STORE-ONE(Mu \item) { my \new-storage = nqp::create(IterationBuffer); nqp::push(new-storage, nqp::assign(nqp::p6scalarfromdesc($!descriptor), item)); nqp::bindattr(self, List, '$!reified', new-storage); nqp::bindattr(self, List, '$!todo', Mu); self } method reification-target() { ArrayReificationTarget.new( nqp::getattr(self, List, '$!reified'), nqp::decont($!descriptor)) } multi method Slip(Array:D:) { # A Slip-With-Default is a special kind of Slip that also has a # descriptor to be able to generate containers for null elements that # have type and default information. my class Slip-With-Descriptor is Slip { has $!descriptor; method iterator() { Rakudo::Iterator.ReifiedArray(self,$!descriptor) } method !AT-POS-CONTAINER(Int:D \pos) { nqp::p6bindattrinvres( (my $scalar := nqp::p6scalarfromdesc($!descriptor)), Scalar, '$!whence', -> { nqp::bindpos( nqp::getattr(self,List,'$!reified'),pos,$scalar) } ) } multi method AT-POS(Int:D \pos) { nqp::ifnull( nqp::atpos(nqp::getattr(self,List,'$!reified'),pos), self!AT-POS-CONTAINER(pos) ) } method default() { $!descriptor.default } } BEGIN Slip-With-Descriptor.^set_name("Slip"); nqp::if( nqp::getattr(self,List,'$!todo').DEFINITE, # We're not fully reified, and so have internal mutability still. # The safe thing to do is to take an iterator of ourself and build # the Slip out of that. Slip.from-iterator(self.iterator), # We're fully reified. Make a Slip that shares our reified buffer # but that will fill in default values for nulls. nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE, nqp::p6bindattrinvres( nqp::p6bindattrinvres( nqp::create(Slip-With-Descriptor), Slip-With-Descriptor, '$!descriptor', $!descriptor ), List, '$!reified', nqp::getattr(self,List,'$!reified') ), nqp::create(Slip) ) ) } method FLATTENABLE_LIST() { nqp::if( nqp::getattr(self,List,'$!todo').DEFINITE, nqp::stmts( nqp::getattr(self,List,'$!todo').reify-all, nqp::getattr(self,List,'$!reified') ), nqp::if( (my $reified := nqp::getattr(self,List,'$!reified')).DEFINITE, nqp::stmts( nqp::if( (my int $elems = nqp::elems($reified)), nqp::stmts( (my int $i = -1), nqp::while( nqp::islt_i(($i = nqp::add_i($i,1)),$elems), nqp::if( nqp::isnull(nqp::atpos($reified,$i)), nqp::bindpos( $reified, $i, nqp::p6scalarfromdesc($!descriptor) ) ) ) ) ), nqp::getattr(self,List,'$!reified') ), nqp::bindattr(self,List,'$!reified',nqp::create(IterationBuffer)) ) ) } multi method flat(Array:U:) { self } multi method flat(Array:D:) { Seq.new(self.iterator) } multi method List(Array:D: :$view) { nqp::if( self.is-lazy, # can't make a List X::Cannot::Lazy.new(:action).throw, nqp::if( # all reified (my $reified := nqp::getattr(self,List,'$!reified')).DEFINITE, nqp::if( $view, # assume no change in array nqp::p6bindattrinvres( nqp::create(List),List,'$!reified',$reified), nqp::stmts( # make cow copy (my int $elems = nqp::elems($reified)), (my $cow := nqp::setelems(nqp::create(IterationBuffer),$elems)), (my int $i = -1), nqp::while( nqp::islt_i(($i = nqp::add_i($i,1)),$elems), nqp::bindpos($cow,$i,nqp::ifnull(nqp::decont(nqp::atpos($reified,$i)),Nil)), ), nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',$cow) ) ), nqp::create(List) # was empty, is empty ) ) } method shape() { (*,) } multi method AT-POS(Array:D: int $pos) is raw { nqp::if( nqp::isge_i($pos,0) && nqp::isconcrete(nqp::getattr(self,List,'$!reified')), nqp::ifnull( nqp::atpos(nqp::getattr(self,List,'$!reified'),$pos), self!AT-POS-SLOW($pos) ), self!AT-POS-SLOW($pos) ) } # because this is a very hot path, we copied the code from the int candidate multi method AT-POS(Array:D: Int:D $pos) is raw { nqp::if( nqp::isge_i($pos,0) && nqp::isconcrete(nqp::getattr(self,List,'$!reified')), nqp::ifnull( nqp::atpos(nqp::getattr(self,List,'$!reified'),$pos), self!AT-POS-SLOW($pos) ), self!AT-POS-SLOW($pos) ) } # handle any lookup that's not simple method !AT-POS-SLOW(\pos) is raw { nqp::if( nqp::islt_i(pos, 0), self!index-oor(pos), nqp::if( nqp::isconcrete(my $reified := nqp::getattr(self,List,'$!reified')), nqp::if( nqp::islt_i(pos,nqp::elems($reified)), self!AT-POS-CONTAINER(pos), # it's a hole nqp::if( # too far out, try reifying nqp::isconcrete(my $todo := nqp::getattr(self,List,'$!todo')), nqp::stmts( $todo.reify-at-least(nqp::add_i(pos,1)), nqp::ifnull( nqp::atpos($reified,pos), # reified ok self!AT-POS-CONTAINER(pos) # reifier didn't reach ) ), self!AT-POS-CONTAINER(pos) # create an outlander ) ), # no reified, implies no todo nqp::stmts( # create reified nqp::bindattr(self,List,'$!reified',nqp::create(IterationBuffer)), self!AT-POS-CONTAINER(pos) # create an outlander ) ) ) } method !AT-POS-CONTAINER(int $pos) is raw { nqp::p6bindattrinvres( (my $scalar := nqp::p6scalarfromdesc($!descriptor)), Scalar, '$!whence', -> { nqp::bindpos(nqp::getattr(self,List,'$!reified'),$pos,$scalar) } ) } multi method ASSIGN-POS(Array:D: int $pos, Mu \assignee) { # Fast path: index > 0, $!reified is set up, either have a container # or no $!todo so can just bind there my \reified := nqp::getattr(self,List,'$!reified'); nqp::if( nqp::isge_i($pos, 0) && nqp::isconcrete(reified), nqp::stmts( (my \target := nqp::atpos(reified, $pos)), nqp::if( nqp::isnull(target), nqp::if( nqp::isconcrete(nqp::getattr(self, List, '$!todo')), self!ASSIGN-POS-SLOW-PATH($pos, assignee), nqp::assign( nqp::bindpos(reified, $pos, nqp::p6scalarfromdesc($!descriptor)), assignee ) ), nqp::assign(target, assignee) ) ), self!ASSIGN-POS-SLOW-PATH($pos, assignee) ) } # because this is a very hot path, we copied the code from the int candidate multi method ASSIGN-POS(Array:D: Int:D $pos, Mu \assignee) { # Fast path: index > 0, $!reified is set up, either have a container # or no $!todo so can just bind there my \reified := nqp::getattr(self,List,'$!reified'); my int $ipos = $pos; nqp::if( nqp::isge_i($ipos, 0) && nqp::isconcrete(reified), nqp::stmts( (my \target := nqp::atpos(reified, $ipos)), nqp::if( nqp::isnull(target), nqp::if( nqp::isconcrete(nqp::getattr(self, List, '$!todo')), self!ASSIGN-POS-SLOW-PATH($pos, assignee), nqp::assign( nqp::bindpos(reified, $ipos, nqp::p6scalarfromdesc($!descriptor)), assignee ) ), nqp::assign(target, assignee) ) ), self!ASSIGN-POS-SLOW-PATH($pos, assignee) ) } method !ASSIGN-POS-SLOW-PATH(Array:D: Int:D $pos, Mu \assignee) { nqp::if( nqp::islt_i($pos,0), self!index-oor($pos), nqp::if( nqp::isconcrete(nqp::getattr(self,List,'$!reified')), nqp::ifnull( nqp::atpos(nqp::getattr(self,List,'$!reified'),$pos), nqp::if( nqp::islt_i( # it's a hole $pos, nqp::elems(nqp::getattr(self,List,'$!reified')) ), nqp::bindpos( nqp::getattr(self,List,'$!reified'), $pos, nqp::p6scalarfromdesc($!descriptor) ), nqp::if( nqp::isconcrete(nqp::getattr(self,List,'$!todo')), nqp::stmts( # can reify nqp::getattr(self,List,'$!todo') .reify-at-least(nqp::add_i($pos,1)), nqp::ifnull( nqp::atpos( # reified nqp::getattr(self,List,'$!reified'), $pos ), nqp::bindpos( # outlander nqp::getattr(self,List,'$!reified'), $pos, nqp::p6scalarfromdesc($!descriptor) ) ) ), nqp::bindpos( # outlander without todo nqp::getattr(self,List,'$!reified'), $pos, nqp::p6scalarfromdesc($!descriptor) ) ) ) ), nqp::bindpos( # new outlander nqp::bindattr(self,List,'$!reified',nqp::create(IterationBuffer)), $pos, nqp::p6scalarfromdesc($!descriptor) ) ) = assignee ) } multi method BIND-POS(Array:D: int $pos, Mu \bindval) is raw { nqp::if( nqp::islt_i($pos,0), self!index-oor($pos), nqp::stmts( nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE, nqp::if( (nqp::isge_i( $pos,nqp::elems(nqp::getattr(self,List,'$!reified'))) && nqp::getattr(self,List,'$!todo').DEFINITE), nqp::getattr(self,List,'$!todo').reify-at-least( nqp::add_i($pos,1)), ), nqp::bindattr(self,List,'$!reified',nqp::create(IterationBuffer)) ), nqp::bindpos(nqp::getattr(self,List,'$!reified'),$pos,bindval) ) ) } # because this is a very hot path, we copied the code from the int candidate multi method BIND-POS(Array:D: Int:D $pos, Mu \bindval) is raw { nqp::if( nqp::islt_i($pos,0), self!index-oor($pos), nqp::stmts( nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE, nqp::if( (nqp::isge_i( $pos,nqp::elems(nqp::getattr(self,List,'$!reified'))) && nqp::getattr(self,List,'$!todo').DEFINITE), nqp::getattr(self,List,'$!todo').reify-at-least( nqp::add_i($pos,1)), ), nqp::bindattr(self,List,'$!reified',nqp::create(IterationBuffer)) ), nqp::bindpos(nqp::getattr(self,List,'$!reified'),$pos,bindval) ) ) } multi method DELETE-POS(Array:D: int $pos) is raw { nqp::if( nqp::islt_i($pos,0), self!index-oor($pos), nqp::if( (my $reified := nqp::getattr(self,List,'$!reified')).DEFINITE, nqp::stmts( nqp::if( (my $todo := nqp::getattr(self,List,'$!todo')).DEFINITE, $todo.reify-at-least(nqp::add_i($pos,1)), ), nqp::if( nqp::isle_i( # something to delete $pos,my int $end = nqp::sub_i(nqp::elems($reified),1)), nqp::stmts( (my $value := nqp::ifnull( # save the value nqp::atpos($reified,$pos), self.default )), nqp::bindpos($reified,$pos,nqp::null), # remove this one nqp::if( nqp::iseq_i($pos,$end) && nqp::not_i(nqp::defined($todo)), nqp::stmts( # shorten from end (my int $i = $pos), nqp::while( (nqp::isge_i(($i = nqp::sub_i($i,1)),0) && nqp::not_i(nqp::existspos($reified,$i))), nqp::null ), nqp::setelems($reified,nqp::add_i($i,1)) ), ), $value # value, if any ), self.default # outlander ), ), self.default # no elements ) ) } multi method DELETE-POS(Array:D: Int:D $pos) is raw { self.DELETE-POS(nqp::unbox_i($pos)) } method !index-oor($pos) { Failure.new(X::OutOfRange.new( :what($*INDEX // 'Index'), :got($pos), :range<0..^Inf> )) } # MUST have a separate Slip variant to have it slip multi method push(Array:D: Slip \value) { self.is-lazy ?? X::Cannot::Lazy.new(action => 'push to').throw !! self!append-list(value) } multi method push(Array:D: \value) { nqp::if( self.is-lazy, X::Cannot::Lazy.new(action => 'push to').throw, nqp::stmts( nqp::push( nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE, nqp::getattr(self,List,'$!reified'), nqp::bindattr(self,List,'$!reified', nqp::create(IterationBuffer)) ), nqp::assign(nqp::p6scalarfromdesc($!descriptor),value) ), self ) ) } multi method push(Array:D: **@values is raw) { self.is-lazy ?? X::Cannot::Lazy.new(action => 'push to').throw !! self!append-list(@values) } multi method append(Array:D: \value) { nqp::if( self.is-lazy, X::Cannot::Lazy.new(action => 'append to').throw, nqp::if( (nqp::iscont(value) || nqp::not_i(nqp::istype(value, Iterable))), nqp::stmts( nqp::push( nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE, nqp::getattr(self,List,'$!reified'), nqp::bindattr(self,List,'$!reified', nqp::create(IterationBuffer)) ), nqp::assign(nqp::p6scalarfromdesc($!descriptor),value) ), self ), self!append-list(value.list) ) ) } multi method append(Array:D: **@values is raw) { self.is-lazy ?? X::Cannot::Lazy.new(action => 'append to').throw !! self!append-list(@values) } method !append-list(@values) { nqp::if( nqp::eqaddr( @values.iterator.push-until-lazy( ArrayReificationTarget.new( nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE, nqp::getattr(self,List,'$!reified'), nqp::bindattr(self,List,'$!reified', nqp::create(IterationBuffer)) ), nqp::decont($!descriptor) ) ), IterationEnd ), self, X::Cannot::Lazy.new(:action,:what(self.^name)).throw ) } multi method unshift(Array:D: Slip \value) { self!prepend-list(value) } multi method unshift(Array:D: \value) { nqp::stmts( nqp::unshift( nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE, nqp::getattr(self,List,'$!reified'), nqp::bindattr(self,List,'$!reified', nqp::create(IterationBuffer)) ), nqp::assign(nqp::p6scalarfromdesc($!descriptor),value) ), self ) } multi method unshift(Array:D: **@values is raw) { self!prepend-list(@values) } multi method prepend(Array:D: \value) { nqp::if( (nqp::iscont(value) || nqp::not_i(nqp::istype(value, Iterable))), nqp::stmts( nqp::unshift( nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE, nqp::getattr(self,List,'$!reified'), nqp::bindattr(self,List,'$!reified', nqp::create(IterationBuffer)) ), nqp::assign(nqp::p6scalarfromdesc($!descriptor),value) ), self ), self!prepend-list(value.list) ) } multi method prepend(Array:D: **@values is raw) { self!prepend-list(@values) } method !prepend-list(@values) { nqp::stmts( nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE, nqp::splice(nqp::getattr(self,List,'$!reified'), # prepend existing nqp::stmts( @values.iterator.push-all( ArrayReificationTarget.new( (my $containers := nqp::create(IterationBuffer)), nqp::decont($!descriptor) ) ), $containers ), 0, 0 ), @values.iterator.push-all( # no list yet, make this it ArrayReificationTarget.new( nqp::bindattr(self,List,'$!reified', nqp::create(IterationBuffer)), nqp::decont($!descriptor) ) ) ), self ) } method pop(Array:D:) is raw is nodal { nqp::if( self.is-lazy, Failure.new(X::Cannot::Lazy.new(action => 'pop from')), nqp::if( (nqp::getattr(self,List,'$!reified').DEFINITE && nqp::elems(nqp::getattr(self,List,'$!reified'))), nqp::pop(nqp::getattr(self,List,'$!reified')), Failure.new(X::Cannot::Empty.new(:action,:what(self.^name))) ) ) } method shift(Array:D:) is raw is nodal { nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE && nqp::elems(nqp::getattr(self,List,'$!reified')), nqp::ifnull( # handle holes nqp::shift(nqp::getattr(self,List,'$!reified')), Nil ), nqp::if( (nqp::getattr(self,List,'$!todo').DEFINITE && nqp::getattr(self,List,'$!todo').reify-at-least(1)), nqp::shift(nqp::getattr(self,List,'$!reified')), Failure.new(X::Cannot::Empty.new(:action,:what(self.^name))) ) ) } my $empty := nqp::create(IterationBuffer); # splicing in without values #------ splice() candidates multi method splice(Array:D \SELF:) { nqp::if( nqp::getattr(SELF,List,'$!reified').DEFINITE, nqp::stmts( (my $result := nqp::create(SELF)), nqp::bindattr($result,Array,'$!descriptor',$!descriptor), nqp::stmts( # transplant the internals nqp::bindattr($result,List,'$!reified', nqp::getattr(SELF,List,'$!reified')), nqp::if( nqp::getattr(SELF,List,'$!todo').DEFINITE, nqp::bindattr($result,List,'$!todo', nqp::getattr(SELF,List,'$!todo')), ) ), (SELF = nqp::create(SELF)), # XXX this preserves $!descriptor ?? $result ), nqp::p6bindattrinvres( # nothing to return, so create new one nqp::create(SELF),Array,'$!descriptor',$!descriptor) ) } #------ splice(offset) candidates multi method splice(Array:D: Whatever $) { nqp::p6bindattrinvres( # nothing to return, so create new one nqp::create(self),Array,'$!descriptor',$!descriptor) } multi method splice(Array:D: Callable:D $offset) { self.splice($offset(self.elems)) } multi method splice(Array:D: Int:D $offset) { nqp::if( $offset, nqp::if( nqp::islt_i(nqp::unbox_i($offset),0), self!splice-offset-fail($offset), nqp::if( (my $todo := nqp::getattr(self,List,'$!todo')).DEFINITE, nqp::if( nqp::isge_i( $todo.reify-at-least($offset),nqp::unbox_i($offset)), self!splice-offset(nqp::unbox_i($offset)), self!splice-offset-fail($offset) ), nqp::if( (nqp::getattr(self,List,'$!reified').DEFINITE && nqp::isge_i( nqp::elems(nqp::getattr(self,List,'$!reified')), nqp::unbox_i($offset))), self!splice-offset(nqp::unbox_i($offset)), self!splice-offset-fail($offset) ) ) ), self.splice # offset 0, take the quick route out ) } method !splice-offset(int $offset) { nqp::stmts( (my int $elems = nqp::elems(nqp::getattr(self,List,'$!reified'))), (my int $size = nqp::sub_i($elems,$offset)), nqp::bindattr((my $result:= nqp::create(self)),List,'$!reified', (my $buffer := nqp::setelems(nqp::create(IterationBuffer),$size))), nqp::bindattr($result,Array,'$!descriptor',$!descriptor), (my int $i = nqp::sub_i($offset,1)), nqp::while( nqp::islt_i(($i = nqp::add_i($i,1)),$elems), nqp::bindpos($buffer,nqp::sub_i($i,$offset), nqp::atpos(nqp::getattr(self,List,'$!reified'),$i)) ), nqp::splice( nqp::getattr(self,List,'$!reified'),$empty,$offset,$size), $result ) } method !splice-offset-fail($got) { X::OutOfRange.new( :what('Offset argument to splice'), :$got, :range("0..{self.elems}") ).throw } #------ splice(offset,size) candidates multi method splice(Array:D: Whatever $, Whatever $) { nqp::p6bindattrinvres( # nothing to return, so create new one nqp::create(self),Array,'$!descriptor',$!descriptor) } multi method splice(Array:D: Whatever $, Int:D $size) { self.splice(self.elems,$size) } multi method splice(Array:D: Whatever $, Callable:D $size) { my int $elems = self.elems; self.splice($elems,$size(nqp::sub_i($elems,$elems))); } multi method splice(Array:D: Callable:D $offset, Callable:D $size) { nqp::stmts( (my int $elems = self.elems), (my int $from = $offset($elems)), self.splice($from,$size(nqp::sub_i($elems,$from))) ) } multi method splice(Array:D: Callable:D $offset, Whatever $) { self.splice($offset(self.elems)) } multi method splice(Array:D: Callable:D $offset, Int:D $size) { self.splice($offset(self.elems),$size) } multi method splice(Array:D: Int:D $offset, Whatever $) { self.splice($offset) } multi method splice(Array:D: Int:D $offset, Callable:D $size) { self.splice($offset,$size(self.elems - $offset)) } multi method splice(Array:D: Int:D $offset, Int:D $size) { nqp::if( nqp::islt_i(nqp::unbox_i($offset),0), self!splice-offset-fail($offset), nqp::if( nqp::islt_i(nqp::unbox_i($size),0), self!splice-size-fail($size,$offset), nqp::if( (my $todo := nqp::getattr(self,List,'$!todo')).DEFINITE, nqp::if( nqp::isge_i( $todo.reify-at-least( nqp::add_i(nqp::unbox_i($offset),nqp::unbox_i($size)) ),nqp::unbox_i($offset)), self!splice-offset-size( nqp::unbox_i($offset),nqp::unbox_i($size)), self!splice-size-fail($size,$offset) ), nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE, nqp::if( nqp::isge_i( nqp::elems(nqp::getattr(self,List,'$!reified')), nqp::unbox_i($offset)), self!splice-offset-size( nqp::unbox_i($offset),nqp::unbox_i($size)), self!splice-size-fail($size,$offset) ), nqp::if( nqp::iseq_i(nqp::unbox_i($offset),0), nqp::p6bindattrinvres( # nothing to return, create new nqp::create(self),Array,'$!descriptor',$!descriptor), self!splice-offset-fail($offset) ) ) ) ) ) } method !splice-offset-size(int $offset,int $size) { nqp::stmts( (my $result := self!splice-save($offset,$size,my int $removed)), nqp::splice( nqp::getattr(self,List,'$!reified'),$empty,$offset,$removed), $result ) } method !splice-save(int $offset,int $size, \removed) { nqp::stmts( (removed = nqp::if( nqp::isgt_i( nqp::add_i($offset,$size), nqp::elems(nqp::getattr(self,List,'$!reified')) ), nqp::sub_i(nqp::elems(nqp::getattr(self,List,'$!reified')),$offset), $size )), nqp::if( removed, nqp::stmts( nqp::bindattr((my $saved:= nqp::create(self)),List,'$!reified', (my $buffer := nqp::setelems(nqp::create(IterationBuffer),removed))), nqp::bindattr($saved,Array,'$!descriptor',$!descriptor), (my int $i = -1), nqp::while( nqp::islt_i(($i = nqp::add_i($i,1)),removed), nqp::bindpos($buffer,$i,nqp::atpos( nqp::getattr(self,List,'$!reified'),nqp::add_i($offset,$i))) ), $saved ), nqp::p6bindattrinvres( # effective size = 0, create new one nqp::create(self),Array,'$!descriptor',$!descriptor) ) ) } method !splice-size-fail($got,$offset) { nqp::if( $offset > self.elems, self!splice-offset-fail($offset), X::OutOfRange.new( :what('Size argument to splice'), :$got, :range("0..^{self.elems - $offset}") ).throw ) } #------ splice(offset,size,array) candidates # we have these 9 multies to avoid infiniloop when incorrect types are # given to $offset/$size. Other attempts to resolve this showed 30%+ # performance decreases multi method splice(Array:D: Whatever $offset, Whatever $size, **@new) { self.splice($offset, $size, @new) } multi method splice(Array:D: Whatever $offset, Callable:D $size, **@new) { self.splice($offset, $size, @new) } multi method splice(Array:D: Whatever $offset, Int:D $size, **@new) { self.splice($offset, $size, @new) } multi method splice(Array:D: Callable:D $offset, Whatever $size, **@new) { self.splice($offset, $size, @new) } multi method splice(Array:D: Callable:D $offset, Callable:D $size, **@new) { self.splice($offset, $size, @new) } multi method splice(Array:D: Callable:D $offset, Int:D $size, **@new) { self.splice($offset, $size, @new) } multi method splice(Array:D: Int:D $offset, Whatever $size, **@new) { self.splice($offset, $size, @new) } multi method splice(Array:D: Int:D $offset, Callable:D $size, **@new) { self.splice($offset, $size, @new) } multi method splice(Array:D: Int:D $offset, Int:D $size, **@new) { self.splice($offset, $size, @new) } multi method splice(Array:D: Whatever $, Whatever $, @new) { self.splice(self.elems,0,@new) } multi method splice(Array:D: Whatever $, Int:D $size, @new) { self.splice(self.elems,$size,@new) } multi method splice(Array:D: Whatever $, Callable:D $size, @new) { my int $elems = self.elems; self.splice($elems,$size(nqp::sub_i($elems,$elems)),@new); } multi method splice(Array:D: Callable:D $offset, Callable:D $size, @new) { nqp::stmts( (my int $elems = self.elems), (my int $from = $offset($elems)), self.splice($from,$size(nqp::sub_i($elems,$from)),@new) ) } multi method splice(Array:D: Callable:D $offset, Whatever $, @new) { nqp::stmts( (my int $elems = self.elems), (my int $from = $offset($elems)), self.splice($from,nqp::sub_i($elems,$from),@new) ) } multi method splice(Array:D: Callable:D $offset, Int:D $size, @new) { self.splice($offset(self.elems),$size,@new) } multi method splice(Array:D: Int:D $offset, Whatever $, @new) { self.splice($offset,self.elems - $offset,@new) } multi method splice(Array:D: Int:D $offset, Callable:D $size, @new) { self.splice($offset,$size(self.elems - $offset),@new) } multi method splice(Array:D: Int:D $offset, Int:D $size, @new) { nqp::if( nqp::islt_i(nqp::unbox_i($offset),0), self!splice-offset-fail($offset), nqp::if( nqp::islt_i(nqp::unbox_i($size),0), self!splice-size-fail($size,$offset), nqp::if( (my $todo := nqp::getattr(self,List,'$!todo')).DEFINITE, nqp::if( nqp::isge_i( $todo.reify-at-least( nqp::add_i(nqp::unbox_i($offset),nqp::unbox_i($size)) ),nqp::unbox_i($offset)), self!splice-offset-size-new( nqp::unbox_i($offset),nqp::unbox_i($size),@new), self!splice-size-fail($size,$offset) ), nqp::if( nqp::isge_i( nqp::elems(nqp::if( nqp::getattr(self,List,'$!reified').DEFINITE, nqp::getattr(self,List,'$!reified'), nqp::bindattr(self,List,'$!reified', nqp::create(IterationBuffer)) )), nqp::unbox_i($offset), ), self!splice-offset-size-new( nqp::unbox_i($offset),nqp::unbox_i($size),@new), self!splice-offset-fail($offset) ) ) ) ) } method !splice-offset-size-new(int $offset,int $size,@new) { nqp::if( nqp::eqaddr(@new.iterator.push-until-lazy( (my $new := IterationBuffer.new)),IterationEnd), nqp::if( # reified all values to splice in (nqp::isnull($!descriptor) || nqp::eqaddr(self.of,Mu)), nqp::stmts( # no typecheck needed (my $result := self!splice-save($offset,$size,my int $removed)), nqp::splice( nqp::getattr(self,List,'$!reified'),$new,$offset,$removed), $result ), nqp::stmts( # typecheck the values first (my $expected := self.of), (my int $elems = nqp::elems($new)), (my int $i = -1), nqp::while( (nqp::islt_i(($i = nqp::add_i($i,1)),$elems) && nqp::istype(nqp::atpos($new,$i),$expected)), nqp::null ), nqp::if( nqp::islt_i($i,$elems), # exited loop because of wrong type X::TypeCheck::Splice.new( :action, :got(nqp::atpos($new,$i).WHAT), :$expected ).throw, nqp::stmts( ($result := self!splice-save($offset,$size,$removed)), nqp::splice( nqp::getattr(self,List,'$!reified'),$new,$offset,$removed), $result ) ) ) ), X::Cannot::Lazy.new(:action('splice in')).throw ) } multi method tail(Array:D: $n) { nqp::if( nqp::getattr(self,List,'$!todo').DEFINITE, self.Any::tail($n), Seq.new( nqp::if( (my $reified := nqp::getattr(self,List,'$!reified')).DEFINITE && nqp::elems($reified), nqp::stmts( (my $iterator := Rakudo::Iterator.ReifiedArray( self, nqp::getattr(self,Array,'$!descriptor') )), nqp::if( nqp::istype($n,Callable) && nqp::isgt_i((my $skip := -($n(0).Int)),0), $iterator.skip-at-least($skip), nqp::unless( nqp::istype($n,Whatever) || $n == Inf, $iterator.skip-at-least(nqp::elems($reified) - $n) ) ), $iterator ), Rakudo::Iterator.Empty ) ) ) } # introspection method name() { nqp::isnull($!descriptor) ?? Nil !! $!descriptor.name } method of() { nqp::isnull($!descriptor) ?? Mu !! $!descriptor.of } method default() { nqp::isnull($!descriptor) ?? Any !! $!descriptor.default } method dynamic() { nqp::isnull($!descriptor) ?? False !! so $!descriptor.dynamic } multi method perl(Array:D \SELF:) { SELF.perlseen('Array', { '$' x nqp::iscont(SELF) # self is always deconted ~ '[' ~ self.map({nqp::decont($_).perl}).join(', ') ~ ',' x (self.elems == 1 && nqp::istype(self.AT-POS(0),Iterable)) ~ ']' }) } multi method WHICH(Array:D:) { self.Mu::WHICH } #=============== class Array is closed in src/core/TypedArray.pm =============== # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/array_slice.pm60000644000175000017500000004473413253717231016300 0ustar alexalex# all sub postcircumfix [] candidates here please # Generates list of positions to index into the array at. Takes all those # before something lazy is encountered and eagerly reifies them. If there # are any lazy things in the slice, then we lazily consider those, but will # truncate at the first one that is out of range. The optional # :$eagerize will be called if Whatever/WhateverCode is encountered or if # clipping of lazy indices is enacted. It should return the number of # elements of the array if called with Whatever, or do something EXISTS-POSish # if called with an Int. Before it does so, it may cause the calling code # to switch to a memoized version of an iterator by modifying variables in # the caller's scope. proto sub POSITIONS(|) {*} multi sub POSITIONS( \SELF, \pos, Callable :$eagerize = -> \idx { nqp::if( nqp::istype(idx,Whatever), nqp::if(nqp::isconcrete(SELF),SELF.elems,0), SELF.EXISTS-POS(idx) ) } ) { my class IndicesReificationTarget { has $!target; has $!star; method new(\target, \star) { my \rt = nqp::create(self); nqp::bindattr(rt, self, '$!target', target); nqp::bindattr(rt, self, '$!star', star); rt } method push(Mu \value) { nqp::if( nqp::istype(value,Callable), nqp::stmts( nqp::if( nqp::istype($!star,Callable), nqp::bindattr(self,IndicesReificationTarget,'$!star',$!star(*)) ), # just using value(...) causes stage optimize to die (my &whatever := value), nqp::if( &whatever.count == Inf, nqp::push($!target, whatever(+$!star)), nqp::push($!target, whatever(|(+$!star xx &whatever.count))) ) ), nqp::push($!target,value) ) } } # we can optimize `42..*` Ranges; as long as they're from core, unmodified my \is-pos-lazy = pos.is-lazy; my \pos-iter = nqp::eqaddr(pos.WHAT,Range) && nqp::eqaddr(pos.max,Inf) && nqp::isfalse(SELF.is-lazy) ?? Range.new(pos.min, SELF.elems-1, :excludes-min(pos.excludes-min), :excludes-max(pos.excludes-max) ).iterator !! pos.iterator; my \pos-list = nqp::create(List); my \eager-indices = nqp::create(IterationBuffer); my \target = IndicesReificationTarget.new(eager-indices, $eagerize); nqp::bindattr(pos-list, List, '$!reified', eager-indices); if is-pos-lazy { # With lazy indices, we truncate at the first one that fails to exists. my \rest-seq = Seq.new(pos-iter).flatmap: -> Int() $i { nqp::unless( $eagerize($i), last, $i ) }; my \todo := nqp::create(List::Reifier); nqp::bindattr(todo, List::Reifier, '$!reified', eager-indices); nqp::bindattr(todo, List::Reifier, '$!current-iter', rest-seq.iterator); nqp::bindattr(todo, List::Reifier, '$!reification-target', eager-indices); nqp::bindattr(pos-list, List, '$!todo', todo); } else { pos-iter.push-all: target; } pos-list } proto sub postcircumfix:<[ ]>(|) is nodal {*} multi sub postcircumfix:<[ ]>( \SELF, Any:U $type, |c ) is raw { die "Unable to call postcircumfix {try SELF.VAR.name}[ $type.gist() ] with a type object\n" ~ "Indexing requires a defined object"; } # @a[int 1] multi sub postcircumfix:<[ ]>( \SELF, int $pos ) is raw { SELF.AT-POS($pos); } multi sub postcircumfix:<[ ]>( \SELF, int $pos, Mu \assignee ) is raw { SELF.ASSIGN-POS($pos, assignee); } multi sub postcircumfix:<[ ]>(\SELF, int $pos, Mu :$BIND! is raw) is raw { SELF.BIND-POS($pos, $BIND); } multi sub postcircumfix:<[ ]>( \SELF, int $pos, :$delete!, *%other ) is raw { $delete && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? SELF.DELETE-POS($pos) !! SLICE_ONE_LIST( SELF, $pos, 'delete', $delete, %other ); } multi sub postcircumfix:<[ ]>( \SELF, int $pos, :$exists!, *%other ) is raw { $exists && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? SELF.EXISTS-POS($pos) !! SLICE_ONE_LIST( SELF, $pos, 'exists', $exists, %other ); } multi sub postcircumfix:<[ ]>( \SELF, int $pos, :$kv!, *%other ) is raw { $kv && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS($pos) ?? ($pos, SELF.AT-POS($pos)) !! ()) !! SLICE_ONE_LIST( SELF, $pos, 'kv', $kv, %other ); } multi sub postcircumfix:<[ ]>( \SELF, int $pos, :$p!, *%other ) is raw { $p && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS($pos) ?? Pair.new($pos,SELF.AT-POS($pos)) !! ()) !! SLICE_ONE_LIST( SELF, $pos, 'p', $p, %other ); } multi sub postcircumfix:<[ ]>( \SELF, int $pos, :$k!, *%other ) is raw { $k && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS($pos) ?? $pos !! ()) !! SLICE_ONE_LIST( SELF, $pos, 'k', $k, %other ); } multi sub postcircumfix:<[ ]>( \SELF, int $pos, :$v!, *%other ) is raw { $v && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS($pos) ?? nqp::decont(SELF.AT-POS($pos)) !! ()) !! SLICE_ONE_LIST( SELF, $pos, 'v', $v, %other ); } # @a[Int 1] multi sub postcircumfix:<[ ]>( \SELF, Int:D $pos ) is raw { SELF.AT-POS($pos); } multi sub postcircumfix:<[ ]>( \SELF, Int:D $pos, Mu \assignee ) is raw { SELF.ASSIGN-POS($pos, assignee); } multi sub postcircumfix:<[ ]>(\SELF, Int:D $pos, Mu :$BIND! is raw) is raw { SELF.BIND-POS($pos, $BIND); } multi sub postcircumfix:<[ ]>( \SELF, Int:D $pos, :$delete!, *%other ) is raw { $delete && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? SELF.DELETE-POS($pos) !! SLICE_ONE_LIST( SELF, $pos, 'delete', $delete, %other ); } multi sub postcircumfix:<[ ]>( \SELF, Int:D $pos, :$exists!, *%other ) is raw { $exists && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? SELF.EXISTS-POS($pos) !! SLICE_ONE_LIST( SELF, $pos, 'exists', $exists, %other ); } multi sub postcircumfix:<[ ]>( \SELF, Int:D $pos, :$kv!, *%other ) is raw { $kv && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS($pos) ?? ($pos, SELF.AT-POS($pos)) !! ()) !! SLICE_ONE_LIST( SELF, $pos, 'kv', $kv, %other ); } multi sub postcircumfix:<[ ]>( \SELF, Int:D $pos, :$p!, *%other ) is raw { $p && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS($pos) ?? Pair.new($pos,SELF.AT-POS($pos)) !! ()) !! SLICE_ONE_LIST( SELF, $pos, 'p', $p, %other ); } multi sub postcircumfix:<[ ]>( \SELF, Int:D $pos, :$k!, *%other ) is raw { $k && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS($pos) ?? $pos !! ()) !! SLICE_ONE_LIST( SELF, $pos, 'k', $k, %other ); } multi sub postcircumfix:<[ ]>( \SELF, Int:D $pos, :$v!, *%other ) is raw { $v && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS($pos) ?? nqp::decont(SELF.AT-POS($pos)) !! ()) !! SLICE_ONE_LIST( SELF, $pos, 'v', $v, %other ); } # @a[$x] multi sub postcircumfix:<[ ]>( \SELF, Any:D \pos ) is raw { SELF.AT-POS(pos.Int); } multi sub postcircumfix:<[ ]>( \SELF, Any:D \pos, Mu \assignee ) is raw { SELF.ASSIGN-POS(pos.Int, assignee); } multi sub postcircumfix:<[ ]>(\SELF, Any:D \pos, Mu :$BIND! is raw) is raw { SELF.BIND-POS(pos.Int, $BIND); } multi sub postcircumfix:<[ ]>( \SELF, Any:D \pos, :$delete!, *%other ) is raw { $delete && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? SELF.DELETE-POS(pos.Int) !! SLICE_ONE_LIST( SELF, pos.Int, 'delete', $delete, %other ); } multi sub postcircumfix:<[ ]>( \SELF, Any:D \pos, :$exists!, *%other ) is raw { $exists && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? SELF.EXISTS-POS(pos.Int) !! SLICE_ONE_LIST( SELF, pos.Int, 'exists', $exists, %other ); } multi sub postcircumfix:<[ ]>( \SELF, Any:D \pos, :$kv!, *%other ) is raw { $kv && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS(pos.Int) ?? (pos, SELF.AT-POS(pos.Int)) !! ()) !! SLICE_ONE_LIST( SELF, pos.Int, 'kv', $kv, %other ); } multi sub postcircumfix:<[ ]>( \SELF, Any:D \pos, :$p!, *%other ) is raw { $p && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS(pos.Int) ?? Pair.new(pos, SELF.AT-POS(pos.Int)) !! ()) !! SLICE_ONE_LIST( SELF, pos.Int, 'p', $p, %other ); } multi sub postcircumfix:<[ ]>( \SELF, Any:D \pos, :$k!, *%other ) is raw { $k && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS(pos.Int) ?? pos !! ()) !! SLICE_ONE_LIST( SELF, pos.Int, 'k', $k, %other ); } multi sub postcircumfix:<[ ]>( \SELF, Any:D \pos, :$v!, *%other ) is raw { $v && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-POS(pos.Int) ?? nqp::decont(SELF.AT-POS(pos.Int)) !! ()) !! SLICE_ONE_LIST( SELF, pos.Int, 'v', $v, %other ); } # @a[@i] multi sub postcircumfix:<[ ]>( \SELF, Iterable:D \pos ) is raw { nqp::iscont(pos) ?? SELF.AT-POS(pos.Int) !! POSITIONS(SELF, pos).map({ SELF[$_] }).eager.list; } multi sub postcircumfix:<[ ]>(\SELF, Iterable:D \pos, Mu \val ) is raw { # MMD is not behaving itself so we do this by hand. if nqp::iscont(pos) { return SELF[pos.Int] = val; } # Prep an iterator that will assign Nils past end of rval my \rvlist := do if nqp::iscont(val) or not nqp::istype(val, Iterator) and not nqp::istype(val, Iterable) { (nqp::decont(val),).Slip } elsif nqp::istype(val, Iterator) { Slip.from-loop({ nqp::decont(val.pull-one) }) } elsif nqp::istype(val, Iterable) { val.map({ nqp::decont($_) }).Slip }, (Nil xx Inf).Slip; if nqp::istype(SELF, Positional) { # For Positionals, preserve established/expected evaluation order. my $list := List.new; my $target := nqp::getattr($list,List,'$!reified'); # We try to reify indices eagerly first, in case doing so # manipulates SELF. If pos is lazy or contains Whatevers/closures, # the SELF may start to reify as well. my \indices := POSITIONS(SELF, pos); indices.iterator.sink-all; # Extract the values/containers which will be assigned to, in case # reifying the rhs does crazy things like splicing SELF. my int $p = -1; nqp::bindpos($target,++$p,SELF[$_]) for indices; rvlist.EXISTS-POS($p); my \rviter := rvlist.iterator; $p = -1; my $elems = nqp::elems($target); nqp::atpos($target,$p) = rviter.pull-one while nqp::islt_i(++$p,$elems); $list } else { # The assumption for now is this must be Iterable # Lazy list assignment. This is somewhat experimental and # semantics may change. my $target := SELF.iterator; my sub eagerize ($idx) { once $target := $target.cache.iterator; $idx ~~ Whatever ?? $target.elems !! $target.EXISTS-POS($idx); } my @poslist := POSITIONS(SELF, pos, :eagerize(&eagerize)).eager; my %keep; # TODO: we could also use a quanthash and count occurences of an # index to let things go to GC sooner. %keep{@poslist} = (); my $max = -1; my \rviter := rvlist.iterator; @poslist.map: -> $p { my $lv; for $max ^.. $p -> $i { $max = $i; my $lv := $target.pull-one; %keep{$i} := $lv if %keep{$i}:exists and !($lv =:= IterationEnd); } $lv := %keep{$p}; $lv = rviter.pull-one; }; } } multi sub postcircumfix:<[ ]>(\SELF, Iterable:D \pos, :$BIND!) is raw { X::Bind::Slice.new(type => SELF.WHAT).throw; } multi sub postcircumfix:<[ ]>(\SELF, Iterable:D \pos,:$delete!,*%other) is raw { nqp::iscont(pos) ?? SLICE_ONE_LIST( SELF, pos.Int, 'delete', $delete, %other ) !! SLICE_MORE_LIST(SELF,POSITIONS(SELF,pos),'delete',$delete,%other) } multi sub postcircumfix:<[ ]>(\SELF, Iterable:D \pos,:$exists!,*%other) is raw { nqp::iscont(pos) ?? SLICE_ONE_LIST( SELF, pos.Int, 'exists', $exists, %other ) !! SLICE_MORE_LIST(SELF,POSITIONS(SELF,pos),'exists',$exists,%other) } multi sub postcircumfix:<[ ]>(\SELF, Iterable:D \pos, :$kv!, *%other) is raw { nqp::iscont(pos) ?? SLICE_ONE_LIST( SELF, pos.Int, 'kv', $kv, %other ) !! SLICE_MORE_LIST(SELF,POSITIONS(SELF,pos),'kv',$kv,%other) } multi sub postcircumfix:<[ ]>(\SELF, Iterable:D \pos, :$p!, *%other) is raw { nqp::iscont(pos) ?? SLICE_ONE_LIST( SELF, pos.Int, 'p', $p, %other ) !! SLICE_MORE_LIST(SELF,POSITIONS(SELF,pos),'p',$p,%other) } multi sub postcircumfix:<[ ]>(\SELF, Iterable:D \pos, :$k!, *%other) is raw { nqp::iscont(pos) ?? SLICE_ONE_LIST( SELF, pos.Int, 'k', $k, %other ) !! SLICE_MORE_LIST(SELF,POSITIONS(SELF,pos),'k',$k,%other) } multi sub postcircumfix:<[ ]>(\SELF, Iterable:D \pos, :$v!, *%other) is raw { nqp::iscont(pos) ?? SLICE_ONE_LIST( SELF, pos.Int, 'v', $v, %other ) !! SLICE_MORE_LIST(SELF,POSITIONS(SELF,pos),'v',$v,%other) } # @a[->{}] multi sub postcircumfix:<[ ]>(\SELF, Callable:D $block ) is raw { nqp::stmts( (my $*INDEX = 'Effective index'), SELF[$block.pos(SELF)] ) } multi sub postcircumfix:<[ ]>(\SELF, Callable:D $block, Mu \assignee ) is raw { nqp::stmts( (my $*INDEX = 'Effective index'), SELF[$block.pos(SELF)] = assignee ) } multi sub postcircumfix:<[ ]>(\SELF, Callable:D $block, :$BIND!) is raw { X::Bind::Slice.new(type => SELF.WHAT).throw; } multi sub postcircumfix:<[ ]>(\SELF,Callable:D $block,:$delete!,*%other) is raw { nqp::stmts( (my $*INDEX = 'Effective index'), nqp::if( nqp::istype((my $pos := $block.pos(SELF)),Int), SLICE_ONE_LIST( SELF, $pos, 'delete', $delete, %other ), SLICE_MORE_LIST( SELF, @$pos, 'delete', $delete, %other ) ) ) } multi sub postcircumfix:<[ ]>(\SELF,Callable:D $block,:$exists!,*%other) is raw { nqp::stmts( (my $*INDEX = 'Effective index'), nqp::if( nqp::istype((my $pos := $block.pos(SELF)),Int), SLICE_ONE_LIST( SELF, $pos, 'exists', $exists, %other ), SLICE_MORE_LIST( SELF, @$pos, 'exists', $exists, %other ) ) ) } multi sub postcircumfix:<[ ]>(\SELF,Callable:D $block,:$kv!,*%other) is raw { nqp::stmts( (my $*INDEX = 'Effective index'), nqp::if( nqp::istype((my $pos := $block.pos(SELF)),Int), SLICE_ONE_LIST( SELF, $pos, 'kv', $kv, %other ), SLICE_MORE_LIST( SELF, @$pos, 'kv', $kv, %other ) ) ) } multi sub postcircumfix:<[ ]>(\SELF,Callable:D $block,:$p!,*%other) is raw { nqp::stmts( (my $*INDEX = 'Effective index'), nqp::if( nqp::istype((my $pos := $block.pos(SELF)),Int), SLICE_ONE_LIST( SELF, $pos, 'p', $p, %other ), SLICE_MORE_LIST( SELF, @$pos, 'p', $p, %other ) ) ) } multi sub postcircumfix:<[ ]>(\SELF,Callable:D $block,:$k!,*%other) is raw { nqp::stmts( (my $*INDEX = 'Effective index'), nqp::if( nqp::istype((my $pos := $block.pos(SELF)),Int), SLICE_ONE_LIST( SELF, $pos, 'k', $k, %other ), SLICE_MORE_LIST( SELF, @$pos, 'k', $k, %other ) ) ) } multi sub postcircumfix:<[ ]>(\SELF,Callable:D $block,:$v!,*%other) is raw { nqp::stmts( (my $*INDEX = 'Effective index'), nqp::if( nqp::istype((my $pos := $block.pos(SELF)),Int), SLICE_ONE_LIST( SELF, $pos, 'v', $v, %other ), SLICE_MORE_LIST( SELF, @$pos, 'v', $v, %other ) ) ) } # @a[*] multi sub postcircumfix:<[ ]>( \SELF, Whatever:D ) is raw { SELF[^SELF.elems]; } multi sub postcircumfix:<[ ]>( \SELF, Whatever:D, Mu \assignee ) is raw { SELF[^SELF.elems] = assignee; } multi sub postcircumfix:<[ ]>(\SELF, Whatever:D, :$BIND!) is raw { X::Bind::Slice.new(type => SELF.WHAT).throw; } multi sub postcircumfix:<[ ]>(\SELF, Whatever:D, :$delete!, *%other) is raw { SLICE_MORE_LIST( SELF, ^SELF.elems, 'delete', $delete, %other ); } multi sub postcircumfix:<[ ]>(\SELF, Whatever:D, :$exists!, *%other) is raw { SLICE_MORE_LIST( SELF, ^SELF.elems, 'exists', $exists, %other ); } multi sub postcircumfix:<[ ]>(\SELF, Whatever:D, :$kv!, *%other) is raw { SLICE_MORE_LIST( SELF, ^SELF.elems, 'kv', $kv, %other ); } multi sub postcircumfix:<[ ]>(\SELF, Whatever:D, :$p!, *%other) is raw { SLICE_MORE_LIST( SELF, ^SELF.elems, 'p', $p, %other ); } multi sub postcircumfix:<[ ]>(\SELF, Whatever:D, :$k!, *%other) is raw { SLICE_MORE_LIST( SELF, ^SELF.elems, 'k', $k, %other ); } multi sub postcircumfix:<[ ]>(\SELF, Whatever:D, :$v!, *%other) is raw { nqp::elems(nqp::getattr(%other,Map,'$!storage')) ?? SLICE_MORE_LIST( SELF, ^SELF.elems, 'v', $v, %other ) !! SELF[^SELF.elems]; } # @a[**] multi sub postcircumfix:<[ ]>(\SELF, HyperWhatever:D $, *%adv) is raw { X::NYI.new(feature => 'HyperWhatever in array index').throw; } multi sub postcircumfix:<[ ]>(\SELF, HyperWhatever:D $, Mu \assignee) is raw { X::NYI.new(feature => 'HyperWhatever in array index').throw; } # @a[] multi sub postcircumfix:<[ ]>(\SELF, :$BIND!) is raw { X::Bind::ZenSlice.new(type => SELF.WHAT).throw; } multi sub postcircumfix:<[ ]>(\SELF, :$delete!, *%other) is raw { SLICE_MORE_LIST( SELF, ^SELF.elems, 'delete', $delete, %other ); } multi sub postcircumfix:<[ ]>(\SELF, :$exists!, *%other) is raw { SLICE_MORE_LIST( SELF, ^SELF.elems, 'exists', $exists, %other ); } multi sub postcircumfix:<[ ]>(\SELF, :$kv!, *%other) is raw { SLICE_MORE_LIST( SELF, ^SELF.elems, 'kv', $kv, %other ); } multi sub postcircumfix:<[ ]>(\SELF, :$p!, *%other) is raw { SLICE_MORE_LIST( SELF, ^SELF.elems, 'p', $p, %other ); } multi sub postcircumfix:<[ ]>(\SELF, :$k!, *%other) is raw { SLICE_MORE_LIST( SELF, ^SELF.elems, 'k', $k, %other ); } multi sub postcircumfix:<[ ]>(\SELF, :$v!, *%other) is raw { nqp::elems(nqp::getattr(%other,Map,'$!storage')) ?? SLICE_MORE_LIST( SELF, ^SELF.elems, 'v', $v, %other ) !! SELF[^SELF.elems]; } multi sub postcircumfix:<[ ]>(\SELF, *%other) is raw { SELF.ZEN-POS(|%other); } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Associative.pm60000644000175000017500000000022113253717231016234 0ustar alexalexmy role Associative[::TValue = Mu, ::TKey = Str(Any)] { method of() { TValue } method keyof() { TKey } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/AST.pm60000644000175000017500000000227513253717231014424 0ustar alexalex# XXX: Would like to have this class as Perl6::AST, but ran up against # problems with the serialization context calling it that. my class AST { has $!past; has $!quasi_context; has $!Str; submethod BUILD(:$past --> Nil) { $!past := $past } method incarnate($quasi_context, @unquote_asts) { my $incarnation = self.clone(); nqp::bindattr(nqp::decont($incarnation), AST, '$!past', $incarnation.evaluate_unquotes(@unquote_asts)); nqp::bindattr(nqp::decont($incarnation), AST, '$!quasi_context', $quasi_context); $incarnation; } method evaluate_unquotes(@unquote_asts) { my $pasts := nqp::list(); for @unquote_asts { # TODO: find and report macro name X::TypeCheck::Splice.new( got => $_, expected => AST, action => 'unquote evaluation', ).throw unless nqp::istype($_,AST); nqp::push($pasts, nqp::getattr(nqp::decont($_), AST, '$!past')) } $!past.evaluate_unquotes($pasts); } method is_quasi_ast { so $!quasi_context; } method Str { $!Str; } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/asyncops.pm60000644000175000017500000000515213253717231015631 0ustar alexalex# Waits for a promise to be kept or a channel to be able to receive a value # and, once it can, unwraps or returns the result. Under Perl 6.c, await will # really block the calling thread. In 6.d, if the thread is on the thread pool # then a continuation will be taken, and the thread is freed up. my role X::Await::Died { has $.await-backtrace; multi method gist(::?CLASS:D:) { "An operation first awaited:\n" ~ ((try $!await-backtrace ~ "\n") // '') ~ "Died with the exception:\n" ~ callsame().indent(4) } } proto sub await(|) {*} multi sub await() { die "Must specify a Promise or Channel to await on (got an empty list)"; } multi sub await(Any:U $x) { die "Must specify a defined Promise, Channel, or Supply to await on (got an undefined $x.^name())"; } multi sub await(Any:D $x) { die "Must specify a Promise, Channel, or Supply to await on (got a $x.^name())"; } multi sub await(Promise:D $p) { CATCH { unless nqp::istype($_, X::Await::Died) { ($_ but X::Await::Died(Backtrace.new(5))).rethrow } } my $*RAKUDO-AWAIT-BLOCKING := True; $*AWAITER.await($p) } multi sub await(Channel:D $c) { CATCH { unless nqp::istype($_, X::Await::Died) { ($_ but X::Await::Died(Backtrace.new(5))).rethrow } } my $*RAKUDO-AWAIT-BLOCKING := True; $*AWAITER.await($c) } multi sub await(Supply:D $s) { CATCH { unless nqp::istype($_, X::Await::Died) { ($_ but X::Await::Died(Backtrace.new(5))).rethrow } } my $*RAKUDO-AWAIT-BLOCKING := True; $*AWAITER.await($s) } multi sub await(Iterable:D $i) { eager $i.eager.map({ await $_ }) } multi sub await(*@awaitables) { eager @awaitables.eager.map({await $_}) } sub awaiterator(@promises) { Seq.new(class :: does Iterator { has @!todo; has @!done; method !SET-SELF(\todo) { @!todo = todo; self } method new(\todo) { nqp::create(self)!SET-SELF(todo) } method pull-one() is raw { if @!done { @!done.shift } elsif @!todo { Promise.anyof(@!todo).result; my @next; .status == Planned ?? @next.push($_) !! @!done.push($_.result) for @!todo; @!todo := @next; @!done.shift } else { IterationEnd } } method sink-all(--> IterationEnd) { Promise.allof(@promises).result } }.new(@promises)) } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/atomicops.pm60000644000175000017500000001652513253717231015776 0ustar alexalex#== Atomics available on all backends ============================================ #-- fetching a value atomically proto sub atomic-fetch($) {*} multi sub atomic-fetch($source is rw) { nqp::atomicload($source) } proto sub prefix:<⚛>($) {*} multi sub prefix:<⚛>($source is rw) { nqp::atomicload($source) } #-- assigning a value atomically proto sub atomic-assign($, $) {*} multi sub atomic-assign($target is rw, \value) { nqp::atomicstore($target, value) } #-- atomic compare and swap proto sub cas(|) {*} multi sub cas($target is rw, \expected, \value) { nqp::cas($target, expected, value) } multi sub cas($target is rw, &code) { my $current := nqp::atomicload($target); loop { my $updated := code($current); my $seen := nqp::cas($target, $current, $updated); return $updated if nqp::eqaddr($seen, $current); $current := $seen; } } #== Native integer atomics only available on MoarVM ============================== #?if moar my native atomicint is repr('P6int') is Int is ctype('atomic') { } #-- fetching a native integer value atomically multi sub atomic-fetch(atomicint $source is rw) { nqp::atomicload_i($source) } multi sub prefix:<⚛>(atomicint $source is rw) { nqp::atomicload_i($source) } #-- assigning a native integer value atomically multi sub atomic-assign(atomicint $target is rw, int $value) { nqp::atomicstore_i($target, $value) } multi sub atomic-assign(atomicint $target is rw, Int:D $value) { nqp::atomicstore_i($target, $value) } multi sub atomic-assign(atomicint $target is rw, $value) { nqp::atomicstore_i($target, $value.Int) } proto sub infix:<⚛=>($, $) {*} multi sub infix:<⚛=>($target is rw, \value) { nqp::atomicstore($target, value) } multi sub infix:<⚛=>(atomicint $target is rw, int $value) { nqp::atomicstore_i($target, $value) } multi sub infix:<⚛=>(atomicint $target is rw, Int:D $value) { nqp::atomicstore_i($target, $value) } multi sub infix:<⚛=>(atomicint $target is rw, $value) { nqp::atomicstore_i($target, $value.Int) } #-- atomically fetch native integer value and increment it proto sub atomic-fetch-inc(|) {*} multi sub atomic-fetch-inc(atomicint $target is rw --> atomicint) { nqp::atomicinc_i($target) } proto sub postfix:<⚛++>(|) {*} multi sub postfix:<⚛++>(atomicint $target is rw --> atomicint) { nqp::atomicinc_i($target) } #-- atomically increment native integer value and fetch it proto sub atomic-inc-fetch(|) {*} multi sub atomic-inc-fetch(atomicint $target is rw --> atomicint) { my atomicint $ = nqp::atomicinc_i($target) + 1 } proto sub prefix:<++⚛>(|) {*} multi sub prefix:<++⚛>(atomicint $target is rw --> atomicint) { my atomicint $ = nqp::atomicinc_i($target) + 1 } #-- atomically fetch native integer value and decrement it proto sub atomic-fetch-dec(|) {*} multi sub atomic-fetch-dec(atomicint $target is rw --> atomicint) { nqp::atomicdec_i($target) } proto sub postfix:<⚛-->(|) {*} multi sub postfix:<⚛-->(atomicint $target is rw --> atomicint) { nqp::atomicdec_i($target) } #-- atomically decrement native integer value and fetch it proto sub atomic-dec-fetch(|) {*} multi sub atomic-dec-fetch(atomicint $target is rw --> atomicint) { my atomicint $ = nqp::atomicdec_i($target) - 1 } proto sub prefix:<--⚛>(|) {*} multi sub prefix:<--⚛>(atomicint $target is rw --> atomicint) { my atomicint $ = nqp::atomicdec_i($target) - 1 } #-- atomically fetch native integer value and then add given value to it proto sub atomic-fetch-add($, $) {*} multi sub atomic-fetch-add(atomicint $target is rw, int $add --> atomicint) { nqp::atomicadd_i($target, $add) } multi sub atomic-fetch-add(atomicint $target is rw, Int:D $add --> atomicint) { nqp::atomicadd_i($target, $add) } multi sub atomic-fetch-add(atomicint $target is rw, $add --> atomicint) { nqp::atomicadd_i($target, $add.Int) } #-- atomically add given native integer value to value and return that proto sub atomic-add-fetch($, $) {*} multi sub atomic-add-fetch(atomicint $target is rw, int $add --> atomicint) { my atomicint $ = nqp::atomicadd_i($target, $add) + $add } multi sub atomic-add-fetch(atomicint $target is rw, Int:D $add --> atomicint) { my atomicint $ = nqp::atomicadd_i($target, $add) + $add } multi sub atomic-add-fetch(atomicint $target is rw, $add --> atomicint) { my int $add-int = $add.Int; my atomicint $ = nqp::atomicadd_i($target, $add-int) + $add-int } proto sub infix:<⚛+=>($, $) {*} multi sub infix:<⚛+=>(atomicint $target is rw, int $add --> atomicint) { my atomicint $ = nqp::atomicadd_i($target, $add) + $add } multi sub infix:<⚛+=>(atomicint $target is rw, Int:D $add --> atomicint) { my atomicint $ = nqp::atomicadd_i($target, $add) + $add } multi sub infix:<⚛+=>(atomicint $target is rw, $add --> atomicint) { my int $add-int = $add.Int; my atomicint $ = nqp::atomicadd_i($target, $add-int) + $add-int } #-- atomically fetch native integer value and then subtract given value from it proto sub atomic-fetch-sub($, $) {*} multi sub atomic-fetch-sub(atomicint $target is rw, int $add --> atomicint) { nqp::atomicadd_i($target, nqp::neg_i($add)) } multi sub atomic-fetch-sub(atomicint $target is rw, Int:D $add --> atomicint) { nqp::atomicadd_i($target, nqp::neg_i($add)) } multi sub atomic-fetch-sub(atomicint $target is rw, $add --> atomicint) { nqp::atomicadd_i($target, nqp::neg_i($add.Int)) } #-- atomically subtract given native integer value from value and return that proto sub atomic-sub-fetch($, $) {*} multi sub atomic-sub-fetch(atomicint $target is rw, int $add --> atomicint) { my atomicint $ = nqp::atomicadd_i($target, nqp::neg_i($add)) - $add } multi sub atomic-sub-fetch(atomicint $target is rw, Int:D $add --> atomicint) { my atomicint $ = nqp::atomicadd_i($target, nqp::neg_i($add)) - $add } multi sub atomic-sub-fetch(atomicint $target is rw, $add --> atomicint) { my int $add-int = nqp::neg_i($add.Int); my atomicint $ = nqp::atomicadd_i($target, $add-int) + $add-int } proto sub infix:<⚛-=>($, $) {*} multi sub infix:<⚛-=>(atomicint $target is rw, int $add --> atomicint) { my atomicint $ = nqp::atomicadd_i($target, nqp::neg_i($add)) - $add } multi sub infix:<⚛-=>(atomicint $target is rw, Int:D $add --> atomicint) { my atomicint $ = nqp::atomicadd_i($target, nqp::neg_i($add)) - $add } multi sub infix:<⚛-=>(atomicint $target is rw, $add --> atomicint) { my int $add-int = nqp::neg_i($add.Int); my atomicint $ = nqp::atomicadd_i($target, $add-int) + $add-int } my constant &infix:<⚛−=> := &infix:<⚛-=>; #-- provide full barrier semantics proto sub full-barrier(|) {*} multi sub full-barrier(--> Nil) { nqp::barrierfull() } #-- atomic compare and swap a native integer multi sub cas(atomicint $target is rw, int $expected, int $value) { nqp::cas_i($target, $expected, $value) } multi sub cas(atomicint $target is rw, Int:D $expected, Int:D $value) { nqp::cas_i($target, $expected, $value) } multi sub cas(atomicint $target is rw, $expected, $value) { nqp::cas_i($target, $expected.Int, $value.Int) } multi sub cas(atomicint $target is rw, &code) { my int $current = nqp::atomicload_i($target); loop { my int $updated = code($current); my int $seen = nqp::cas_i($target, $current, $updated); return $updated if $seen == $current; $current = $seen; } } #?endif # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Attribute.pm60000644000175000017500000001344613253717231015742 0ustar alexalexmy class Attribute { # declared in BOOTSTRAP # class Attribute is Any # has str $!name; # has int $!rw; # has int $!has_accessor; # has Mu $!type; # has Mu $!container_descriptor; # has Mu $!auto_viv_container; # has Mu $!build_closure; # has Mu $!package; # has int $!inlined; # has int $!positional_delegate; # has int $!associative_delegate; # has Mu $!why; # has $!required; # has Mu $!container_initializer; method compose(Mu $package, :$compiler_services) { # Generate accessor method, if we're meant to have one. if self.has_accessor { my str $name = nqp::unbox_s(self.name); my $meth_name := nqp::substr($name, 2); unless $package.^declares_method($meth_name) { my $dcpkg := nqp::decont($package); my $meth; my int $attr_type = nqp::objprimspec($!type); # Get the compiler to generate us an accessor when possible. if $compiler_services.DEFINITE { $meth := $compiler_services.generate_accessor($meth_name, $dcpkg, $name, $!type, self.rw ?? 1 !! 0); } # No compiler services available, so do it as a closure. elsif self.rw { $meth := nqp::p6bool(nqp::iseq_i($attr_type, 0)) ?? method (Mu:D \fles:) is raw { nqp::getattr(nqp::decont(fles), $dcpkg, $name) } !! nqp::p6bool(nqp::iseq_i($attr_type, 1)) ?? method (Mu:D \fles:) is raw { nqp::getattrref_i(nqp::decont(fles), $dcpkg, $name) } !! nqp::p6bool(nqp::iseq_i($attr_type, 2)) ?? method (Mu:D \fles:) is raw { nqp::getattrref_n(nqp::decont(fles), $dcpkg, $name) } !! method (Mu:D \fles:) is raw { nqp::getattrref_s(nqp::decont(fles), $dcpkg, $name) } $meth.set_name($meth_name); } else { # ro accessor $meth := nqp::p6bool(nqp::iseq_i($attr_type, 0)) ?? method (Mu:D \fles:) { nqp::getattr(nqp::decont(fles), $dcpkg, $name) } !! nqp::p6bool(nqp::iseq_i($attr_type, 1)) ?? method (Mu:D \fles:) { nqp::p6box_i( nqp::getattr_i(nqp::decont(fles), $dcpkg, $name) ); } !! nqp::p6bool(nqp::iseq_i($attr_type, 2)) ?? method (Mu:D \fles:) { nqp::p6box_n( nqp::getattr_n(nqp::decont(fles), $dcpkg, $name) ); } !! method (Mu:D \fles:) { nqp::p6box_s( nqp::getattr_s(nqp::decont(fles), $dcpkg, $name) ); } $meth.set_name($meth_name); } $package.^add_method($meth_name, $meth); } } # Apply any handles trait we may have. self.apply_handles($package); } method apply_handles(Mu $pkg) { # None by default. } method get_value(Mu $obj) { nqp::if( nqp::iseq_i((my int $t = nqp::objprimspec($!type)),0), nqp::getattr(nqp::decont($obj),$!package,$!name), nqp::if( nqp::iseq_i($t,1), nqp::p6box_i(nqp::getattr_i(nqp::decont($obj),$!package,$!name)), nqp::if( nqp::iseq_i($t,2), nqp::p6box_n(nqp::getattr_n(nqp::decont($obj), $!package,$!name)), nqp::if( nqp::iseq_i($t,3), nqp::p6box_s(nqp::getattr_s(nqp::decont($obj), $!package,$!name)) ) ) ) ) } method set_value(Mu $obj, Mu \value) { nqp::if( nqp::iseq_i((my int $t = nqp::objprimspec($!type)),0), nqp::bindattr(nqp::decont($obj),$!package,$!name,value), nqp::if( nqp::iseq_i($t,1), nqp::p6box_i(nqp::bindattr_i(nqp::decont($obj), $!package,$!name,value)), nqp::if( nqp::iseq_i($t,2), nqp::p6box_n(nqp::bindattr_n(nqp::decont($obj), $!package,$!name,value)), nqp::if( nqp::iseq_i($t,3), nqp::p6box_s(nqp::bindattr_s(nqp::decont($obj), $!package,$!name,value)) ) ) ) ) } method container() is raw { nqp::ifnull($!auto_viv_container,Nil) } method readonly() { !self.rw } method package() { $!package } method inlined() { $!inlined } multi method Str(Attribute:D:) { self.name } multi method gist(Attribute:D:) { self.type.^name ~ " " ~ self.name } method WHY() { if nqp::isnull($!why) { nextsame } else { $!why.set_docee(self); $!why } } method set_why($why) { $!why := $why; } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Awaitable.pm60000644000175000017500000000355113253717231015664 0ustar alexalex# An Awaitable is something we can use the `await` operator on. To support # this, it requires a `get-await-handle` method be implemented, which returns # an `Awaitable::AwaitHandle`. my role Awaitable { method get-await-handle() { ... } } # An Awaitable::Handle implementation is an immutable object that conveys the # status of the requested asynchronous result at the point we obtain the # handle. If the `.already` property is `True`, then there is no need to block # or suspend execution; the `.result` or `.cause` of failure can be used right # away (depending on the value of `.success). Otherwise, the consumer of the # handle should call the `subscribe-awaiter` method with its unblock/resume # handler, and then proceed to block/suspend. In this case, the handler will # be passed two arguments: a `Bool` success, and a result/cause (result if # success is `True`, cause if it's `False`). The `Awaitable::Handle` will # *not* have its success/result/cause updated; this would open the door to # data races (including subtle ones related to read/write ordering), when # the point of the fast-path is to test if we've got a result already with # minimal overhead (and thus minimal concurrency control). my role Awaitable::Handle { has Bool $.already; has Bool $.success; has Mu $.result; has Exception $.cause; method already-success(Mu \result) { nqp::create(self)!already-success(result) } method !already-success(Mu \result) { $!already := True; $!success := True; $!result := result; self } method already-failure(Mu \cause) { self.CREATE!already-failure(cause) } method !already-failure(Mu \cause) { $!already := True; $!success := False; $!cause := cause; self } method subscribe-awaiter(&subscriber) { ... } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Awaiter.pm60000644000175000017500000000766313253717231015377 0ustar alexalexmy role Awaiter { method await(Awaitable:D $a) { ... } method await-all(Iterable:D $i) { ... } } my class Awaiter::Blocking does Awaiter { method await(Awaitable:D $a) { my $handle := $a.get-await-handle; if $handle.already { $handle.success ?? $handle.result !! $handle.cause.rethrow } else { my $s = Semaphore.new(0); my $success; my $result; $handle.subscribe-awaiter(-> \success, \result { $success := success; $result := result; $s.release; }); $s.acquire; $success ?? $result !! $result.rethrow } } method await-all(Iterable:D \i) { # Collect results that are already available, and handles where the # results are not yet available together with the matching insertion # indices. my \results = nqp::list(); my \handles = nqp::list(); my \indices = nqp::list_i(); my int $insert = 0; my $saw-slip = False; for i -> $awaitable { unless nqp::istype($awaitable, Awaitable) { die "Can only specify Awaitable objects to await (got a $awaitable.^name())"; } unless nqp::isconcrete($awaitable) { die "Must specify a defined Awaitable to await (got an undefined $awaitable.^name())"; } my $handle := $awaitable.get-await-handle; if $handle.already { if $handle.success { my \result = $handle.result; nqp::bindpos(results, $insert, result); $saw-slip = True if nqp::istype(result, Slip); } else { $handle.cause.rethrow } } else { nqp::push(handles, $handle); nqp::push_i(indices, $insert); } ++$insert; } # See if we have anything that we need to really block on. If so, we # use a lock and condition variable to handle the blocking. The lock # protects writes into the array. my int $num-handles = nqp::elems(handles); if $num-handles { my $exception = Mu; my $l = Lock.new; my $ready = $l.condition(); my int $remaining = $num-handles; loop (my int $i = 0; $i < $num-handles; ++$i) { my $handle := nqp::atpos(handles, $i); my int $insert = nqp::atpos_i(indices, $i); $handle.subscribe-awaiter(-> \success, \result { $l.protect: { if success && $remaining { nqp::bindpos(results, $insert, result); $saw-slip = True if nqp::istype(result, Slip); --$remaining; $ready.signal unless $remaining; } elsif !nqp::isconcrete($exception) { $exception := result; $remaining = 0; $ready.signal; } } }); } # Block until remaining is 0 (need the loop to cope with suprious # wakeups). loop { $l.protect: { last if $remaining == 0; $ready.wait; } } # If we got an exception, throw it. $exception.rethrow if nqp::isconcrete($exception); } my \result-list = nqp::p6bindattrinvres(nqp::create(List), List, '$!reified', results); $saw-slip ?? result-list.map(-> \val { val }).List !! result-list } } PROCESS::<$AWAITER> := Awaiter::Blocking; # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Backtrace.pm60000644000175000017500000002605713253717231015660 0ustar alexalexmy class Exception { ... } my class Backtrace { ... } my class CompUnit::RepositoryRegistry is repr('Uninstantiable') { ... } my $RAKUDO-VERBOSE-STACKFRAME; my class Backtrace::Frame { has Str $.file; has Int $.line; has Mu $.code; has Str $.subname; method !SET-SELF($!file,$!line,\code,$!subname) { $!code := code; self } multi method new(Backtrace::Frame: \file,\line,\code,\subname) { nqp::create(self)!SET-SELF(file,line,code,subname) } multi method new(Backtrace::Frame: |c) { self.bless(|c) } method subtype(Backtrace::Frame:D:) { my $s = $!code.^name.lc.split('+', 2).cache[0]; $s eq 'mu' ?? '' !! $s; } method package(Backtrace::Frame:D:) { $.code.package; } multi method Str(Backtrace::Frame:D:) { my $s = self.subtype; $s ~= ' ' if $s.chars; my $text = " in {$s}$.subname at {$.file} line $.line\n"; if $RAKUDO-VERBOSE-STACKFRAME -> $extra { my $io = $!file.IO; if $io.e { my @lines = $io.lines; my $from = max $!line - $extra, 1; my $to = min $!line + $extra, +@lines; for $from..$to -> $line { my $star = $line == $!line ?? '*' !! ' '; $text ~= "$line.fmt('%5d')$star @lines[$line - 1]\n"; } $text ~= "\n"; } } $text; } method is-hidden(Backtrace::Frame:D:) { ?$!code.?is-hidden-from-backtrace } method is-routine(Backtrace::Frame:D:) { nqp::p6bool(nqp::istype($!code,Routine)) } method is-setting(Backtrace::Frame:D:) { $!file.starts-with("SETTING::") #?if jvm || $!file.ends-with("CORE.setting") #?endif #?if !jvm || $!file.ends-with("CORE.setting." ~ Rakudo::Internals.PRECOMP-EXT) #?endif || $!file.ends-with(".nqp") } } my class Backtrace { has Mu $!bt; has Mu $!frames; has Int $!bt-next; # next bt index to vivify method !SET-SELF($!bt,$!bt-next) { once $RAKUDO-VERBOSE-STACKFRAME = (%*ENV // 0).Num; $!frames := nqp::list; self } multi method new() { try X::AdHoc.new(:payload("Died")).throw; nqp::create(self)!SET-SELF( nqp::backtrace(nqp::getattr(nqp::decont($!),Exception,'$!ex')), 1) } multi method new(Int:D $offset) { try X::AdHoc.new(:payload("Died")).throw; nqp::create(self)!SET-SELF( nqp::backtrace(nqp::getattr(nqp::decont($!),Exception,'$!ex')), 1 + $offset) } multi method new(Mu \ex) { nqp::create(self)!SET-SELF( ex.^name eq 'BOOTException' ?? nqp::backtrace(nqp::decont(ex)) !! nqp::backtrace(nqp::getattr(nqp::decont(ex),Exception,'$!ex')), 0) } multi method new(Mu \ex, Int:D $offset) { nqp::create(self)!SET-SELF( ex.^name eq 'BOOTException' ?? nqp::backtrace(nqp::decont(ex)) !! nqp::backtrace(nqp::getattr(nqp::decont(ex),Exception,'$!ex')), $offset) } # note that backtraces are nqp::list()s, marshalled to us as a List multi method new(List:D $bt) { nqp::create(self)!SET-SELF($bt,0) } multi method new(List:D $bt, Int:D $offset) { nqp::create(self)!SET-SELF($bt,$offset) } method AT-POS($pos) { return nqp::atpos($!frames,$pos) if nqp::existspos($!frames,$pos); my int $elems = $!bt.elems; return Nil if $!bt-next >= $elems; # bt-next can init > elems my int $todo = $pos - nqp::elems($!frames) + 1; return Nil if $todo < 1; # in case absurd $pos passed while $!bt-next < $elems { my $frame := $!bt.AT-POS($!bt-next++); my $sub := $frame; next unless defined $sub; my Mu $do := nqp::getattr(nqp::decont($sub), ForeignCode, '$!do'); next if nqp::isnull($do); my $annotations := $frame; next unless $annotations; my $file := $annotations; next unless $file; if CompUnit::RepositoryRegistry.file-for-spec($file) -> $path { $file := $path.absolute; } next if $file.ends-with('BOOTSTRAP.nqp') || $file.ends-with('QRegex.nqp') || $file.ends-with('Perl6/Ops.nqp'); if $file.ends-with('NQPHLL.nqp') || $file.ends-with('NQPHLL.moarvm') { # This could mean we're at the end of the interesting backtrace, # or it could mean that we're in something like sprintf (which # uses an NQP grammar to parse the format string). while $!bt-next < $elems { my $frame := $!bt.AT-POS($!bt-next++); my $annotations := $frame; next unless $annotations; my $file := $annotations; next unless $file; if $file.starts-with('SETTING::') { $!bt-next--; # re-visit this frame last; } } next; } my $line := $annotations; next unless $line; my $name := nqp::p6box_s(nqp::getcodename($do)); if $name eq 'handle-begin-time-exceptions' { $!bt-next = $elems; last; } my $code; try { $code := nqp::getcodeobj($do); $code := Any unless nqp::istype($code, Mu); }; nqp::push($!frames, Backtrace::Frame.new( $file, $line.Int, $code, $name.starts-with("_block") ?? '' !! $name, ) ); last unless $todo = $todo - 1; } # found something if nqp::existspos($!frames,$pos) { nqp::atpos($!frames,$pos); } # we've reached the end, don't show the last if there is one else { nqp::pop($!frames) if $!frames; Nil; } } method next-interesting-index(Backtrace:D: Int $idx is copy = 0, :$named, :$noproto, :$setting) { ++$idx; while self.AT-POS($idx++) -> $cand { next if $cand.is-hidden; # hidden is never interesting next if $noproto # no proto's please && $cand.code.?is_dispatcher; # if a dispatcher next if !$setting # no settings please && $cand.is-setting; # and in setting my $n := $cand.subname; next if $named && !$n; # only want named ones and no name next if $n eq ''; # outer calling context return $idx - 1; } Nil; } method outer-caller-idx(Backtrace:D: Int $startidx) { if self.AT-POS($startidx).code -> $start { my %outers; my $current = $start.outer; while $current.DEFINITE { %outers{$current.static_id} = $start; $current = $current.outer; } my @outers; my $i = $startidx; while self.AT-POS($i++) -> $cand { my $code = $cand.code; next unless $code.DEFINITE && %outers{$code.static_id}.DEFINITE; @outers.push: $i - 1; last if $cand.is-routine; } @outers; } else { $startidx.list; } } method nice(Backtrace:D: :$oneline) { my $setting = %*ENV; try { my @frames; my Int $i = self.next-interesting-index(-1); while $i.defined { $i = self.next-interesting-index($i, :$setting) if $oneline; last unless $i.defined; my $prev = self.AT-POS($i); if $prev.is-routine { @frames.push: $prev; } else { my @outer_callers := self.outer-caller-idx($i); my $target_idx = @outer_callers.keys.grep({self.AT-POS($i).code.^isa(Routine)})[0]; $target_idx ||= @outer_callers[0] || $i; my $current = self.AT-POS($target_idx); @frames.append: $current.clone(line => $prev.line); $i = $target_idx; } last if $oneline; $i = self.next-interesting-index($i, :$setting); } CATCH { default { return ""; } } @frames.join; } } multi method gist(Backtrace:D:) { my $els := +self.list; 'Backtrace(' ~ $els ~ ' frame' ~ 's' x ($els != 1) ~ ')' } multi method Str(Backtrace:D:) { self.nice } multi method flat(Backtrace:D:) { self.list } multi method map(Backtrace:D: &block) { my $pos = 0; gather while self.AT-POS($pos++) -> $cand { take block($cand); } } multi method first(Backtrace:D: Mu $test) { my $pos = 0; while self.AT-POS($pos++) -> $cand { return-rw $cand if $cand ~~ $test; } Nil; } multi method list(Backtrace:D:) { self.AT-POS(100); # will stop when done, do we need more than 100??? nqp::p6bindattrinvres(nqp::create(List), List, '$!reified', $!frames) } method first-none-setting-line(Backtrace:D:) { (self.first({ !.is-hidden && !.is-setting }) // "\n").Str; } method concise(Backtrace:D:) { (self.grep({ !.is-hidden && .is-routine && !.is-setting }) // "\n").join; } method full(Backtrace:D:) { self.list.join } method summary(Backtrace:D:) { (self.grep({ !.is-hidden && (.is-routine || !.is-setting)}) // "\n").join; } method is-runtime (Backtrace:D:) { my $bt = $!bt; for $bt.keys { my $p6sub := $bt[$_]; if nqp::istype($p6sub, ForeignCode) { try { my Mu $sub := nqp::getattr(nqp::decont($p6sub), ForeignCode, '$!do'); my str $name = nqp::getcodename($sub); return True if nqp::iseq_s($name, 'THREAD-ENTRY'); return True if nqp::iseq_s($name, 'eval'); return True if nqp::iseq_s($name, 'print_control'); return False if nqp::iseq_s($name, 'compile'); } } } False; } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Baggy.pm60000644000175000017500000006030113253717231015020 0ustar alexalexmy role Baggy does QuantHash { # A Bag/BagHash/Mix/MixHash consists of a single hash with Pairs. # The keys of the hash, are the .WHICH strings of the original object key. # The values are Pairs containing the original object key and value. has Rakudo::Internals::IterationSet $!elems; # key.WHICH => (key,value) # The Baggy role takes care of all mutable and immutable aspects that are # shared between Bag,BagHash,Mix,MixHash. Any specific behaviour for # mutable and immutable aspects of Mix/MixHash need to live in Mixy. # Immutables aspects of Bag/Mix, need to live to Bag/Mix respectively. #--- interface methods multi method ACCEPTS(Baggy:U: \other --> Bool:D) { other.^does(self) } multi method ACCEPTS(Baggy:D: Baggy:D \other --> Bool:D) { nqp::p6bool( nqp::unless( nqp::eqaddr(self,other), nqp::if( # not same object (my $araw := $!elems), nqp::if( # something on left (my $braw := other.RAW-HASH), nqp::if( # something on both sides nqp::iseq_i(nqp::elems($araw),nqp::elems($braw)), nqp::stmts( # same size (my $iter := nqp::iterator($araw)), nqp::while( $iter, nqp::unless( nqp::getattr( nqp::ifnull( nqp::atkey($braw,nqp::iterkey_s(nqp::shift($iter))), BEGIN nqp::p6bindattrinvres( # virtual Pair with 0 nqp::create(Pair),Pair,'$!value',0) ),Pair,'$!value') == nqp::getattr(nqp::iterval($iter),Pair,'$!value'), return False # missing/different: we're done ) ), True # all keys identical/same value ) ) ), # true -> both empty nqp::isfalse( ($braw := other.RAW-HASH) && nqp::elems($braw) ) ) ) ) } multi method ACCEPTS(Baggy:D: Mu \other --> Bool:D) { self.ACCEPTS(other.Bag) } multi method AT-KEY(Baggy:D: \k) { # exception: ro version for Bag/Mix nqp::if( $!elems, nqp::getattr( nqp::ifnull( nqp::atkey($!elems,k.WHICH), BEGIN nqp::p6bindattrinvres(nqp::create(Pair),Pair,'$!value',0) ), Pair, '$!value' ), 0 ) } multi method DELETE-KEY(Baggy:D: \k) { nqp::if( $!elems && nqp::existskey($!elems,(my $which := k.WHICH)), nqp::stmts( (my $value := nqp::getattr(nqp::atkey($!elems,$which),Pair,'$!value')), nqp::deletekey($!elems,$which), $value ), 0 ) } multi method EXISTS-KEY(Baggy:D: \k) { nqp::p6bool( $!elems && nqp::existskey($!elems,k.WHICH) ) } #--- object creation methods # helper sub to create Bag from iterator, check for laziness sub create-from-iterator(\type, \iterator --> Baggy:D) { nqp::if( iterator.is-lazy, Failure.new(X::Cannot::Lazy.new(:action,:what(type.^name))), nqp::create(type).SET-SELF( Rakudo::QuantHash.ADD-ITERATOR-TO-BAG( nqp::create(Rakudo::Internals::IterationSet), iterator ) ) ) } multi method new(Baggy:_: --> Baggy:D) { nqp::create(self) } multi method new(Baggy:_: \value --> Baggy:D) { nqp::if( nqp::istype(value,Iterable) && nqp::not_i(nqp::iscont(value)), create-from-iterator(self, value.iterator), nqp::stmts( nqp::bindkey( (my $elems := nqp::create(Rakudo::Internals::IterationSet)), value.WHICH, Pair.new(value,1) ), nqp::create(self).SET-SELF($elems) ) ) } multi method new(Baggy:_: **@args) { create-from-iterator(self, @args.iterator) } method new-from-pairs(Baggy:_: *@pairs --> Baggy:D) { nqp::if( (my $iterator := @pairs.iterator).is-lazy, Failure.new(X::Cannot::Lazy.new(:action,:what(self.^name))), nqp::create(self).SET-SELF( Rakudo::QuantHash.ADD-PAIRS-TO-BAG( nqp::create(Rakudo::Internals::IterationSet),$iterator ) ) ) } #--- iterator methods multi method iterator(Baggy:D:) { Rakudo::Iterator.Mappy-values($!elems) } multi method keys(Baggy:D:) { Seq.new(class :: does Rakudo::Iterator::Mappy { method pull-one() { $!iter ?? nqp::getattr(nqp::iterval(nqp::shift($!iter)),Pair,'$!key') !! IterationEnd } method push-all($target --> IterationEnd) { nqp::while( # doesn't sink $!iter, $target.push( nqp::getattr(nqp::iterval(nqp::shift($!iter)),Pair,'$!key') ) ) } }.new($!elems)) } multi method kv(Baggy:D:) { Seq.new(Rakudo::Iterator.Mappy-kv-from-pairs($!elems)) } multi method values(Baggy:D:) { Seq.new(class :: does Rakudo::Iterator::Mappy { method pull-one() is raw { nqp::if( $!iter, nqp::getattr(nqp::iterval(nqp::shift($!iter)),Pair,'$!value'), IterationEnd ) } method push-all($target --> IterationEnd) { nqp::while( # doesn't sink $!iter, $target.push( nqp::getattr( nqp::iterval(nqp::shift($!iter)), Pair, '$!value' ) ) ) } }.new($!elems)) } multi method antipairs(Baggy:D:) { Seq.new(class :: does Rakudo::Iterator::Mappy { method pull-one() { nqp::if( $!iter, nqp::iterval(nqp::shift($!iter)).antipair, IterationEnd ) } method push-all($target --> IterationEnd) { nqp::while( $!iter, $target.push(nqp::iterval(nqp::shift($!iter)).antipair), ) } }.new($!elems)) } proto method kxxv(|) {*} multi method kxxv(Baggy:D:) { Seq.new(class :: does Rakudo::Iterator::Mappy { has Mu $!key; has int $!times; method pull-one() is raw { nqp::if( $!times, nqp::stmts( ($!times = nqp::sub_i($!times,1)), $!key ), nqp::if( $!iter, nqp::stmts( ($!key := nqp::getattr( (my $pair := nqp::iterval(nqp::shift($!iter))), Pair, '$!key' )), ($!times = nqp::sub_i(nqp::getattr($pair,Pair,'$!value'),1)), $!key ), IterationEnd ) ) } method skip-one() { # the default skip-one, too difficult to handle nqp::not_i(nqp::eqaddr(self.pull-one,IterationEnd)) } method push-all($target --> IterationEnd) { nqp::while( $!iter, nqp::stmts( ($!key := nqp::getattr( (my $pair := nqp::iterval(nqp::shift($!iter))), Pair, '$!key' )), ($!times = nqp::add_i(nqp::getattr($pair,Pair,'$!value'),1)), nqp::while( # doesn't sink ($!times = nqp::sub_i($!times,1)), $target.push($!key) ) ) ) } }.new($!elems)) } multi method invert(Baggy:D:) { Seq.new(Rakudo::Iterator.Invert(Rakudo::Iterator.Mappy-values($!elems))) } #--- introspection methods multi method elems(Baggy:D: --> Int:D) { nqp::istrue($!elems) && nqp::elems($!elems) } multi method Bool(Baggy:D: --> Bool:D) { nqp::p6bool($!elems && nqp::elems($!elems)) } method HASHIFY(\type) { nqp::stmts( (my $hash := Hash.^parameterize(type,Any).new), (my $descriptor := nqp::getattr($hash,Hash,'$!descriptor')), nqp::if( $!elems && nqp::elems($!elems), nqp::stmts( (my $storage := nqp::clone($!elems)), (my $iter := nqp::iterator($storage)), nqp::while( $iter, nqp::bindkey( $storage, nqp::iterkey_s(nqp::shift($iter)), nqp::p6bindattrinvres( nqp::clone(nqp::iterval($iter)), Pair, '$!value', (nqp::p6scalarfromdesc($descriptor) = nqp::getattr(nqp::iterval($iter),Pair,'$!value')) ) ) ), nqp::bindattr($hash,Map,'$!storage',$storage) ) ), $hash ) } multi method hash(Baggy:D: --> Hash:D) { self.HASHIFY(Any) } multi method Hash(Baggy:D: --> Hash:D) { self.HASHIFY(UInt) } method default(Baggy:D: --> 0) { } multi method Str(Baggy:D: --> Str:D) { nqp::join(' ',Rakudo::QuantHash.RAW-VALUES-MAP(self, { nqp::if( (my $value := nqp::getattr($_,Pair,'$!value')) == 1, nqp::getattr($_,Pair,'$!key').gist, "{nqp::getattr($_,Pair,'$!key').gist}($value)" ) })) } multi method gist(Baggy:D: --> Str:D) { nqp::concat( nqp::concat( nqp::concat(self.^name,'('), nqp::join(', ', Rakudo::Sorting.MERGESORT-str( Rakudo::QuantHash.RAW-VALUES-MAP(self, { nqp::if( (my $value := nqp::getattr($_,Pair,'$!value')) == 1, nqp::getattr($_,Pair,'$!key').gist, "{nqp::getattr($_,Pair,'$!key').gist}($value)" ) }) ) ) ), ')', ) } multi method perl(Baggy:D: --> Str:D) { nqp::if( $!elems && nqp::elems($!elems), nqp::concat( nqp::concat( '(', nqp::join(',', Rakudo::QuantHash.RAW-VALUES-MAP(self, { nqp::if( (my $value := nqp::getattr($_,Pair,'$!value')) == 1, nqp::getattr($_,Pair,'$!key').perl, "{nqp::getattr($_,Pair,'$!key').perl}=>$value" ) }) ) ), nqp::concat(').',self.^name) ), nqp::if( nqp::istype(self,Bag), 'bag()', nqp::if( nqp::istype(self,Mix), 'mix()', nqp::concat('().',self.^name) ) ) ) } #--- selection methods proto method grabpairs (|) {*} multi method grabpairs(Baggy:D:) { nqp::if( $!elems && nqp::elems($!elems), nqp::stmts( (my $iter := Rakudo::QuantHash.ROLL($!elems)), (my $pair := nqp::iterval($iter)), nqp::deletekey($!elems,nqp::iterkey_s($iter)), $pair ), Nil ) } multi method grabpairs(Baggy:D: Callable:D $calculate) { self.grabpairs( $calculate(self.elems) ) } multi method grabpairs(Baggy:D: Whatever $) { self.grabpairs(Inf) } multi method grabpairs(Baggy:D: $count) { Seq.new(class :: does Rakudo::QuantHash::Pairs { method pull-one() is raw { nqp::if( nqp::elems($!picked), nqp::stmts( (my $pair := nqp::atkey( $!elems, (my $key := nqp::pop_s($!picked)) )), nqp::deletekey($!elems,$key), $pair ), IterationEnd ) } }.new($!elems, $count)) } proto method pickpairs(|) {*} multi method pickpairs(Baggy:D:) { nqp::if( $!elems && nqp::elems($!elems), nqp::iterval(Rakudo::QuantHash.ROLL($!elems)), Nil ) } multi method pickpairs(Baggy:D: Callable:D $calculate) { self.pickpairs( $calculate(self.total) ) } multi method pickpairs(Baggy:D: Whatever $) { self.pickpairs(Inf) } multi method pickpairs(Baggy:D: $count) { Seq.new(class :: does Rakudo::QuantHash::Pairs { method pull-one() is raw { nqp::if( nqp::elems($!picked), nqp::atkey($!elems,nqp::pop_s($!picked)), IterationEnd ) } }.new($!elems, $count)) } proto method grab(|) {*} multi method grab(Baggy:D: |c) { X::Immutable.new( method => 'grab', typename => self.^name ).throw; } proto method pick(|) {*} multi method pick(Baggy:D:) { self.roll } multi method pick(Baggy:D: Callable:D $calculate) { self.pick( $calculate(self.total) ) } multi method pick(Baggy:D: Whatever) { self.pick(Inf) } multi method pick(Baggy:D: $count) { Seq.new( (my $total := self.total) < 1 || (my $todo := $count == Inf ?? $total !! $count.Int) < 1 ?? Rakudo::Iterator.Empty # nothing to do !! class :: does Iterator { has $!raw; # the IterationSet of the Baggy has $!weights; # clone of raw, but with just the weights has $!todo; # number of draws to do has $!total; # total number of draws possible # Return the .WHICH key of a randomly picked object. Updates # the weight of the picked object and the total number of draws # still possible. method BAG-PICK() { nqp::stmts( (my Int $rand := $!total.rand.Int), (my Int $seen := 0), (my $iter := nqp::iterator($!weights)), nqp::while( $iter && nqp::isle_I( ($seen := nqp::add_I( $seen, nqp::iterval(nqp::shift($iter)), Int )), $rand ), nqp::null ), nqp::bindkey( # $iter now contains picked one $!weights, nqp::iterkey_s($iter), nqp::sub_I(nqp::iterval($iter),1,Int) ), ($!total := nqp::sub_I($!total,1,Int)), nqp::iterkey_s($iter) ) } method SET-SELF(\raw, \todo, \total) { nqp::stmts( ($!weights := nqp::clone($!raw := raw)), (my $iter := nqp::iterator($!weights)), nqp::while( $iter, nqp::bindkey( $!weights, nqp::iterkey_s(nqp::shift($iter)), nqp::getattr(nqp::iterval($iter),Pair,'$!value') ) ), ($!todo := nqp::if(todo > total,total,todo)), ($!total := total), self ) } method new(\raw, \todo, \total) { nqp::create(self).SET-SELF(raw, todo, total) } method pull-one() is raw { nqp::if( $!todo, nqp::stmts( ($!todo := nqp::sub_I($!todo,1,Int)), nqp::getattr(nqp::atkey($!raw,self.BAG-PICK),Pair,'$!key') ), IterationEnd ) } method skip-one() { nqp::if( $!todo, nqp::stmts( ($!todo := nqp::sub_I($!todo,1,Int)), self.BAG-PICK ) ) } method push-all($target --> IterationEnd) { nqp::stmts( (my $todo = $!todo), nqp::while( $todo, nqp::stmts( --$todo, $target.push(nqp::getattr( nqp::atkey($!raw,self.BAG-PICK), Pair, '$!key' )) ) ), ($!todo := nqp::decont($todo)) ) } method count-only() { $!todo - 1 } method bool-only(--> True) { } method sink-all() { $!todo := 0 } }.new($!elems, $todo, nqp::ifnull($total,self.total)) ) } proto method roll(|) {*} multi method roll(Baggy:D:) { nqp::if( $!elems && (my $total := self.total), nqp::getattr( nqp::iterval(Rakudo::QuantHash.BAG-ROLL($!elems,$total)), Pair, '$!key' ), Nil ) } multi method roll(Baggy:D: Whatever) { Seq.new(nqp::if( $!elems && (my $total := self.total), Rakudo::Iterator.Callable( { nqp::getattr( nqp::iterval(Rakudo::QuantHash.BAG-ROLL($!elems, $total)), Pair, '$!key' ) }, True ), Rakudo::Iterator.Empty )) } multi method roll(Baggy:D: Callable:D $calculate) { nqp::if( (my $total := self.total), self.roll($calculate($total)), Seq.new(Rakudo::Iterator.Empty) ) } multi method roll(Baggy:D: $count) { nqp::if( $count == Inf, self.roll(*), # let Whatever handle it Seq.new(nqp::if( # something else as count (my $todo = $count.Int) < 1, # also handles NaN Rakudo::Iterator.Empty, # nothing to do nqp::if( $!elems && (my $total := self.total) && ++$todo, Rakudo::Iterator.Callable( { # need to do a number of times nqp::if( --$todo, nqp::getattr( nqp::iterval(Rakudo::QuantHash.BAG-ROLL($!elems, $total)), Pair, '$!key' ), IterationEnd ) }), Rakudo::Iterator.Empty # nothing to roll for ) )) ) } #--- classification method proto method classify-list(|) {*} multi method classify-list( &test, \list) { fail X::Cannot::Lazy.new(:action) if list.is-lazy; my \iter = (nqp::istype(list, Iterable) ?? list !! list.list).iterator; while (my $value := iter.pull-one) !=:= IterationEnd { my $tested := test($value); if nqp::istype($tested, Iterable) { # multi-level classify X::Invalid::ComputedValue.new( :name, :method, :value, :reason(self.^name ~ ' cannot be nested and so does not ' ~ 'support multi-level classification'), ).throw; } else { ++self{$tested}; } } self; } multi method classify-list( %test, |c ) { self.classify-list( { %test{$^a} }, |c ); } multi method classify-list( @test, |c ) { self.classify-list( { @test[$^a] }, |c ); } multi method classify-list(&test, **@list, |c) { self.classify-list(&test, @list, |c); } proto method categorize-list(|) {*} multi method categorize-list( &test, \list ) { fail X::Cannot::Lazy.new(:action) if list.is-lazy; my \iter = (nqp::istype(list, Iterable) ?? list !! list.list).iterator; my $value := iter.pull-one; unless $value =:= IterationEnd { my $tested := test($value); # multi-level categorize if nqp::istype($tested[0],Iterable) { X::Invalid::ComputedValue.new( :name, :method, :value, :reason(self.^name ~ ' cannot be nested and so does not ' ~ 'support multi-level categorization'), ).throw; } # simple categorize else { loop { ++self{$_} for @$tested; last if ($value := iter.pull-one) =:= IterationEnd; nqp::istype(($tested := test($value))[0], Iterable) and X::Invalid::ComputedValue.new( :name, :method, :value('an item with different number of elements ' ~ 'in it than previous items'), :reason('all values need to have the same number ' ~ 'of elements. Mixed-level classification is ' ~ 'not supported.'), ).throw; }; } } self; } multi method categorize-list( %test, |c ) { self.categorize-list( { %test{$^a} }, |c ); } multi method categorize-list( @test, |c ) { self.categorize-list( { @test[$^a] }, |c ); } multi method categorize-list( &test, **@list, |c ) { self.categorize-list( &test, @list, |c ); } #--- coercion methods sub SETIFY(\raw, \type) { nqp::if( raw && nqp::elems(raw), nqp::stmts( (my $elems := nqp::clone(raw)), (my $iter := nqp::iterator($elems)), nqp::while( $iter, nqp::bindkey( $elems, nqp::iterkey_s(nqp::shift($iter)), nqp::getattr(nqp::iterval($iter),Pair,'$!key'), ) ), nqp::create(type).SET-SELF($elems) ), nqp::if( nqp::eqaddr(type,Set), set(), nqp::create(type) ) ) } multi method Set(Baggy:D:) { SETIFY($!elems,Set) } multi method SetHash(Baggy:D:) { SETIFY($!elems,SetHash) } sub MIXIFY(\raw, \type) { nqp::if( raw && nqp::elems(raw), nqp::create(type).SET-SELF(Rakudo::QuantHash.BAGGY-CLONE(raw)), nqp::if( nqp::istype(type,Mix), mix(), nqp::create(MixHash) ) ) } multi method Mix(Baggy:D:) { MIXIFY($!elems, Mix) } multi method MixHash(Baggy:D:) { MIXIFY($!elems, MixHash) } method RAW-HASH() is raw { $!elems } } multi sub infix:(Baggy:D \a, Baggy:D \b --> Bool:D) { nqp::p6bool( nqp::eqaddr(a,b) || (nqp::eqaddr(a.WHAT,b.WHAT) && a.ACCEPTS(b)) ) } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/BagHash.pm60000644000175000017500000002131213253717231015263 0ustar alexalexmy class BagHash does Baggy { #--- interface methods method STORE(*@pairs --> BagHash:D) { nqp::if( (my $iterator := @pairs.iterator).is-lazy, Failure.new(X::Cannot::Lazy.new(:action,:what(self.^name))), self.SET-SELF( Rakudo::QuantHash.ADD-PAIRS-TO-BAG( nqp::create(Rakudo::Internals::IterationSet), $iterator ) ) ) } multi method AT-KEY(BagHash:D: \k) is raw { Proxy.new( FETCH => { nqp::if( $!elems && nqp::existskey($!elems,(my $which := k.WHICH)), nqp::getattr(nqp::atkey($!elems,$which),Pair,'$!value'), 0 ) }, STORE => -> $, Int() $value { nqp::if( nqp::istype($value,Failure), # RT 128927 $value.throw, nqp::if( $!elems, nqp::if( # allocated hash nqp::existskey($!elems,(my $which := k.WHICH)), nqp::if( # existing element nqp::isgt_i($value,0), nqp::bindattr( nqp::atkey($!elems,$which), Pair, '$!value', nqp::decont($value) ), nqp::stmts( nqp::deletekey($!elems,$which), 0 ) ), nqp::if( nqp::isgt_i($value,0), # new nqp::bindkey( $!elems, $which, Pair.new(k,nqp::decont($value)) ) ) ), nqp::if( # no hash allocated yet nqp::isgt_i($value,0), nqp::bindkey( nqp::bindattr(self,::?CLASS,'$!elems', nqp::create(Rakudo::Internals::IterationSet)), k.WHICH, Pair.new(k,nqp::decont($value)) ) ) ) ) } ) } #--- introspection methods method total() { Rakudo::QuantHash.BAG-TOTAL($!elems) } #--- coercion methods multi method Bag(BagHash:D: :$view) { nqp::if( $!elems && nqp::elems($!elems), nqp::create(Bag).SET-SELF( # not empty nqp::if( $view, $!elems, # BagHash won't change Rakudo::QuantHash.BAGGY-CLONE($!elems) # need deep copy ) ), bag() # empty, bag() will do ) } multi method BagHash(BagHash:D:) { self } multi method Mix(BagHash:D:) { nqp::if( $!elems && nqp::elems($!elems), nqp::create(Mix).SET-SELF(Rakudo::QuantHash.BAGGY-CLONE($!elems)), mix() ) } multi method MixHash(BagHash:D:) { nqp::if( $!elems && nqp::elems($!elems), nqp::create(MixHash).SET-SELF(Rakudo::QuantHash.BAGGY-CLONE($!elems)), nqp::create(MixHash) ) } method clone() { nqp::if( $!elems && nqp::elems($!elems), nqp::create(BagHash).SET-SELF(Rakudo::QuantHash.BAGGY-CLONE($!elems)), nqp::create(BagHash) ) } #--- iterator methods sub proxy(Mu \iter,Mu \storage) is raw { # We are only sure that the key exists when the Proxy # is made, but we cannot be sure of its existence when # either the FETCH or STORE block is executed. So we # still need to check for existence, and handle the case # where we need to (re-create) the key and value. The # logic is therefore basically the same as in AT-KEY, # except for tests for allocated storage and .WHICH # processing. nqp::stmts( (my $which := nqp::iterkey_s(iter)), # save object for potential recreation (my $object := nqp::getattr(nqp::iterval(iter),Pair,'$!key')), Proxy.new( FETCH => { nqp::if( nqp::existskey(storage,$which), nqp::getattr(nqp::atkey(storage,$which),Pair,'$!value'), 0 ) }, STORE => -> $, Int() $value { nqp::if( nqp::istype($value,Failure), # RT 128927 $value.throw, nqp::if( nqp::existskey(storage,$which), nqp::if( # existing element nqp::isgt_i($value,0), nqp::bindattr( # value ok nqp::atkey(storage,$which), Pair, '$!value', nqp::decont($value) ), nqp::stmts( # goodbye! nqp::deletekey(storage,$which), 0 ) ), nqp::if( # where did it go? nqp::isgt_i($value,0), nqp::bindkey( storage, $which, Pair.new($object,nqp::decont($value)) ) ) ) ) } ) ) } multi method iterator(BagHash:D:) { # also .pairs class :: does Rakudo::Iterator::Mappy { method pull-one() is raw { nqp::if( $!iter, nqp::p6bindattrinvres( nqp::clone(nqp::iterval(nqp::shift($!iter))), Pair, '$!value', proxy($!iter,$!hash) ), IterationEnd ) } method push-all($target --> IterationEnd) { nqp::while( # doesn't sink $!iter, $target.push(nqp::iterval(nqp::shift($!iter))) ) } }.new($!elems) } multi method values(BagHash:D:) { Seq.new(class :: does Rakudo::Iterator::Mappy { method pull-one() is raw { nqp::if( $!iter, proxy(nqp::shift($!iter),$!hash), IterationEnd ) } # same as Baggy.values method push-all($target --> IterationEnd) { nqp::while( # doesn't sink $!iter, $target.push(nqp::getattr( nqp::iterval(nqp::shift($!iter)),Pair,'$!value')) ) } }.new($!elems)) } multi method kv(BagHash:D:) { Seq.new(class :: does Rakudo::Iterator::Mappy-kv-from-pairs { method pull-one() is raw { nqp::if( $!on, nqp::stmts( ($!on = 0), proxy($!iter,$!hash) ), nqp::if( $!iter, nqp::stmts( ($!on = 1), nqp::getattr( nqp::iterval(nqp::shift($!iter)),Pair,'$!key') ), IterationEnd ) ) } }.new($!elems)) } #---- selection methods multi method grab(BagHash:D:) { nqp::if( $!elems && nqp::elems($!elems), Rakudo::QuantHash.BAG-GRAB($!elems,self.total), Nil ) } multi method grab(BagHash:D: Callable:D $calculate) { self.grab( $calculate(self.total) ) } multi method grab(BagHash:D: Whatever) { self.grab(Inf) } multi method grab(BagHash:D: $count) { Seq.new(nqp::if( (my $todo = Rakudo::QuantHash.TODO($count)) && $!elems && nqp::elems($!elems), nqp::stmts( (my Int $total = self.total), nqp::if($todo > $total,$todo = $total), Rakudo::Iterator.Callable( { nqp::if( $todo, nqp::stmts( --$todo, Rakudo::QuantHash.BAG-GRAB($!elems,$total--) ), IterationEnd ) } ) ), Rakudo::Iterator.Empty )) } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Bag.pm60000644000175000017500000000477213253717231014472 0ustar alexalexmy class Bag does Baggy { has Int $!total; has $!WHICH; #--- introspection methods multi method WHICH(Bag:D:) { nqp::if( nqp::attrinited(self,Bag,'$!WHICH'), $!WHICH, $!WHICH := ValueObjAt.new('Bag!' ~ nqp::sha1( nqp::join('\0',Rakudo::Sorting.MERGESORT-str( Rakudo::QuantHash.BAGGY-RAW-KEY-VALUES(self) )) )) ) } method total(Bag:D: --> Int:D) { nqp::if( nqp::attrinited(self,Bag,'$!total'), $!total, $!total := Rakudo::QuantHash.BAG-TOTAL($!elems) ) } #--- interface methods method STORE(*@pairs, :$initialize --> Bag:D) { nqp::if( (my $iterator := @pairs.iterator).is-lazy, Failure.new(X::Cannot::Lazy.new(:action,:what(self.^name))), nqp::if( $initialize, self.SET-SELF( Rakudo::QuantHash.ADD-PAIRS-TO-BAG( nqp::create(Rakudo::Internals::IterationSet), $iterator ) ), X::Assignment::RO.new(value => self).throw ) ) } multi method DELETE-KEY(Bag:D: \k) { X::Immutable.new(method => 'DELETE-KEY', typename => self.^name).throw; } #--- selection methods multi method grabpairs(Bag:D: $count?) { X::Immutable.new( method => 'grabpairs', typename => self.^name ).throw; } #--- coercion methods multi method Bag(Bag:D:) { self } multi method BagHash(Bag:D) { nqp::if( $!elems && nqp::elems($!elems), nqp::create(BagHash).SET-SELF(Rakudo::QuantHash.BAGGY-CLONE($!elems)), nqp::create(BagHash) ) } multi method Mix(Bag:D:) { nqp::if( $!elems && nqp::elems($!elems), nqp::create(Mix).SET-SELF($!elems), mix() ) } multi method MixHash(Bag:D) { nqp::if( $!elems && nqp::elems($!elems), nqp::create(MixHash).SET-SELF(Rakudo::QuantHash.BAGGY-CLONE($!elems)), nqp::create(MixHash) ) } method clone() { nqp::if( $!elems && nqp::elems($!elems), nqp::clone(self), bag() ) } #--- illegal methods proto method classify-list(|) { X::Immutable.new(:method, :typename(self.^name)).throw; } proto method categorize-list(|) { X::Immutable.new(:method, :typename(self.^name)).throw; } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Block.pm60000644000175000017500000003140213253717231015021 0ustar alexalexmy class Block { # declared in BOOTSTRAP # class Block is Code # has Mu $!phasers; # has Mu $!why; method of(Block:D:) { nqp::getattr(self,Code,'$!signature').returns } method returns(Block:D:) { nqp::getattr(self,Code,'$!signature').returns } method add_phaser(Str:D \name, &block --> Nil) { $!phasers := nqp::hash unless nqp::attrinited(self,Block,'$!phasers'); my str $name = name; nqp::bindkey($!phasers,$name,nqp::create(IterationBuffer)) unless nqp::existskey($!phasers,$name); if nqp::iseq_s($name,'LEAVE') || nqp::iseq_s($name,'KEEP') || nqp::iseq_s($name,'UNDO') { nqp::unshift(nqp::atkey($!phasers,$name),&block); self.add_phaser('!LEAVE-ORDER', &block); } elsif nqp::iseq_s($name,'NEXT') || nqp::iseq_s($name,'!LEAVE-ORDER') || nqp::iseq_s($name,'POST') { nqp::unshift(nqp::atkey($!phasers,$name),&block); } else { nqp::push(nqp::atkey($!phasers,$name),&block); } } method fire_if_phasers(Str $name --> Nil) { nqp::if( nqp::attrinited(self,Block,'$!phasers') && nqp::existskey($!phasers,$name), nqp::stmts( (my $iter := nqp::iterator(nqp::atkey($!phasers,$name))), nqp::while($iter,nqp::shift($iter)(),:nohandler) ) ) } method fire_phasers(Str $name --> Nil) { nqp::stmts( (my $iter := nqp::iterator(nqp::atkey($!phasers,$name))), nqp::while($iter,nqp::shift($iter)(),:nohandler) ) } method has-phasers() { nqp::attrinited(self,Block,'$!phasers') } method has-phaser(Str:D \name) { nqp::attrinited(self,Block,'$!phasers') && nqp::existskey($!phasers,nqp::unbox_s(name)) } method phasers(Str:D $name) { nqp::attrinited(self,Block,'$!phasers') && nqp::existskey($!phasers,nqp::unbox_s($name)) ?? nqp::p6bindattrinvres(nqp::create(List),List,'$!reified', nqp::atkey($!phasers,nqp::unbox_s($name))) !! () } method assuming(Block:D $self: |primers) { my $sig = nqp::getattr(nqp::decont($self), Code, '$!signature'); # A ::() that does not throw. Also does not need to deal # with chunks or sigils. my sub soft_indirect_name_lookup($name) { my @parts = $name.split('::'); my Mu $thing := ::.EXISTS-KEY(@parts[0]); return False unless $thing; $thing := ::.AT-KEY(@parts.shift); for @parts { return False unless $thing.WHO.EXISTS-KEY($_); $thing := $thing.WHO{$_}; } True; } # sub strip-parm # This is mostly a stripped-down version of Parameter.perl, removing # where clauses, turning "= { ... }" from defaults into just # "?", removing type captures, subsignatures, and undeclared types # (e.g. types set to or parameterized by captured types.) my sub strip_parm (Parameter:D $parm, :$make_optional = False) { my $type = $parm.type.^name; my $perl = $type; my $rest = ''; my $sigil = $parm.sigil; my $elide_agg_cont= so ($sigil eqv '@' or $sigil eqv '%' or $type ~~ /^^ Callable >> /); $perl = '' if $elide_agg_cont; unless $type eq "Any" { my int $FIRST = 1; # broken FIRST workaround while ($type ~~ / (.*?) \[ (.*) \] $$/) { # FIRST { # seems broken in setting if $FIRST { # broken FIRST workaround $perl = $elide_agg_cont ?? ~$1 !! ~$/; $FIRST = 0; } $type = ~$1; unless soft_indirect_name_lookup(~$0) { $perl = ''; last }; } $perl = '' unless soft_indirect_name_lookup($type); } $perl ~= $parm.modifier if $perl ne ''; my $name = $parm.name; if !$name and $parm.raw { $name = '$'; } elsif !$name or !$name.starts-with($sigil) { $name = $sigil ~ $parm.twigil ~ ($name // ''); } if $parm.slurpy { $name = '*' ~ $name; } elsif $parm.named { my @names := $parm.named_names; $name = ':' ~ $_ ~ '(' ~ $name ~ ')'for @names; $name ~= '!' unless ($parm.optional or $make_optional); $name ~= '?' if ($make_optional); } elsif $parm.optional or $parm.default { $name ~= '?'; } if $parm.rw { $rest ~= ' is rw'; } elsif $parm.copy { $rest ~= ' is copy'; } if $parm.raw { $rest ~= ' is raw' unless $name.starts-with('\\'); } if $name or $rest { $perl ~= ($perl ?? ' ' !! '') ~ $name; } $perl ~ $rest; } # If we have only one parameter and it is a capture with a # subsignature, we might as will jump down into it. while +$sig.params == 1 and $sig.params[0].capture and $sig.params[0].sub_signature { $sig = $sig.params[0].sub_signature; } my @plist = (); # Positionals in the returned closure's signature my @clist = (); # The positional args used to call the original code my @tlist = (); # Positional params to verify binding primers against my @alist = (); # Primers as positional arguments after processing # Find a name safe to use across slurpies, captures and sigilless my $safename = '_'; $safename ~= '_' while $sig.params.first: { $_.name.defined and $_.name eq $safename and ($_.slurpy or $_.sigil eq '\\' or $_.sigil eq '|') }; my $capwrap = $safename ~ '_'; $capwrap ~= '_' while $sig.params.first: { $_.name.defined and $_.name eq $capwrap and ($_.slurpy or $_.sigil eq '\\' or $_.sigil eq '|') }; # Look for slurpies and captures my $slurp_p = $sig.params.first: {.slurpy and .sigil eq '@'}; my $slurp_n = $sig.params.first: {.slurpy and .sigil eq '%'}; $slurp_p //= (); $slurp_n //= (); # This gets sticky. A bare capture will take anything # you throw at it. A capture with a subsignature, not always. # Both will raise Signature.count to Inf, unfortunately, # and neither counts towards Signature.arity. That might # eventually change as it is LTA. # # We have no real use for any captures defined in the original # signature, but if there is one, we must emulate its slurpylike # effects. We cannot tell if it actually has slurpylike # effects without looking at subsignatures, recursively, # but really Signature should be able to tell us that. # # Until then, we will add slurpy behaviors, assuming we # do not already have them, if we see a capture. my $need_cap = ($sig.count == Inf and not ($slurp_p and $slurp_n)); if $need_cap { $need_cap = False; for $sig.params.grep(*.capture) { $need_cap = True; last; } } # For now this is how we fabricate parameters. my &safeparms = EVAL sprintf('sub (|%s) { }', $safename); if ($need_cap) { $slurp_p ||= &safeparms.signature.params[0]; $slurp_n ||= &safeparms.signature.params[0]; } # Normal Positionals my Int $idx = -1; for $sig.params.grep(*.positional) -> $parm { ++$idx; unless $idx < primers.list.elems { @plist.push($parm); @clist.push($capwrap ~ '[' ~ @plist.end ~ ']'); next; } given primers.list[$idx] { when Whatever { @plist.push($parm); @clist.push($capwrap ~ '[' ~ @plist.end ~ ']'); } when Nil { @alist.push($parm.type); @clist.push($parm.type.^name); @tlist.push($parm); } default { @alist.push($_); @clist.push("primers.list[$idx]"); @tlist.push($parm); } } } my $widx = @plist.end; @tlist.push($slurp_p) if $slurp_p; @plist.push($slurp_p) if $slurp_p and not $slurp_p.capture; ++$idx; my $cidx = 0; # Even if we prime above the arity, do it anyway, for errors. while ($idx < primers.list.elems) { given primers.list[$idx] { when Whatever { @clist.push($capwrap ~ '[' ~ ++$widx ~ ']'); } when Nil { my $t = "Any"; if $slurp_p { unless $slurp_p.capture { $t = $slurp_p.type.of.^name } } @alist.push($t); @clist.push($t); } default { @alist.push($_); @clist.push("primers.list[$idx]"); } } ++$idx; } if $slurp_p { @clist.push('|' ~ $capwrap ~ '[' ~ ++$widx ~ '..*-1]' ); # If it is a true slurpy we already pushed it to $plist $slurp_p = () unless $slurp_p.capture; } # Normal Nameds. # I noted this: # perl6 -e 'sub a (*%A, :$a?, *%B) { %A.say; %B.say }; a(:a(1));' # {:a(1)}<> # {}<> # I am going to treat that as a feature and preserve the behavior. # So we will care for ordering of the named parameters in the # user-facing signature as well, for introspection purposes. my %ahash = primers.hash; my @phash = $sig.params.grep: *.named; my @thash = $sig.params.grep: { .named and ( .slurpy or any(%ahash.keys) eq any(.named_names.list) ) } @phash .= map: { my @names = .named_names.list; my $p = strip_parm($_); if not .optional and any(%ahash.keys) eq any(@names) { # Make mandatory parameters optional once they have # been supplied at least once. $p = strip_parm($_, :make_optional); } $p; } if ($slurp_n and $slurp_n.capture and !($slurp_n === $slurp_p)) { @phash.push(strip_parm($slurp_n)); } my $error = False; EVAL(sprintf('anon sub trybind (%s) { }(|@alist, |%%ahash);', (flat @tlist.map(&strip_parm), @thash.map(&strip_parm)).join(", ")) ); my $f; my $primed_sig = (flat @plist.map(&strip_parm), @phash, ($slurp_p ?? strip_parm($slurp_p) !! ())).join(", "); $primed_sig ~= ' --> ' ~ $sig.returns.^name; $f = EVAL sprintf( '{ my $res = (my proto __PRIMED_ANON (%s) { {*} }); my multi __PRIMED_ANON (|%s(%s)) { my %%chash := %s.hash; $self(%s%s |{ %%ahash, %%chash }); # |{} workaround RT#77788 }; $res }()', $primed_sig, $capwrap, $primed_sig, $capwrap, (flat @clist).join(", "), (@clist ?? ',' !! '') ); $error ~~ Exception ?? $f but Failure.new($error) !! $f; } multi method perl(Block:D:) { "-> {self.signature.perl.substr(2,*-1)} \{ #`({self.WHICH}) ... \}" } method WHY() { if nqp::isnull($!why) { nextsame } else { $!why.set_docee(self); $!why } } method set_why($why --> Nil) { $!why := $why; } # helper method for array slicing method pos(Block:D $self: \list) { nqp::if( (nqp::istype( (my $n := nqp::getattr( nqp::getattr($self,Code,'$!signature'),Signature,'$!count') ),Num) && nqp::isnanorinf($n)) || nqp::iseq_i(nqp::unbox_i($n),1), $self(nqp::if(nqp::isconcrete(list),list.elems,0)), $self(|(nqp::if(nqp::isconcrete(list),list.elems,0) xx $n)) ) } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Bool.pm60000644000175000017500000001363713253717231014674 0ustar alexalex# enum Bool declared in BOOTSTRAP BEGIN { Bool.^add_method('Bool', my proto method Bool(|) {*}); Bool.^add_method('gist', my proto method gist(|) {*}); Bool.^add_method('Numeric', my proto method Numeric(|) {*}); Bool.^add_method('Int', my proto method Int(|) {*}); Bool.^add_method('ACCEPTS', my proto method ACCEPTS(|) {*}); Bool.^add_method('pick', my proto method pick(|) {*}); Bool.^add_method('roll', my proto method roll(|) {*}); Bool.^add_method('perl', my proto method perl(|) {*}); } BEGIN { Bool.^add_multi_method('Bool', my multi method Bool(Bool:D:) { self }); Bool.^add_multi_method('gist', my multi method gist(Bool:D:) { self ?? 'True' !! 'False' }); Bool.^add_multi_method('Str', my multi method Str(Bool:D:) { self ?? 'True' !! 'False' }); Bool.^add_multi_method('Numeric', my multi method Numeric(Bool:D:) { self ?? 1 !! 0 }); Bool.^add_multi_method('Int', my multi method Int(Bool:D:) { self ?? 1 !! 0 }); Bool.^add_multi_method('Real', my multi method Real(Bool:D:) { self ?? 1 !! 0 }); Bool.^add_multi_method('ACCEPTS', my multi method ACCEPTS(Bool:D: Mu \topic ) { self }); Bool.^add_multi_method('perl', my multi method perl(Bool:D:) { self ?? 'Bool::True' !! 'Bool::False' }); Bool.^add_multi_method('pick', my multi method pick(Bool:U:) { nqp::p6bool(nqp::isge_n(nqp::rand_n(2e0), 1e0)) }); Bool.^add_multi_method('roll', my multi method roll(Bool:U:) { nqp::p6bool(nqp::isge_n(nqp::rand_n(2e0), 1e0)) }); } BEGIN { Bool.^add_multi_method('Bool', my multi method Bool(Bool:U:) { Bool::False }); Bool.^add_multi_method('ACCEPTS', my multi method ACCEPTS(Bool:U: \topic ) { nqp::istype(topic, Bool) }); Bool.^add_multi_method('gist', my multi method gist(Bool:U:) { '(Bool)' }); Bool.^add_multi_method('perl', my multi method perl(Bool:U:) { 'Bool' }); Bool.^add_multi_method('pick', my multi method pick(Bool:U: $n) { self.^enum_value_list.pick($n) }); Bool.^add_multi_method('roll', my multi method roll(Bool:U: $n) { self.^enum_value_list.roll($n) }); Bool.^add_method('pred', my method pred() { Bool::False }); Bool.^add_method('succ', my method succ() { Bool::True }); Bool.^add_method('enums', my method enums() { self.^enum_values.Map }); Bool.^compose; } multi sub prefix:<++>(Bool $a is rw) { $a = True; } multi sub prefix:<-->(Bool $a is rw) { $a = False; } multi sub postfix:<++>(Bool:U $a is rw --> False) { $a = True } multi sub postfix:<-->(Bool:U $a is rw) { $a = False; } multi sub postfix:<++>(Bool:D $a is rw) { if $a { True } else { $a = True; False } } multi sub postfix:<-->(Bool:D $a is rw) { if $a { $a = False; True } else { False } } proto sub prefix:(Mu $) is pure {*} multi sub prefix:(Bool:D \a) { a } multi sub prefix:(Bool:U \a) { Bool::False } multi sub prefix:(Mu \a) { a.Bool } proto sub prefix:(Mu $) is pure {*} multi sub prefix:(Bool:D \a) { a } multi sub prefix:(Bool:U \a) { Bool::False } multi sub prefix:(Mu \a) { a.Bool } proto sub prefix:(Mu $) is pure {*} multi sub prefix:(Bool \a) { nqp::p6bool(nqp::not_i(nqp::istrue(a))) } multi sub prefix:(Mu \a) { nqp::p6bool(nqp::not_i(nqp::istrue(a))) } proto sub prefix:(Mu $) is pure {*} multi sub prefix:(Bool \a) { nqp::p6bool(nqp::not_i(nqp::istrue(a))) } multi sub prefix:(Mu \a) { nqp::p6bool(nqp::not_i(nqp::istrue(a))) } proto sub prefix:(Mu $) is pure {*} multi sub prefix:(Mu \a) { not a } proto sub infix:(Mu $?, Mu $?) is pure {*} multi sub infix:(Mu $x = Bool::True) { $x.Bool } multi sub infix:(Mu \a, Mu \b) { a.Bool && b.Bool } proto sub infix:(Mu $?, Mu $?) is pure {*} multi sub infix:(Mu $x = Bool::False) { $x.Bool } multi sub infix:(Mu \a, Mu \b) { a.Bool || b.Bool } proto sub infix:(Mu $?, Mu $?) is pure {*} multi sub infix:(Mu $x = Bool::False) { $x.Bool } multi sub infix:(Mu \a, Mu \b) { nqp::p6bool(nqp::ifnull(nqp::xor(a.Bool,b.Bool), 0)) } # These operators are normally handled as macros in the compiler; # we define them here for use as arguments to functions. proto sub infix:<&&>(|) {*} multi sub infix:<&&>(Mu $x = Bool::True) { $x } multi sub infix:<&&>(Mu \a, &b) { a && b() } multi sub infix:<&&>(Mu \a, Mu \b) { a && b } proto sub infix:<||>(|) {*} multi sub infix:<||>(Mu $x = Bool::False) { $x } multi sub infix:<||>(Mu \a, &b) { a || b() } multi sub infix:<||>(Mu \a, Mu \b) { a || b } proto sub infix:<^^>(|) {*} multi sub infix:<^^>(Mu $x = Bool::False) { $x } multi sub infix:<^^>(Mu \a, &b) { a ^^ b() } multi sub infix:<^^>(Mu \a, Mu \b) { a ^^ b } multi sub infix:<^^>(+@a) { my Mu $a = shift @a; while @a { my Mu $b := shift @a; $b := $b() if $b ~~ Callable; next unless $b; return Nil if $a; $a := $b; } $a; } proto sub infix:(|) {*} multi sub infix:(Mu $x = Any) { $x } multi sub infix:(Mu \a, &b) { a // b } multi sub infix:(Mu \a, Mu \b) { a // b } proto sub infix:(|) {*} multi sub infix:(Mu $x = Bool::True) { $x } multi sub infix:(Mu \a, &b) { a && b } multi sub infix:(Mu \a, Mu \b) { a && b } proto sub infix:(|) {*} multi sub infix:(Mu $x = Bool::False) { $x } multi sub infix:(Mu \a, &b) { a || b } multi sub infix:(Mu \a, Mu \b) { a || b } proto sub infix:(|) {*} multi sub infix:(Mu $x = Bool::False) { $x } multi sub infix:(Mu \a, &b) { a ^^ b } multi sub infix:(Mu \a, Mu \b) { a ^^ b } multi sub infix:(|c) { &infix:<^^>(|c); } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Buf.pm60000644000175000017500000007357013253717231014517 0ustar alexalexmy class X::Buf::AsStr { ... } my class X::Buf::Pack { ... } my class X::Buf::Pack::NonASCII { ... } my class X::Cannot::Empty { ... } my class X::Cannot::Lazy { ... } my class X::Experimental { ... } my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is array_type(T) { X::NYI.new( feature => "{$?CLASS.^name.comb(/^ \w+ /)}s with native {T.^name}" ).throw unless nqp::istype(T,Int); # other then *8 not supported yet my int $bpe = try { #?if jvm # https://irclog.perlgeek.de/perl6-dev/2017-01-20#i_13961377 CATCH { default { Nil } } #?endif (T.^nativesize / 8).Int } // 1; multi method WHICH(Blob:D:) { nqp::box_s( nqp::concat( nqp::if( nqp::eqaddr(self.WHAT,Blob), 'Blob|', nqp::concat(nqp::unbox_s(self.^name), '|') ), nqp::sha1(self.decode("latin-1")) ), ValueObjAt ) } multi method new(Blob:) { nqp::create(self) } multi method new(Blob: Blob:D $blob) { nqp::splice(nqp::create(self),$blob,0,0) } multi method new(Blob: int @values) { nqp::splice(nqp::create(self),@values,0,0) } multi method new(Blob: @values) { @values.is-lazy ?? Failure.new(X::Cannot::Lazy.new(:action,:what(self.^name))) !! self!push-list("initializ",nqp::create(self),@values) } multi method new(Blob: *@values) { self.new(@values) } proto method allocate(|) {*} multi method allocate(Blob:U: Int:D $elements) { nqp::setelems(nqp::create(self),$elements) } multi method allocate(Blob:U: Int:D $elements, int $value) { my int $elems = $elements; my $blob := nqp::setelems(nqp::create(self),$elems); my int $i = -1; nqp::bindpos_i($blob,$i,$value) while nqp::islt_i(++$i,$elems); $blob; } multi method allocate(Blob:U: Int:D $elements, Int:D \value) { my int $value = value; self.allocate($elements,$value) } multi method allocate(Blob:U: Int:D $elements, Mu:D $got) { self!fail-typecheck('allocate',$got) } multi method allocate(Blob:U: Int:D $elements, int @values) { self!spread(nqp::setelems(nqp::create(self),$elements),@values) } multi method allocate(Blob:U: Int:D $elements, Blob:D $blob) { self!spread(nqp::setelems(nqp::create(self),$elements),$blob) } multi method allocate(Blob:U: Int:D $elements, @values) { self!spread(nqp::setelems(nqp::create(self),$elements),Blob.new(@values)) } multi method EXISTS-POS(Blob:D: int \pos) { nqp::p6bool( nqp::islt_i(pos,nqp::elems(self)) && nqp::isge_i(pos,0) ); } multi method EXISTS-POS(Blob:D: Int:D \pos) { nqp::p6bool( nqp::islt_i(pos,nqp::elems(self)) && nqp::isge_i(pos,0) ); } multi method AT-POS(Blob:D: int \pos) { nqp::if( (nqp::isge_i(pos,nqp::elems(self)) || nqp::islt_i(pos,0)), self!fail-range(pos), nqp::atpos_i(self,pos) ) } multi method AT-POS(Blob:D: Int:D \pos) { nqp::if( (nqp::isge_i(pos,nqp::elems(self)) || nqp::islt_i(pos,0)), self!fail-range(pos), nqp::atpos_i(self,pos) ) } multi method Bool(Blob:D:) { nqp::p6bool(nqp::elems(self)) } method Capture(Blob:D:) { self.List.Capture } multi method elems(Blob:D:) { nqp::p6box_i(nqp::elems(self)) } multi method elems(Blob:U: --> 1) { } method Numeric(Blob:D:) { nqp::p6box_i(nqp::elems(self)) } method Int(Blob:D:) { nqp::p6box_i(nqp::elems(self)) } method bytes(Blob:D:) { nqp::mul_i(nqp::elems(self),$bpe) } method chars(Blob:D:) { X::Buf::AsStr.new(method => 'chars').throw } multi method Str(Blob:D:) { X::Buf::AsStr.new(method => 'Str' ).throw } multi method Stringy(Blob:D:) { X::Buf::AsStr.new(method => 'Stringy' ).throw } proto method decode(|) {*} multi method decode(Blob:D:) { nqp::p6box_s(nqp::decode(self, 'utf8')) } #?if moar multi method decode(Blob:D: $encoding, Str :$replacement!, Bool:D :$strict = False) { nqp::p6box_s( nqp::decoderepconf(self, Rakudo::Internals.NORMALIZE_ENCODING($encoding), $replacement.defined ?? $replacement !! nqp::null_s(), $strict ?? 0 !! 1)) } multi method decode(Blob:D: $encoding, Bool:D :$strict = False) { nqp::p6box_s( nqp::decodeconf(self, Rakudo::Internals.NORMALIZE_ENCODING($encoding), $strict ?? 0 !! 1)) } #?endif #?if !moar multi method decode(Blob:D: $encoding, Bool:D :$strict = False) { nqp::p6box_s( nqp::decode(self, Rakudo::Internals.NORMALIZE_ENCODING($encoding))) } multi method decode(Blob:D: $encoding, Str:D :$replacement!, Bool:D :$strict = False) { X::NYI.new(:feature).throw } #?endif multi method list(Blob:D:) { Seq.new(class :: does Rakudo::Iterator::Blobby { method pull-one() is raw { nqp::if( nqp::islt_i(($!i = nqp::add_i($!i,1)),nqp::elems($!blob)), nqp::atpos_i($!blob,$!i), IterationEnd ) } }.new(self)).cache } multi method gist(Blob:D:) { self.^name ~ ':0x<' ~ self.map( -> \el { state $i = 0; ++$i == 101 ?? '...' !! $i == 102 ?? last() !! nqp::if(nqp::iseq_i( # el.fmt: '%02x' nqp::chars(my str $v = nqp::lc(el.base: 16)),1), nqp::concat('0',$v),$v) }) ~ '>' } multi method perl(Blob:D:) { self.^name ~ '.new(' ~ self.join(',') ~ ')'; } method subbuf(Blob:D: $from, $length?) { nqp::stmts( (my int $elems = nqp::elems(self)), nqp::if( $length.DEFINITE && $length < 0, X::OutOfRange.new( :what('Len element to subbuf'), :got($length), :range("0..$elems"), ).fail, nqp::stmts( (my int $pos), (my int $todo), nqp::if( nqp::istype($from,Range), nqp::stmts( $from.int-bounds($pos, my int $max), ($todo = nqp::add_i(nqp::sub_i($max, $pos), 1))), nqp::stmts( ($pos = nqp::istype($from, Callable) ?? $from($elems) !! $from.Int), ($todo = $length.DEFINITE ?? $length.Int min $elems - $pos !! $elems - $pos))), nqp::if( nqp::islt_i($pos, 0), X::OutOfRange.new( :what('From argument to subbuf'), :got($from.gist), :range("0..$elems"), :comment("use *-{abs $pos} if you want to index relative to the end"), ).fail, nqp::if( nqp::isgt_i($pos, $elems), X::OutOfRange.new( :what('From argument to subbuf'), :got($from.gist), :range("0..$elems"), ).fail, nqp::if( nqp::isle_i($todo, 0), nqp::create(self), # we want zero elements; return empty Blob nqp::stmts( (my $subbuf := nqp::create(self)), nqp::setelems($subbuf, $todo), (my int $i = -1), --$pos, nqp::while( nqp::islt_i(++$i,$todo), nqp::bindpos_i($subbuf, $i, nqp::atpos_i(self, ++$pos))), $subbuf))))))) } method reverse(Blob:D:) { my int $elems = nqp::elems(self); my int $last = nqp::sub_i($elems,1); my $reversed := nqp::setelems(nqp::create(self),$elems); my int $i = -1; nqp::while( nqp::islt_i(($i = nqp::add_i($i,1)),$elems), nqp::bindpos_i($reversed,nqp::sub_i($last,$i), nqp::atpos_i(self,$i)) ); $reversed } method COMPARE(Blob:D: Blob:D \other) { my $other := nqp::decont(other); my int $elems = nqp::elems(self); if nqp::cmp_i($elems,nqp::elems($other)) -> $diff { $diff } else { my int $i = -1; return nqp::cmp_i(nqp::atpos_i(self,$i),nqp::atpos_i($other,$i)) if nqp::cmp_i(nqp::atpos_i(self,$i),nqp::atpos_i($other,$i)) while nqp::islt_i(++$i,$elems); 0 } } method SAME(Blob:D: Blob:D \other) { my $other := nqp::decont(other); my int $elems = nqp::elems(self); return False unless nqp::iseq_i($elems,nqp::elems($other)); my int $i = -1; return False unless nqp::iseq_i(nqp::atpos_i(self,$i),nqp::atpos_i($other,$i)) while nqp::islt_i(++$i,$elems); True } method join(Blob:D: $delim = '') { my int $elems = nqp::elems(self); my $list := nqp::setelems(nqp::list_s,$elems); my int $i = -1; nqp::bindpos_s($list,$i, nqp::tostr_I(nqp::p6box_i(nqp::atpos_i(self,$i)))) while nqp::islt_i(++$i,$elems); nqp::join($delim.Str,$list) } proto method unpack(|) {*} multi method unpack(Blob:D: Str:D $template) { nqp::isnull(nqp::getlexcaller('EXPERIMENTAL-PACK')) and X::Experimental.new( feature => "the 'unpack' method", use => "pack" ).throw; self.unpack($template.comb(/<[a..zA..Z]>[\d+|'*']?/)) } multi method unpack(Blob:D: @template) { nqp::isnull(nqp::getlexcaller('EXPERIMENTAL-PACK')) and X::Experimental.new( feature => "the 'unpack' method", use => "pack" ).throw; my @bytes = self.list; my @fields; for @template -> $unit { my $directive = substr($unit,0,1); my $amount = substr($unit,1); my $pa = $amount eq '' ?? 1 !! $amount eq '*' ?? @bytes.elems !! +$amount; given $directive { when 'a' | 'A' | 'Z' { @fields.push: @bytes.splice(0, $pa).map(&chr).join; } when 'H' { my str $hexstring = ''; for ^$pa { my $byte = shift @bytes; $hexstring ~= ($byte +> 4).fmt('%x') ~ ($byte % 16).fmt('%x'); } @fields.push($hexstring); } when 'x' { splice @bytes, 0, $pa; } when 'C' { @fields.append: @bytes.splice(0, $pa); } when 'S' | 'v' { for ^$pa { last if @bytes.elems < 2; @fields.append: shift(@bytes) + (shift(@bytes) +< 0x08); } } when 'L' | 'V' { for ^$pa { last if @bytes.elems < 4; @fields.append: shift(@bytes) + (shift(@bytes) +< 0x08) + (shift(@bytes) +< 0x10) + (shift(@bytes) +< 0x18); } } when 'n' { for ^$pa { last if @bytes.elems < 2; @fields.append: (shift(@bytes) +< 0x08) + shift(@bytes); } } when 'N' { for ^$pa { last if @bytes.elems < 4; @fields.append: (shift(@bytes) +< 0x18) + (shift(@bytes) +< 0x10) + (shift(@bytes) +< 0x08) + shift(@bytes); } } X::Buf::Pack.new(:$directive).throw; } } return |@fields; } # XXX: the pack.t spectest file seems to require this method # not sure if it should be changed to list there... method contents(Blob:D:) { self.list } method encoding() { Any } method !push-list(\action,\to,\from) { if nqp::istype(from,List) { my Mu $from := nqp::getattr(from,List,'$!reified'); if nqp::defined($from) { my int $elems = nqp::elems($from); my int $j = nqp::elems(to); nqp::setelems(to, $j + $elems); # presize for efficiency my int $i = -1; my $got; nqp::while( nqp::islt_i(++$i,$elems), nqp::stmts( ($got := nqp::atpos($from,$i)), nqp::istype(nqp::hllize($got),Int) ?? nqp::bindpos_i(to,$j++,$got) !! self!fail-typecheck-element(action,$i,$got).throw)) } } else { my $iter := from.iterator; my int $i = 0; my $got; until ($got := $iter.pull-one) =:= IterationEnd { nqp::istype($got,Int) ?? nqp::push_i(to,$got) !! self!fail-typecheck-element(action,$i,$got).throw; ++$i; } } to } method !unshift-list(\action,\to,\from) { if nqp::istype(from,List) { my Mu $from := nqp::getattr(from,List,'$!reified'); if nqp::defined($from) { my int $i = nqp::elems($from); nqp::istype((my $got := nqp::atpos($from,$i)),Int) ?? nqp::unshift_i(to,$got) !! self!fail-typecheck-element(action,$i,$got).throw while nqp::isge_i(--$i,0); } to } else { nqp::splice(to,self!push-list(action,nqp::create(self),from),0,0) } } method !spread(\to,\from) { if nqp::elems(from) -> int $values { # something to init with my int $elems = nqp::elems(to) - $values; my int $i = -$values; nqp::splice(to,from,$i,$values) while nqp::isle_i($i = $i + $values,$elems); if nqp::isgt_i($i,$elems) { # something left to init --$i; # went one too far $elems = $elems + $values; my int $j = -1; nqp::bindpos_i(to,$i,nqp::atpos_i(from,$j = ($j + 1) % $values)) while nqp::islt_i(++$i,$elems); } } to } method !fail-range($got) { Failure.new(X::OutOfRange.new( :what($*INDEX // 'Index'), :$got, :range("0..{nqp::elems(self)-1}") )) } method !fail-typecheck-element(\action,\i,\got) { self!fail-typecheck(action ~ "ing element #" ~ i,got); } method !fail-typecheck($action,$got) { Failure.new(X::TypeCheck.new( operation => $action ~ " to " ~ self.^name, got => $got, expected => T, )) } } constant blob8 = Blob[uint8]; constant blob16 = Blob[uint16]; constant blob32 = Blob[uint32]; constant blob64 = Blob[uint64]; my class utf8 does Blob[uint8] is repr('VMArray') { multi method decode(utf8:D: $encoding) { my $enc = Rakudo::Internals.NORMALIZE_ENCODING($encoding); die "Can not decode a utf-8 buffer as if it were $encoding" unless $enc eq 'utf8'; nqp::p6box_s(nqp::decode(self, 'utf8')) } method encoding() { 'utf-8' } multi method Str(utf8:D:) { self.decode } multi method Stringy(utf8:D:) { self.decode } } my class utf16 does Blob[uint16] is repr('VMArray') { multi method decode(utf16:D: $encoding = 'utf-16') { my $enc = Rakudo::Internals.NORMALIZE_ENCODING($encoding); die "Can not decode a utf-16 buffer as if it were $encoding" unless $enc eq 'utf16'; nqp::p6box_s(nqp::decode(self, 'utf16')) } method encoding() { 'utf-16' } multi method Str(utf16:D:) { self.decode } multi method Stringy(utf16:D:) { self.decode } } my class utf32 does Blob[uint32] is repr('VMArray') { multi method decode(utf32:D: $encoding = 'utf-32') { my $enc = Rakudo::Internals.NORMALIZE_ENCODING($encoding); die "Can not decode a utf-32 buffer as if it were $encoding" unless $enc eq 'utf32'; nqp::p6box_s(nqp::decode(self, 'utf32')) } method encoding() { 'utf-32' } multi method Str(utf32:D:) { self.decode } multi method Stringy(utf32:D:) { self.decode } } my role Buf[::T = uint8] does Blob[T] is repr('VMArray') is array_type(T) { multi method WHICH(Buf:D:) { self.Mu::WHICH } multi method AT-POS(Buf:D: int \pos) is raw { nqp::islt_i(pos,0) ?? Failure.new(X::OutOfRange.new( :what($*INDEX // 'Index'),:got(pos),:range<0..^Inf>)) !! nqp::atposref_i(self, pos) } multi method AT-POS(Buf:D: Int:D \pos) is raw { my int $pos = nqp::unbox_i(pos); nqp::islt_i($pos,0) ?? Failure.new(X::OutOfRange.new( :what($*INDEX // 'Index'),:got(pos),:range<0..^Inf>)) !! nqp::atposref_i(self,$pos) } multi method ASSIGN-POS(Buf:D: int \pos, Mu \assignee) { nqp::islt_i(pos,0) ?? Failure.new(X::OutOfRange.new( :what($*INDEX // 'Index'),:got(pos),:range<0..^Inf>)) !! nqp::bindpos_i(self,pos,assignee) } multi method ASSIGN-POS(Buf:D: Int:D \pos, Mu \assignee) { my int $pos = nqp::unbox_i(pos); nqp::islt_i($pos,0) ?? Failure.new(X::OutOfRange.new( :what($*INDEX // 'Index'),:got(pos),:range<0..^Inf>)) !! nqp::bindpos_i(self,$pos,assignee) } multi method list(Buf:D:) { Seq.new(class :: does Rakudo::Iterator::Blobby { method pull-one() is raw { nqp::if( nqp::islt_i(($!i = nqp::add_i($!i,1)),nqp::elems($!blob)), nqp::atposref_i($!blob,$!i), IterationEnd ) } }.new(self)).cache } proto method pop(|) { * } multi method pop(Buf:D:) { nqp::elems(self) ?? nqp::pop_i(self) !! Failure.new(X::Cannot::Empty.new(:action,:what(self.^name))) } proto method shift(|) { * } multi method shift(Buf:D:) { nqp::elems(self) ?? nqp::shift_i(self) !! Failure.new(X::Cannot::Empty.new(:action,:what(self.^name))) } method reallocate(Buf:D: Int:D $elements) { nqp::setelems(self,$elements) } my $empty := nqp::list_i; proto method splice(|) { * } multi method splice(Buf:D \SELF:) { my $buf = SELF; SELF = Buf.new; $buf } multi method splice(Buf:D: Int:D $offset, $size = Whatever) { my int $remove = self!remove($offset,$size); my $result := $remove ?? self.subbuf($offset,$remove) # until something smarter !! nqp::create(self); nqp::splice(self,$empty,$offset,$remove); $result } multi method splice(Buf:D: Int:D $offset, $size, int $got) { self!splice-native($offset,$size,$got) } multi method splice(Buf:D: Int:D $offset, $size, Int:D $got) { self!splice-native($offset,$size,$got) } multi method splice(Buf:D: Int:D $offset, $size, Mu:D $got) { self!fail-typecheck('splice',$got) } multi method splice(Buf:D: Int:D $offset, $size, Buf:D $buf) { self!splice-native($offset,$size,$buf) } multi method splice(Buf:D: Int:D $offset, $size, int @values) { self!splice-native($offset,$size,@values) } multi method splice(Buf:D: Int:D $offset, $size, @values) { self!splice-native($offset,$size, self!push-list("splic",nqp::create(self),@values)) } method !remove(\offset,\size) { nqp::istype(size,Whatever) ?? nqp::elems(self) - offset !! nqp::istype(size,Int) ?? size !! size.Int } method !splice-native(Buf:D: Int:D $offset, $size, \x) { my int $remove = self!remove($offset,$size); my $result := $remove ?? self.subbuf($offset,$remove) # until something smarter !! nqp::create(self); nqp::splice( self,nqp::islist(x) ?? x !! nqp::list_i(x),$offset,$remove); $result } proto method push(|) { * } multi method push(Buf:D: int $got) { nqp::push_i(self,$got); self } multi method push(Buf:D: Int:D $got) { nqp::push_i(self,$got); self } multi method push(Buf:D: Mu:D $got) { self!fail-typecheck('push',$got) } multi method push(Buf:D: Blob:D $buf) { nqp::splice(self,$buf,nqp::elems(self),0) } multi method push(Buf:D: **@values) { self!pend(@values,'push') } proto method append(|) { * } multi method append(Buf:D: int $got) { nqp::push_i(self,$got); self } multi method append(Buf:D: Int:D $got) { nqp::push_i(self,$got); self } multi method append(Buf:D: Mu:D $got) { self!fail-typecheck('append',$got) } multi method append(Buf:D: Blob:D $buf) { nqp::splice(self,$buf,nqp::elems(self),0) } multi method append(Buf:D: int @values) { nqp::splice(self,@values,nqp::elems(self),0) } multi method append(Buf:D: @values) { self!pend(@values,'append') } multi method append(Buf:D: *@values) { self!pend(@values,'append') } proto method unshift(|) { * } multi method unshift(Buf:D: int $got) { nqp::unshift_i(self,$got); self } multi method unshift(Buf:D: Int:D $got) { nqp::unshift_i(self,$got); self } multi method unshift(Buf:D: Mu:D $got) { self!fail-typecheck('unshift',$got) } multi method unshift(Buf:D: Blob:D $buf) { nqp::splice(self,$buf,0,0) } multi method unshift(Buf:D: **@values) { self!pend(@values,'unshift') } proto method prepend(|) { * } multi method prepend(Buf:D: int $got) { nqp::unshift_i(self,$got); self } multi method prepend(Buf:D: Int:D $got) { nqp::unshift_i(self,$got); self } multi method prepend(Buf:D: Mu:D $got) { self!fail-typecheck('prepend',$got) } multi method prepend(Buf:D: Blob:D $buf) { nqp::splice(self,$buf,0,0) } multi method prepend(Buf:D: int @values) { nqp::splice(self,@values,0,0) } multi method prepend(Buf:D: @values) { self!pend(@values,'prepend') } multi method prepend(Buf:D: *@values) { self!pend(@values,'prepend') } method !pend(Buf:D: @values, $action) { @values.is-lazy ?? Failure.new(X::Cannot::Lazy.new(:$action,:what(self.^name))) !! $action eq 'push' || $action eq 'append' ?? self!push-list($action,self,@values) !! self!unshift-list($action,self,@values) } method subbuf-rw($from = 0, $elems = self.elems - $from) is rw { my Blob $subbuf = self.subbuf($from, $elems); Proxy.new( FETCH => sub ($) { $subbuf }, STORE => sub ($, Blob:D $new) { nqp::splice(nqp::decont(self),nqp::decont($new),$from,$elems) } ); } } constant buf8 = Buf[uint8]; constant buf16 = Buf[uint16]; constant buf32 = Buf[uint32]; constant buf64 = Buf[uint64]; proto sub pack(|) {*} multi sub pack(Str $template, *@items) { nqp::isnull(nqp::getlexcaller('EXPERIMENTAL-PACK')) and X::Experimental.new( feature => "the 'pack' function", use => "pack" ).throw; pack($template.comb(/<[a..zA..Z]>[\d+|'*']?/), @items) } multi sub pack(@template, *@items) { nqp::isnull(nqp::getlexcaller('EXPERIMENTAL-PACK')) and X::Experimental.new( feature => "the 'pack' function", use => "pack" ).throw; my @bytes; for @template -> $unit { my $directive = substr($unit,0,1); my $amount = substr($unit,1); given $directive { when 'A' { my $ascii = shift @items // ''; my $data = $ascii.ords.cache; if $amount eq '*' { $amount = $data.elems; } if $amount eq '' { $amount = 1; } for (@$data, 0x20 xx *).flat[^$amount] -> $byte { X::Buf::Pack::NonASCII.new(:char($byte.chr)).throw if $byte > 0x7f; @bytes.push: $byte; } } when 'a' { my $data = shift @items // Buf.new; $data.=encode if nqp::istype($data,Str); if $amount eq '*' { $amount = $data.elems; } if $amount eq '' { $amount = 1; } for (@$data, 0 xx *).flat[^$amount] -> $byte { @bytes.push: $byte; } } when 'H' { my $hexstring = shift @items // ''; if $hexstring.chars % 2 { $hexstring ~= '0'; } @bytes.append: map { :16($_) }, $hexstring.comb(/../); } when 'x' { if $amount eq '*' { $amount = 0; } elsif $amount eq '' { $amount = 1; } @bytes.append: 0x00 xx $amount; } when 'C' { my $number = shift(@items); @bytes.push: $number % 0x100; } when 'S' | 'v' { my $number = shift(@items); @bytes.append: ($number, $number +> 0x08) >>%>> 0x100; } when 'L' | 'V' { my $number = shift(@items); @bytes.append: ($number, $number +> 0x08, $number +> 0x10, $number +> 0x18) >>%>> 0x100; } when 'n' { my $number = shift(@items); @bytes.append: ($number +> 0x08, $number) >>%>> 0x100; } when 'N' { my $number = shift(@items); @bytes.append: ($number +> 0x18, $number +> 0x10, $number +> 0x08, $number) >>%>> 0x100; } X::Buf::Pack.new(:$directive).throw; } } return Buf.new(@bytes); } multi sub infix:<~>(Blob:D \a) { a } multi sub infix:<~>(Blob:D $a, Blob:D $b) { my $res := nqp::create(nqp::eqaddr($a.WHAT,$b.WHAT) ?? $a !! Buf.^pun); my $adc := nqp::decont($a); my $bdc := nqp::decont($b); my int $alen = nqp::elems($adc); my int $blen = nqp::elems($bdc); nqp::setelems($res, $alen + $blen); nqp::splice($res, $adc, 0, $alen); nqp::splice($res, $bdc, $alen, $blen); } multi sub prefix:<~^>(Blob:D \a) { my $a := nqp::decont(a); my int $elems = nqp::elems($a); my $r := nqp::create($a); nqp::setelems($a,$elems); my int $i = -1; nqp::bindpos_i($r,$i,nqp::bitneg_i(nqp::atpos_i($a,$i))) while nqp::islt_i(++$i,$elems); $r } multi sub infix:<~&>(Blob:D \a, Blob:D \b) { my $a := nqp::decont(a); my $b := nqp::decont(b); my int $elemsa = nqp::elems($a); my int $elemsb = nqp::elems($b); my int $do = $elemsa > $elemsb ?? $elemsb !! $elemsa; my int $max = $elemsa > $elemsb ?? $elemsa !! $elemsb; my $r := nqp::create($a); nqp::setelems($r,$max); my int $i = -1; nqp::bindpos_i($r,$i, nqp::bitand_i(nqp::atpos_i($a,$i),nqp::atpos_i($b,$i))) while nqp::islt_i(++$i,$do); --$i; # went one too far nqp::bindpos_i($r,$i,0) while nqp::islt_i(++$i,$max); $r } multi sub infix:<~|>(Blob:D \a, Blob:D \b) { my $a := nqp::decont(a); my $b := nqp::decont(b); my int $elemsa = nqp::elems($a); my int $elemsb = nqp::elems($b); my int $do = $elemsa > $elemsb ?? $elemsb !! $elemsa; my int $max = $elemsa > $elemsb ?? $elemsa !! $elemsb; my $from := $elemsa > $elemsb ?? $a !! $b; my $r := nqp::create($a); nqp::setelems($r,$max); my int $i = -1; nqp::bindpos_i($r,$i, nqp::bitor_i(nqp::atpos_i($a,$i),nqp::atpos_i($b,$i))) while nqp::islt_i(++$i,$do); $i = $i - 1; # went one too far nqp::bindpos_i($r,$i,nqp::atpos_i($from,$i)) while nqp::islt_i(++$i,$max); $r } multi sub infix:<~^>(Blob:D \a, Blob:D \b) { my $a := nqp::decont(a); my $b := nqp::decont(b); my int $elemsa = nqp::elems($a); my int $elemsb = nqp::elems($b); my int $do = $elemsa > $elemsb ?? $elemsb !! $elemsa; my int $max = $elemsa > $elemsb ?? $elemsa !! $elemsb; my $from := $elemsa > $elemsb ?? $a !! $b; my $r := nqp::create($a); nqp::setelems($r,$max); my int $i = -1; nqp::bindpos_i($r,$i, nqp::bitxor_i(nqp::atpos_i($a,$i),nqp::atpos_i($b,$i))) while nqp::islt_i(++$i,$do); --$i; # went one too far nqp::bindpos_i($r,$i,nqp::atpos_i($from,$i)) while nqp::islt_i(++$i,$max); $r } multi sub infix:(Blob:D \a, Blob:D \b) { nqp::p6bool(nqp::eqaddr(a,b) || (nqp::eqaddr(a.WHAT,b.WHAT) && a.SAME(b))) } multi sub infix:(Blob:D \a, Blob:D \b) { ORDER(a.COMPARE(b)) } multi sub infix: (Blob:D \a, Blob:D \b) { a =:= b || a.SAME(b) } multi sub infix: (Blob:D \a, Blob:D \b) { !(a =:= b || a.SAME(b)) } multi sub infix: (Blob:D \a, Blob:D \b) { a.COMPARE(b) == -1 } multi sub infix: (Blob:D \a, Blob:D \b) { a.COMPARE(b) == 1 } multi sub infix: (Blob:D \a, Blob:D \b) { a.COMPARE(b) != 1 } multi sub infix: (Blob:D \a, Blob:D \b) { a.COMPARE(b) != -1 } proto sub subbuf-rw(|) {*} multi sub subbuf-rw(Buf:D \b) is rw { b.subbuf-rw(0, b.elems); } multi sub subbuf-rw(Buf:D \b, Int() $from) is rw { b.subbuf-rw($from, b.elems - $from) } multi sub subbuf-rw(Buf:D \b, $from, $elems) is rw { b.subbuf-rw($from, $elems) } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Callable.pm60000644000175000017500000000032613253717231015467 0ustar alexalexmy class X::Cannot::Capture { ... } my role Callable[::T = Mu] { method of() { T } method returns() { T } method Capture() { die X::Cannot::Capture.new: :what(self) } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CallFrame.pm60000644000175000017500000000360013253717231015614 0ustar alexalexmy class CallFrame { has $.annotations; has $.my; method SET-SELF(\level, Mu \ctx is raw, Mu \bt is raw) { nqp::stmts( (my int $i = nqp::add_i(level,1)), ($!annotations := nqp::atkey( nqp::atpos(nqp::getattr(bt,List,'$!reified'),$i), 'annotations' )), (my $ctx := ctx), nqp::while( nqp::isgt_i(($i = nqp::sub_i($i,1)),0), nqp::ifnull( ($ctx := nqp::ctxcaller($ctx)), fail "No callframe at level {level}" ) ), ($!my := nqp::p6bindattrinvres(nqp::create(Stash),Map,'$!storage',$ctx)), self ) } only method new(CallFrame: Int:D $level = 0) { # MUST BE AN only nqp::create(CallFrame).SET-SELF( # wrt to backtrace levels $level, nqp::ctxcaller(nqp::ctx), nqp::backtrace(nqp::handle(nqp::die(''),'CATCH',nqp::exception)) ) } method line() { nqp::atkey($!annotations,'line') } method file() { nqp::atkey($!annotations,'file') } method code() { my \vm-code = nqp::ctxcode(nqp::getattr($!my,Map,'$!storage')); nqp::isnull(vm-code) ?? Nil !! nqp::getcodeobj(vm-code) } method callframe(Int:D $?) { X::NYI.new(feature => 'Callframe.callframe').throw; } multi method gist(CallFrame:D:) { nqp::atkey($!annotations,'file') ~ ' at line ' ~ nqp::atkey($!annotations,'line') } method annotations() { nqp::p6bindattrinvres(nqp::create(Map),Map,'$!storage',$!annotations) } } only sub callframe(Int:D $level = 0) { # MUST BE an only wrt to backtrace levels nqp::create(CallFrame).SET-SELF( $level, nqp::ctxcaller(nqp::ctx), nqp::backtrace(nqp::handle(nqp::die(''),'CATCH',nqp::exception)) ) } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Cancellation.pm60000644000175000017500000000075213253717231016367 0ustar alexalexmy class Cancellation { has $.cancelled; has $!lock; has @!async_handles; submethod BUILD(:@!async_handles --> Nil) { $!cancelled = False; $!lock = Lock.new; } method cancel() { $!lock.protect({ unless $!cancelled { for @!async_handles { nqp::cancel(nqp::decont($_)); } $!cancelled = True; } }) } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Capture.pm60000644000175000017500000001215013253717231015371 0ustar alexalexmy class Capture { # declared in BOOTSTRAP # class Capture is Any # has @!list; # positional parameters # has %!hash; # named parameters method from-args(|c) { c } submethod BUILD(:@list, :%hash --> Nil) { @list.elems; # force reification of all nqp::bindattr(self, Capture, '@!list', nqp::getattr(nqp::decont(@list.list), List, '$!reified') ); nqp::bindattr(self,Capture,'%!hash', nqp::getattr(nqp::decont(%hash),Map,'$!storage')) if nqp::attrinited(nqp::decont(%hash),Map,'$!storage') } multi method WHICH (Capture:D:) { my $WHICH = nqp::istype(self.WHAT,Capture) ?? 'Capture' !! self.^name; if !nqp::isnull(@!list) && @!list { $WHICH ~= '|'; for nqp::hllize(@!list) -> \elem { $WHICH ~= ( '(' ~ elem.VAR.WHICH ~ ')' ) } } if !nqp::isnull(%!hash) && %!hash { $WHICH ~= '|'; $WHICH ~= ( $_ ~ '(' ~ nqp::atkey(%!hash, nqp::unbox_s($_)).WHICH ~ ')' ) for nqp::hllize(%!hash).keys.sort; } $WHICH; } multi method AT-KEY(Capture:D: Str:D \key) is raw { nqp::ifnull(nqp::atkey(%!hash,nqp::unbox_s(key)), Nil) } multi method AT-KEY(Capture:D: \key) is raw { nqp::ifnull(nqp::atkey(%!hash,nqp::unbox_s(key.Str)), Nil) } multi method AT-POS(Capture:D: int \pos) is raw { nqp::islt_i(pos,0) ?? Failure.new(X::OutOfRange.new( :what($*INDEX // 'Index'),:got(pos),:range<0..^Inf>)) !! nqp::ifnull(nqp::atpos(@!list,pos),Nil) } multi method AT-POS(Capture:D: Int:D \pos) is raw { my int $pos = nqp::unbox_i(pos); nqp::islt_i($pos,0) ?? Failure.new(X::OutOfRange.new( :what($*INDEX // 'Index'),:got(pos),:range<0..^Inf>)) !! nqp::ifnull(nqp::atpos(@!list,$pos),Nil) } method hash(Capture:D:) { nqp::if( (nqp::defined(%!hash) && nqp::elems(%!hash)), nqp::p6bindattrinvres(nqp::create(Map),Map,'$!storage',%!hash), nqp::create(Map) ) } multi method EXISTS-KEY(Capture:D: Str:D \key ) { nqp::p6bool(nqp::existskey(%!hash, nqp::unbox_s(key))); } multi method EXISTS-KEY(Capture:D: \key ) { nqp::p6bool(nqp::existskey(%!hash, nqp::unbox_s(key.Str))); } method list(Capture:D:) { nqp::if( (nqp::defined(@!list) && nqp::elems(@!list)), nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',@!list), nqp::create(List) ) } method elems(Capture:D:) { nqp::isnull(@!list) ?? 0 !! nqp::p6box_i(nqp::elems(@!list)) } multi method Str(Capture:D:) { my Mu $str := nqp::list_s(); if @!list { my Mu $iter := nqp::iterator(@!list); nqp::push_s($str, nqp::unbox_s(nqp::shift($iter).Str)) while $iter; } if %!hash { my Mu $iter := nqp::iterator(%!hash); while $iter { my $kv := nqp::shift($iter); nqp::push_s($str, nqp::unbox_s((nqp::p6box_s(nqp::iterkey_s($kv)) => nqp::iterval($kv).Str).Str)); } } nqp::p6box_s(nqp::join(' ', $str)) } multi method gist(Capture:D:) { self.Capture::perl } multi method perl(Capture:D:) { my %hash := self.Capture::hash; if self.^name eq 'Capture' { "\\({ join ', ', ((nqp::atpos(@!list, $_).perl for ^nqp::elems(@!list)) if @!list), %hash.sort.map( *.perl ) })"; } else { self.^name ~ '.new(' ~ ( 'list => (' ~ (nqp::atpos(@!list, $_).perl for ^nqp::elems(@!list)).join(', ') ~ ',)' if @!list) ~ (', ' if +@!list and +%hash) ~ ( 'hash => {' ~ %hash.sort.map( *.perl ).join(', ') ~ '}' if +%hash) ~ ')'; } } multi method Bool(Capture:D:) { nqp::p6bool( nqp::elems(@!list) || nqp::elems(%!hash) ) } method Capture(Capture:D:) { self } multi method Numeric(Capture:D:) { self.Capture::elems } method FLATTENABLE_LIST() { @!list ?? @!list !! nqp::list() } method FLATTENABLE_HASH() { %!hash ?? %!hash !! nqp::hash() } multi method keys(Capture:D:) { (self.Capture::list.keys, self.Capture::hash.keys).flat; } multi method kv(Capture:D:) { (self.Capture::list.kv, self.Capture::hash.kv).flat; } multi method values(Capture:D:) { (self.Capture::list.values, self.Capture::hash.values).flat; } multi method pairs(Capture:D:) { (self.Capture::list.pairs, self.Capture::hash.pairs).flat; } multi method antipairs(Capture:D:) { (self.Capture::list.antipairs, self.Capture::hash.antipairs).flat; } } multi sub infix:(Capture:D \a, Capture:D \b) { nqp::p6bool( nqp::eqaddr(a,b) || (nqp::eqaddr(a.WHAT,b.WHAT) && a.Capture::list eqv b.Capture::list && a.Capture::hash eqv b.Capture::hash) ) } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Channel.pm60000644000175000017500000002224013253717231015337 0ustar alexalex# A channel provides a thread-safe way to send a series of values from some # producer(s) to some consumer(s). my class X::Channel::SendOnClosed is Exception { has $.channel; method message() { "Cannot send a message on a closed channel" } } my class X::Channel::ReceiveOnClosed is Exception { has $.channel; method message() { "Cannot receive a message on a closed channel" } } my class Channel does Awaitable { # The queue of events moving through the channel. my class Queue is repr('ConcBlockingQueue') { } has $!queue; # Promise that is triggered when all values are received, or an error is # received and the channel is thus closed. has $!closed_promise; # Closed promise's vow. has $!closed_promise_vow; # Flag for if the channel is closed to senders. has $!closed; # We use a Supplier to send async notifications that there may be a new # message to read from the channel (there may be many things competing # over them). has $!async-notify; # Magical objects for various ways a channel can end. my class CHANNEL_CLOSE { } my class CHANNEL_FAIL { has $.error } submethod BUILD(--> Nil) { $!queue := nqp::create(Queue); $!closed_promise = Promise.new; $!closed_promise_vow = $!closed_promise.vow; $!async-notify = Supplier.new; } method send(Channel:D: \item) { X::Channel::SendOnClosed.new(channel => self).throw if $!closed; nqp::push($!queue, nqp::decont(item)); $!async-notify.emit(True); Nil } method receive(Channel:D:) { nqp::if( nqp::istype((my \msg := nqp::shift($!queue)),CHANNEL_CLOSE), nqp::stmts( nqp::push($!queue, msg), # make sure other readers see it $!closed_promise_vow.keep(Nil), X::Channel::ReceiveOnClosed.new(channel => self).throw ), nqp::if( nqp::istype(msg,CHANNEL_FAIL), nqp::stmts( nqp::push($!queue,msg), # make sure other readers see it $!closed_promise_vow.break(my $error := msg.error), $error.rethrow ), msg ) ) } method receive-nil-on-close(Channel:D:) { nqp::if( nqp::istype((my \msg := nqp::shift($!queue)),CHANNEL_CLOSE), nqp::stmts( nqp::push($!queue, msg), # make sure other readers see it $!closed_promise_vow.keep(Nil), Nil ), nqp::if( nqp::istype(msg,CHANNEL_FAIL), nqp::stmts( nqp::push($!queue,msg), # make sure other readers see it $!closed_promise_vow.break(my $error := msg.error), $error.rethrow ), msg ) ) } method poll(Channel:D:) { nqp::if( nqp::isnull(my \msg := nqp::queuepoll($!queue)), Nil, nqp::if( nqp::istype(msg, CHANNEL_CLOSE), nqp::stmts( $!closed_promise_vow.keep(Nil), Nil ), nqp::if( nqp::istype(msg, CHANNEL_FAIL), nqp::stmts( $!closed_promise_vow.break(msg.error), Nil ), msg ) ) ) } method !peek(Channel:D:) { my \msg := nqp::atpos($!queue, 0); if nqp::isnull(msg) { Nil } else { if nqp::istype(msg, CHANNEL_CLOSE) { $!closed_promise_vow.keep(Nil); Nil } elsif nqp::istype(msg, CHANNEL_FAIL) { $!closed_promise_vow.break(msg.error); Nil } else { msg } } } method Capture(Channel:D:) { self.List.Capture } multi method Supply(Channel:D:) { supply { # Tap the async notification for new values supply. whenever $!async-notify.unsanitized-supply.schedule-on($*SCHEDULER) { my Mu \got = self.poll; if nqp::eqaddr(got, Nil) { if $!closed_promise { $!closed_promise.status == Kept ?? done() !! die $!closed_promise.cause } } else { emit got; } } # Grab anything that's in the channel and emit it. Note that # it's important to do this after tapping the supply, or a # value sent between us draining it and doing the tap would # not result in a notification, and so we'd not emit it on # the supply. This lost event can then cause a deadlock. loop { my Mu \got = self.poll; last if nqp::eqaddr(got, Nil); emit got; } self!peek(); if $!closed_promise { $!closed_promise.status == Kept ?? done() !! die $!closed_promise.cause } } } method iterator(Channel:D:) { class :: does Iterator { has $!channel; method !SET-SELF($!channel) { self } method new(\c) { nqp::create(self)!SET-SELF(c) } method pull-one() { my Mu \got = $!channel.receive-nil-on-close; nqp::eqaddr(got, Nil) ?? IterationEnd !! got } }.new(self) } method list(Channel:D:) { self.Seq.list } my class ChannelAwaitableHandle does Awaitable::Handle { has $!channel; has $!closed_promise; has $!async-notify; method not-ready(Channel:D $channel, Promise:D $closed_promise, Supplier:D $async-notify) { nqp::create(self)!not-ready($channel, $closed_promise, $async-notify) } method !not-ready($channel, $closed_promise, $async-notify) { $!already = False; $!channel := $channel; $!closed_promise := $closed_promise; $!async-notify := $async-notify; self } method subscribe-awaiter(&subscriber --> Nil) { # Need some care here to avoid a race. We must tap the notification # supply first, and then do an immediate poll after it, just to be # sure we won't miss notifications between the two. Also, we need # to take some care that we never call subscriber twice. my $notified := False; my $l := Lock.new; my $t; $l.protect: { # Lock ensures $t will be assigned before we run the logic # inside of poll-now, which relies on being able to do # $t.close. $t := $!async-notify.unsanitized-supply.tap: &poll-now; } poll-now(); sub poll-now($discard?) { $l.protect: { unless $notified { my \maybe = $!channel.poll; if maybe === Nil { if $!closed_promise.status == Kept { $notified := True; subscriber(False, X::Channel::ReceiveOnClosed.new(:$!channel)) } elsif $!closed_promise.status == Broken { $notified := True; subscriber(False, $!closed_promise.cause) } } else { $notified := True; subscriber(True, maybe); } $t.close if $notified; } } } } } method get-await-handle(--> Awaitable::Handle:D) { my \maybe = self.poll; if maybe === Nil { if $!closed_promise { ChannelAwaitableHandle.already-failure( $!closed_promise.status == Kept ?? X::Channel::ReceiveOnClosed.new(channel => self) !! $!closed_promise.cause ) } else { ChannelAwaitableHandle.not-ready(self, $!closed_promise, $!async-notify) } } else { ChannelAwaitableHandle.already-success(maybe) } } method close() { $!closed = 1; nqp::push($!queue, CHANNEL_CLOSE); # if $!queue is otherwise empty, make sure that $!closed_promise # learns about the new value self!peek(); $!async-notify.emit(True); Nil } method elems() { Failure.new("Cannot determine number of elements on a {self.^name}") } method fail($error is copy) { $!closed = 1; $error = X::AdHoc.new(payload => $error) unless nqp::istype($error, Exception); nqp::push($!queue, CHANNEL_FAIL.new(:$error)); $!async-notify.emit(True); Nil } method closed() { self!peek(); $!closed_promise } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Code.pm60000644000175000017500000000264413253717231014647 0ustar alexalexmy class Code does Callable { # declared in BOOTSTRAP # class Code is Any # has Code $!do; # Low level code object # has Signature $!signature; # Signature object # has @!compstuff; # Place for the compiler to hang stuff multi method ACCEPTS(Code:D $self: Mu $topic is raw) { $self.count ?? $self($topic) !! $self() } method arity(Code:D:) { nqp::getattr_i($!signature,Signature,'$!arity') } method count(Code:D:) { nqp::getattr($!signature,Signature,'$!count') } method signature(Code:D:) { $!signature } proto method prec(|) {*} multi method prec() { my % } multi method prec(Str:D $) { '' } multi method Str(Code:D:) { warn( self.WHAT.perl ~ " object coerced to string (please use .gist or .perl to do that)"); self.name } method outer(Code:D:) { nqp::ifnull(nqp::getcodeobj(nqp::p6staticouter($!do)), Mu) } # returns an identifier for this code object # that is the same even for cloned closures method static_id(Code:D:) { nqp::p6box_i(nqp::where(nqp::getstaticcode($!do))); } multi method new(Code:) { X::Cannot::New.new(class => self).throw } method file(Code:D:) { nqp::getcodelocation($!do); } method line(Code:D:) { nqp::getcodelocation($!do); } multi method perl(Code:D:) { '{ ... }' } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Collation.pm60000644000175000017500000000344313253717231015717 0ustar alexalexclass Collation { has int $.collation-level = 85; has $!Country = 'International'; method gist { "collation-level => $!collation-level, Country => $!Country, " ~ "Language => None, primary => {self.primary}, secondary => {self.secondary}, " ~ "tertiary => {self.tertiary}, quaternary => {self.quaternary}" } method set ( Int :$primary = 1, Int :$secondary = 1, Int :$tertiary = 1, Int :$quaternary = 1) { nqp::isnull(nqp::getlexcaller('EXPERIMENTAL-COLLATION')) and X::Experimental.new( feature => 'the $*COLLATION dynamic variable', use => 'collation' ).throw; my int $i = 0; $i += 1 if $primary.sign == 1; $i += 2 if $primary.sign == -1; $i += 4 if $secondary.sign == 1; $i += 8 if $secondary.sign == -1; $i += 16 if $tertiary.sign == 1; $i += 32 if $tertiary.sign == -1; $i += 64 if $quaternary.sign == 1; $i += 128 if $quaternary.sign == -1; $!collation-level = $i; self; } method check ($more, $less) { # Hopefully the user didn't set collation-level manually to have a level # both enabled *and* disabled. But check if this is the case anyway. return 0 if $!collation-level +& all($more,$less); return 1 if $!collation-level +& $more; return -1 if $!collation-level +& $less; return 0; } method primary { self.check( 1, 2) } method secondary { self.check( 4, 8) } method tertiary { self.check(16, 32) } method quaternary { self.check(64, 128) } } Rakudo::Internals.REGISTER-DYNAMIC: '$*COLLATION', { PROCESS::<$COLLATION> := Collation.new; } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Compiler.pm60000644000175000017500000000543013253717231015543 0ustar alexalexclass Compiler does Systemic { has Str $.id; has Str $.release; has Str $!build-date; has Str $.codename; BEGIN my $id = $*W.handle.Str ~ '.' ~ nqp::time_n(); submethod BUILD ( :$!name = 'rakudo', :$!auth = 'The Perl Foundation', :$version, :$release, :$build-date, :$codename --> Nil ) { # XXX Various issues with this stuff on JVM my Mu $compiler := nqp::getcurhllsym('$COMPILER_CONFIG'); $!id = nqp::p6box_s(nqp::ifnull(nqp::atkey($compiler,'id'),$id)); # looks like: 2018.01-50-g8afd791c1 $!version = $version // Version.new(nqp::atkey($compiler, 'version')); $!release = $release // nqp::p6box_s(nqp::atkey($compiler, 'release-number')); $!build-date = $build-date // nqp::p6box_s(nqp::atkey($compiler, 'build-date')); $!codename = $codename // nqp::p6box_s(nqp::atkey($compiler, 'codename')); } method build-date() { DateTime.new($!build-date) } method verbose-config(:$say) { my $compiler := nqp::getcomp("perl6"); my $backend := $compiler.backend; my $name := $backend.name; my $items := nqp::list_s; nqp::push_s($items,$name ~ '::' ~ .key ~ '=' ~ .value) for $backend.config; my $language := $compiler.language; nqp::push_s($items,$language ~ '::' ~ .key ~ '=' ~ .value) for $compiler.config; nqp::push_s( $items, 'repo::chain=' ~ (try $*REPO.repo-chain.map( *.gist ).join(" ")) // '' ); nqp::push_s($items,"distro::$_={ $*DISTRO."$_"() // '' }") for ; nqp::push_s($items,"kernel::$_={ $*KERNEL."$_"() // '' }") for ; try { require System::Info; my $sysinfo = System::Info.new; nqp::push_s($items,"sysinfo::{ .name }={ $sysinfo.$_ // '' }") for $sysinfo.^methods.grep: { .count == 1 && .name ne 'new' }; } my str $string = nqp::join("\n",Rakudo::Sorting.MERGESORT-str($items)); if $say { nqp::say($string); Nil } else { my %config; my $iter := nqp::iterator($items); while $iter { my ($main,$key,$value) = nqp::shift($iter).split(<:: =>); %config.AT-KEY($main).AT-KEY($key) = $value } %config but role { has $!string = $string; proto method Str() { $!string } proto method gist() { $!string } } } } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Complex.pm60000644000175000017500000003430113253717231015377 0ustar alexalexmy class X::Numeric::Real { ... }; my class Complex is Cool does Numeric { has num $.re; has num $.im; method !SET-SELF(Num() \re, Num() \im) { $!re = re; $!im = im; self } proto method new(|) {*} multi method new() { self.new: 0, 0 } multi method new(Real \re, Real \im) { nqp::create(self)!SET-SELF(re, im) } multi method WHICH(Complex:D:) { nqp::box_s( nqp::concat( nqp::if( nqp::eqaddr(self.WHAT,Complex), 'Complex|', nqp::concat(nqp::unbox_s(self.^name), '|') ), nqp::concat($!re, nqp::concat('|', $!im)) ), ValueObjAt ) } method reals(Complex:D:) { (self.re, self.im); } method isNaN(Complex:D:) { self.re.isNaN || self.im.isNaN; } method coerce-to-real(Complex:D: $exception-target) { $!im ≅ 0e0 ?? $!re !! Failure.new(X::Numeric::Real.new(target => $exception-target, reason => "imaginary part not zero", source => self)) } multi method Real(Complex:D:) { self.coerce-to-real(Real); } # should probably be eventually supplied by role Numeric method Num(Complex:D:) { self.coerce-to-real(Num).Num; } method Int(Complex:D:) { self.coerce-to-real(Int).Int; } method Rat(Complex:D: $epsilon?) { self.coerce-to-real(Rat).Rat( |($epsilon // Empty) ); } method FatRat(Complex:D: $epsilon?) { self.coerce-to-real(FatRat).FatRat( |($epsilon // Empty) ); } multi method Bool(Complex:D:) { $!re != 0e0 || $!im != 0e0; } method Complex() { self } multi method Str(Complex:D:) { nqp::concat( $!re, nqp::concat( nqp::if(nqp::iseq_i(nqp::ord($!im),45),'','+'), nqp::concat( $!im, nqp::if(nqp::isnanorinf($!im),'\\i','i') ) ) ) } multi method perl(Complex:D:) { '<' ~ self.Str ~ '>'; } method conj(Complex:D:) { Complex.new($.re, -$.im); } method abs(Complex $x:) { nqp::p6box_n(nqp::sqrt_n( nqp::add_n( nqp::mul_n($!re, $!re), nqp::mul_n($!im, $!im), ) )) } method polar() { $.abs, $!im.atan2($!re); } multi method log(Complex:D:) { my Num ($mag, $angle) = self.polar; Complex.new($mag.log, $angle); } method cis(Complex:D:) { self.cos + self.sin*Complex.new(0,1) } method sqrt(Complex:D:) { my Num $abs = self.abs; my Num $re = (($abs + self.re)/2).sqrt; my Num $im = (($abs - self.re)/2).sqrt; Complex.new($re, self.im < 0 ?? -$im !! $im); } multi method exp(Complex:D:) { my Num $mag = $!re.exp; Complex.new($mag * $!im.cos, $mag * $!im.sin); } method roots(Complex:D: Int() $n) { return NaN if $n < 1; return self if $n == 1; for $!re, $!im { return NaN if $_ eq 'Inf' || $_ eq '-Inf' || $_ eq 'NaN'; } my ($mag, $angle) = self.polar; $mag **= 1e0 / $n; (^$n).map: { $mag.unpolar( ($angle + $_ * 2e0 * pi) / $n) }; } method sin(Complex:D:) { $!re.sin * $!im.cosh + ($!re.cos * $!im.sinh)i; } method asin(Complex:D:) { (Complex.new(0e0, -1e0) * log((self)i + sqrt(1e0 - self * self))); } method cos(Complex:D:) { $!re.cos * $!im.cosh - ($!re.sin * $!im.sinh)i; } method acos(Complex:D:) { (pi / 2e0) - self.asin; } method tan(Complex:D:) { self.sin / self.cos; } method atan(Complex:D:) { ((log(1e0 - (self)i) - log(1e0 + (self)i))i / 2e0); } method sec(Complex:D:) { 1e0 / self.cos; } method asec(Complex:D:) { (1e0 / self).acos; } method cosec(Complex:D:) { 1e0 / self.sin; } method acosec(Complex:D:) { (1e0 / self).asin; } method cotan(Complex:D:) { self.cos / self.sin; } method acotan(Complex:D:) { (1e0 / self).atan; } method sinh(Complex:D:) { -((Complex.new(0e0, 1e0) * self).sin)i; } method asinh(Complex:D:) { (self + sqrt(1e0 + self * self)).log; } method cosh(Complex:D:) { (Complex.new(0e0, 1e0) * self).cos; } method acosh(Complex:D:) { (self + sqrt(self * self - 1e0)).log; } method tanh(Complex:D:) { -((Complex.new(0e0, 1e0) * self).tan)i; } method atanh(Complex:D:) { (((1e0 + self) / (1e0 - self)).log / 2e0); } method sech(Complex:D:) { 1e0 / self.cosh; } method asech(Complex:D:) { (1e0 / self).acosh; } method cosech(Complex:D:) { 1e0 / self.sinh; } method acosech(Complex:D:) { (1e0 / self).asinh; } method cotanh(Complex:D:) { 1e0 / self.tanh; } method acotanh(Complex:D:) { (1e0 / self).atanh; } method floor(Complex:D:) { Complex.new( self.re.floor, self.im.floor ); } method ceiling(Complex:D:) { Complex.new( self.re.ceiling, self.im.ceiling ); } proto method round(|) {*} multi method round(Complex:D:) { Complex.new( self.re.round, self.im.round ); } multi method round(Complex:D: Real() $scale) { Complex.new( self.re.round($scale), self.im.round($scale) ); } method truncate(Complex:D:) { Complex.new( self.re.truncate, self.im.truncate ); } method narrow(Complex:D:) { self == 0e0 ?? 0 !! $!re == 0e0 ?? self !! $!im / $!re ≅ 0e0 ?? $!re.narrow !! self; } } multi sub prefix:<->(Complex:D \a --> Complex:D) { my $new := nqp::create(Complex); nqp::bindattr_n( $new, Complex, '$!re', nqp::neg_n( nqp::getattr_n(nqp::decont(a), Complex, '$!re') ) ); nqp::bindattr_n( $new, Complex, '$!im', nqp::neg_n( nqp::getattr_n(nqp::decont(a), Complex, '$!im') ) ); $new; } multi sub abs(Complex:D \a --> Num:D) { my num $re = nqp::getattr_n(nqp::decont(a), Complex, '$!re'); my num $im = nqp::getattr_n(nqp::decont(a), Complex, '$!im'); nqp::p6box_n(nqp::sqrt_n(nqp::add_n(nqp::mul_n($re, $re), nqp::mul_n($im, $im)))); } multi sub infix:<+>(Complex:D \a, Complex:D \b --> Complex:D) { my $new := nqp::create(Complex); nqp::bindattr_n( $new, Complex, '$!re', nqp::add_n( nqp::getattr_n(nqp::decont(a), Complex, '$!re'), nqp::getattr_n(nqp::decont(b), Complex, '$!re'), ) ); nqp::bindattr_n( $new, Complex, '$!im', nqp::add_n( nqp::getattr_n(nqp::decont(a), Complex, '$!im'), nqp::getattr_n(nqp::decont(b), Complex, '$!im'), ) ); $new; } multi sub infix:<+>(Complex:D \a, Num(Real) \b --> Complex:D) { my $new := nqp::create(Complex); nqp::bindattr_n( $new, Complex, '$!re', nqp::add_n( nqp::getattr_n(nqp::decont(a), Complex, '$!re'), nqp::unbox_n(b) ) ); nqp::bindattr_n($new, Complex, '$!im', nqp::getattr_n(nqp::decont(a), Complex, '$!im'), ); $new } multi sub infix:<+>(Num(Real) \a, Complex:D \b --> Complex:D) { my $new := nqp::create(Complex); nqp::bindattr_n($new, Complex, '$!re', nqp::add_n( nqp::unbox_n(a), nqp::getattr_n(nqp::decont(b), Complex, '$!re'), ) ); nqp::bindattr_n($new, Complex, '$!im', nqp::getattr_n(nqp::decont(b), Complex, '$!im'), ); $new; } multi sub infix:<->(Complex:D \a, Complex:D \b --> Complex:D) { my $new := nqp::create(Complex); nqp::bindattr_n( $new, Complex, '$!re', nqp::sub_n( nqp::getattr_n(nqp::decont(a), Complex, '$!re'), nqp::getattr_n(nqp::decont(b), Complex, '$!re'), ) ); nqp::bindattr_n($new, Complex, '$!im', nqp::sub_n( nqp::getattr_n(nqp::decont(a), Complex, '$!im'), nqp::getattr_n(nqp::decont(b), Complex, '$!im'), ) ); $new } multi sub infix:<->(Complex:D \a, Num(Real) \b --> Complex:D) { my $new := nqp::create(Complex); nqp::bindattr_n( $new, Complex, '$!re', nqp::sub_n( nqp::getattr_n(nqp::decont(a), Complex, '$!re'), b, ) ); nqp::bindattr_n($new, Complex, '$!im', nqp::getattr_n(nqp::decont(a), Complex, '$!im') ); $new } multi sub infix:<->(Num(Real) \a, Complex:D \b --> Complex:D) { my $new := nqp::create(Complex); nqp::bindattr_n( $new, Complex, '$!re', nqp::sub_n( a, nqp::getattr_n(nqp::decont(b), Complex, '$!re'), ) ); nqp::bindattr_n($new, Complex, '$!im', nqp::neg_n( nqp::getattr_n(nqp::decont(b), Complex, '$!im') ) ); $new } multi sub infix:<*>(Complex:D \a, Complex:D \b --> Complex:D) { my num $a_re = nqp::getattr_n(nqp::decont(a), Complex, '$!re'); my num $a_im = nqp::getattr_n(nqp::decont(a), Complex, '$!im'); my num $b_re = nqp::getattr_n(nqp::decont(b), Complex, '$!re'); my num $b_im = nqp::getattr_n(nqp::decont(b), Complex, '$!im'); my $new := nqp::create(Complex); nqp::bindattr_n($new, Complex, '$!re', nqp::sub_n(nqp::mul_n($a_re, $b_re), nqp::mul_n($a_im, $b_im)), ); nqp::bindattr_n($new, Complex, '$!im', nqp::add_n(nqp::mul_n($a_re, $b_im), nqp::mul_n($a_im, $b_re)), ); $new; } multi sub infix:<*>(Complex:D \a, Num(Real) \b --> Complex:D) { my $new := nqp::create(Complex); my num $b_num = b; nqp::bindattr_n($new, Complex, '$!re', nqp::mul_n( nqp::getattr_n(nqp::decont(a), Complex, '$!re'), $b_num, ) ); nqp::bindattr_n($new, Complex, '$!im', nqp::mul_n( nqp::getattr_n(nqp::decont(a), Complex, '$!im'), $b_num, ) ); $new } multi sub infix:<*>(Num(Real) \a, Complex:D \b --> Complex:D) { my $new := nqp::create(Complex); my num $a_num = a; nqp::bindattr_n($new, Complex, '$!re', nqp::mul_n( $a_num, nqp::getattr_n(nqp::decont(b), Complex, '$!re'), ) ); nqp::bindattr_n($new, Complex, '$!im', nqp::mul_n( $a_num, nqp::getattr_n(nqp::decont(b), Complex, '$!im'), ) ); $new } multi sub infix:(Complex:D \a, Complex:D \b --> Complex:D) { my num $a_re = nqp::getattr_n(nqp::decont(a), Complex, '$!re'); my num $a_im = nqp::getattr_n(nqp::decont(a), Complex, '$!im'); my num $b_re = nqp::getattr_n(nqp::decont(b), Complex, '$!re'); my num $b_im = nqp::getattr_n(nqp::decont(b), Complex, '$!im'); my num $d = nqp::add_n(nqp::mul_n($b_re, $b_re), nqp::mul_n($b_im, $b_im)); my $new := nqp::create(Complex); nqp::bindattr_n($new, Complex, '$!re', nqp::div_n( nqp::add_n(nqp::mul_n($a_re, $b_re), nqp::mul_n($a_im, $b_im)), $d, ) ); nqp::bindattr_n($new, Complex, '$!im', nqp::div_n( nqp::sub_n(nqp::mul_n($a_im, $b_re), nqp::mul_n($a_re, $b_im)), $d, ) ); $new; } multi sub infix:(Complex:D \a, Real \b --> Complex:D) { Complex.new(a.re / b, a.im / b); } multi sub infix:(Real \a, Complex:D \b --> Complex:D) { Complex.new(a, 0e0) / b; } multi sub infix:<**>(Complex:D \a, Complex:D \b --> Complex:D) { (a.re == 0e0 && a.im == 0e0) ?? ( b.re == 0e0 && b.im == 0e0 ?? Complex.new(1e0, 0e0) !! Complex.new(0e0, 0e0) ) !! (b * a.log).exp } multi sub infix:<**>(Num(Real) \a, Complex:D \b --> Complex:D) { a == 0e0 ?? ( b.re == 0e0 && b.im == 0e0 ?? Complex.new(1e0, 0e0) !! Complex.new(0e0, 0e0) ) !! (b * a.log).exp } multi sub infix:<**>(Complex:D \a, Num(Real) \b --> Complex:D) { b == 0e0 ?? Complex.new(1e0, 0e0) !! (b * a.log).exp } multi sub infix:<==>(Complex:D \a, Complex:D \b --> Bool:D) { a.re == b.re && a.im == b.im } multi sub infix:<==>(Complex:D \a, Num(Real) \b --> Bool:D) { a.re == b && a.im == 0e0 } multi sub infix:<==>(Num(Real) \a, Complex:D \b --> Bool:D) { a == b.re && 0e0 == b.im } multi sub infix:<===>(Complex:D \a, Complex:D \b --> Bool:D) { a.WHAT =:= b.WHAT && a.re === b.re && a.im === b.im } multi sub infix:<≅>(Complex:D \a, Complex:D \b --> Bool:D) { a.re ≅ b.re && a.im ≅ b.im || a <=> b =:= Same } multi sub infix:<≅>(Complex:D \a, Num(Real) \b --> Bool:D) { a ≅ b.Complex } multi sub infix:<≅>(Num(Real) \a, Complex:D \b --> Bool:D) { a.Complex ≅ b } # Meaningful only for sorting purposes, of course. # We delegate to Real::cmp rather than <=> because parts might be NaN. multi sub infix:(Complex:D \a, Complex:D \b --> Order:D) { a.re cmp b.re || a.im cmp b.im } multi sub infix:(Num(Real) \a, Complex:D \b --> Order:D) { a cmp b.re || 0 cmp b.im } multi sub infix:(Complex:D \a, Num(Real) \b --> Order:D) { a.re cmp b || a.im cmp 0 } multi sub infix:«<=>»(Complex:D \a, Complex:D \b --> Order:D) { my $tolerance = a && b ?? (a.re.abs + b.re.abs) / 2 * $*TOLERANCE # Scale slop to average real parts. !! $*TOLERANCE; # Don't want tolerance 0 if either arg is 0. # Fail unless imaginary parts are relatively negligible, compared to real parts. infix:<≅>(a.im, 0e0, :$tolerance) && infix:<≅>(b.im, 0e0, :$tolerance) ?? a.re <=> b.re !! Failure.new(X::Numeric::Real.new(target => Real, reason => "Complex is not numerically orderable", source => "Complex")) } multi sub infix:«<=>»(Num(Real) \a, Complex:D \b --> Order:D) { a.Complex <=> b } multi sub infix:«<=>»(Complex:D \a, Num(Real) \b --> Order:D) { a <=> b.Complex } proto sub postfix:(\a --> Complex:D) is pure {*} multi sub postfix:(Real \a --> Complex:D) { Complex.new(0e0, a); } multi sub postfix:(Complex:D \a --> Complex:D) { Complex.new(-a.im, a.re) } multi sub postfix:(Numeric \a --> Complex:D) { a * Complex.new(0e0, 1e0) } multi sub postfix:(Cool \a --> Complex:D) { a.Numeric * Complex.new(0e0, 1e0) } constant i = Complex.new(0e0, 1e0); # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/DependencySpecification.pm60000644000175000017500000000113413253717231022303 0ustar alexalexclass CompUnit::DependencySpecification { has str $.short-name is required; has int $.source-line-number = 0; has str $.from = 'Perl6'; has $.version-matcher = True; has $.auth-matcher = True; has $.api-matcher = True; method Str(CompUnit::DependencySpecification:D:) { join '', $.short-name, ($.version-matcher//True) ~~ Bool ?? '' !! ":ver<$.version-matcher>", ($.auth-matcher //True) ~~ Bool ?? '' !! ":auth<$.auth-matcher>", ($.api-matcher //True) ~~ Bool ?? '' !! ":api<$.api-matcher>"; } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Handle.pm60000644000175000017500000000467313253717231016732 0ustar alexalexclass CompUnit::Handle { has Mu $!module_ctx; has Mu $!unit; multi submethod new() { nqp::create(self) } method ctxsave() { $!module_ctx := nqp::ctxcaller(nqp::ctx()) unless $!module_ctx; } multi submethod new(Mu \module_ctx) { nqp::p6bindattrinvres( nqp::create(self),CompUnit::Handle,'$!module_ctx', module_ctx ) } submethod from-unit(Stash $unit) { nqp::p6bindattrinvres( nqp::create(self),CompUnit::Handle,'$!unit',nqp::decont($unit) ) } # If the compilation unit has a callable EXPORT subroutine, it will # be returned here. Nil otherwise. method export-sub(--> Callable:D) { my $module := self.unit; $module && nqp::existskey($module, '&EXPORT') ?? nqp::atkey($module, '&EXPORT') !! Nil } # The EXPORT package from the UNIT of the compilation unit; a # Nil if none method export-package(--> Stash:D) { my $module := self.unit; if $module and nqp::existskey($module, 'EXPORT') { my $EXPORT := nqp::atkey($module, 'EXPORT'); nqp::istype($EXPORT.WHO, Stash) ?? $EXPORT.WHO !! nqp::p6bindattrinvres(nqp::create(Stash), Map, '$!storage', $EXPORT.WHO); } else { Nil } } # The EXPORTHOW package from the UNIT of the compilation unit; # Nil if none. method export-how-package(--> Stash:D) { my $module := self.unit; if $module and nqp::existskey($module, 'EXPORTHOW') { my $EXPORTHOW := nqp::atkey($module, 'EXPORTHOW'); my $who := $EXPORTHOW.WHO; nqp::istype($who, Stash) ?? $who !! nqp::p6bindattrinvres(nqp::create(Stash), Map, '$!storage', $who); } else { Nil } } # The GLOBALish package from the UNIT of the compilation unit # (the module's contributions to GLOBAL, for merging); # Nil if none. method globalish-package() { # returns Stash { nqp::if( nqp::defined($!module_ctx), nqp::ifnull(nqp::atkey(nqp::ctxlexpad($!module_ctx),'GLOBALish').WHO, Nil), nqp::if(nqp::defined($!unit), $!unit, Nil) ) } method unit() { nqp::defined($!unit) ?? $!unit !! nqp::defined($!module_ctx) ?? nqp::ctxlexpad($!module_ctx) !! {} } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Loader.pm60000644000175000017500000000426213253717231016737 0ustar alexalexclass CompUnit::Loader is repr('Uninstantiable') { # Load a file from source and compile it method load-source-file(IO::Path $path --> CompUnit::Handle) { # Get the compiler and compile the code, then run it # (which runs the mainline and captures UNIT). my $?FILES := $path.Str; self.load-source($path.slurp(:bin)) } # Decode the specified byte buffer as source code, and compile it method load-source(Blob:D $bytes --> CompUnit::Handle:D) { my $preserve_global := nqp::ifnull(nqp::gethllsym('perl6', 'GLOBAL'), Mu); my $handle := CompUnit::Handle.new; my $*CTXSAVE := $handle; my $eval := nqp::getcomp('perl6').compile($bytes.decode); $eval(); nqp::bindhllsym('perl6', 'GLOBAL', $preserve_global); CATCH { default { nqp::bindhllsym('perl6', 'GLOBAL', $preserve_global); .throw; } } $handle } # Load a pre-compiled file proto method load-precompilation-file(|) {*} multi method load-precompilation-file(IO::Path $path --> CompUnit::Handle:D) { my $handle := CompUnit::Handle.new; my $*CTXSAVE := $handle; my %*COMPILING := nqp::hash(); nqp::loadbytecode($path.Str); $handle } multi method load-precompilation-file(IO::Handle $file --> CompUnit::Handle:D) { my $handle := CompUnit::Handle.new; my $*CTXSAVE := $handle; my %*COMPILING := nqp::hash(); #?if moar # Switch file handle to binary mode before passing it off to the VM, # so we don't lose things hanging around in the decoder. $file.encoding(Nil); nqp::loadbytecodefh(nqp::getattr($file, IO::Handle, '$!PIO'), $file.path.Str); #?endif $handle } # Load the specified byte buffer as if it was the contents of a # precompiled file method load-precompilation(Blob:D $bytes --> CompUnit::Handle:D) { my $handle := CompUnit::Handle.new; my $*CTXSAVE := $handle; my %*COMPILING := nqp::hash(); nqp::loadbytecodebuffer($bytes); $handle } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit.pm60000644000175000017500000000317313253717231015531 0ustar alexalexclass CompUnit { has Str $.from; has Str $.short-name; has Version $.version; has Str $.auth; has Str $!WHICH; # The CompUnit::Repository that loaded this CompUnit. has CompUnit::Repository $.repo is required; # That repository's identifier for the compilation unit. This is not globally unique. has Str:D $.repo-id is required; # The low-level handle. has CompUnit::Handle $.handle is required; # Whether the module was loaded from a precompilation or not. has Bool $.precompiled = False; # The distribution that this compilation unit was installed as part of # (if known). has Distribution $.distribution; my $default-from = 'Perl6'; method new(CompUnit:U: Str :$short-name is copy, Version :$version, Str :$auth, Str :$from = $default-from, CompUnit::Handle :$handle = CompUnit::Handle, CompUnit::Repository :$repo, Str :$repo-id, Bool :$precompiled = False, Distribution :$distribution, ) { self.bless( :$short-name, :$version, :$auth, :$from, :$handle, :$repo, :$repo-id, :$precompiled, :$distribution, ); } multi method WHICH(CompUnit:D:) { $!WHICH //= self.^name } multi method Str(CompUnit:D: --> Str:D) { $!short-name } multi method gist(CompUnit:D: --> Str:D) { self.short-name } method unit() { $.handle.unit } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/PrecompilationRepository.pm60000644000175000017500000003002613253717231022613 0ustar alexalex{ role CompUnit::PrecompilationRepository { method try-load( CompUnit::PrecompilationDependency::File $dependency, IO::Path :$source, CompUnit::PrecompilationStore :@precomp-stores, --> CompUnit::Handle:D) { Nil } method load(CompUnit::PrecompilationId $id --> Nil) { } method may-precomp(--> Bool:D) { True # would be a good place to check an environment variable } } } BEGIN CompUnit::PrecompilationRepository:: := CompUnit::PrecompilationRepository.new; class CompUnit { ... } class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationRepository { has CompUnit::PrecompilationStore $.store; my %loaded; my $loaded-lock = Lock.new; my $first-repo-id; my $lle; my $profile; my $optimize; method try-load( CompUnit::PrecompilationDependency::File $dependency, IO::Path :$source = $dependency.src.IO, CompUnit::PrecompilationStore :@precomp-stores = Array[CompUnit::PrecompilationStore].new($.store), --> CompUnit::Handle:D) { my $RMD = $*RAKUDO_MODULE_DEBUG; my $id = $dependency.id; $RMD("try-load $id: $source") if $RMD; # Even if we may no longer precompile, we should use already loaded files $loaded-lock.protect: { return %loaded{$id} if %loaded{$id}:exists; } my ($handle, $checksum) = ( self.may-precomp and ( my $loaded = self.load($id, :source($source), :checksum($dependency.checksum), :@precomp-stores) # already precompiled? or self.precompile($source, $id, :source-name($dependency.source-name), :force($loaded ~~ Failure)) and self.load($id, :@precomp-stores) # if not do it now ) ); if $*W and $*W.record_precompilation_dependencies { if $handle { $dependency.checksum = $checksum; say $dependency.serialize; } else { nqp::exit(0); } } $handle ?? $handle !! Nil } method !load-handle-for-path(CompUnit::PrecompilationUnit $unit) { my $preserve_global := nqp::ifnull(nqp::gethllsym('perl6', 'GLOBAL'), Mu); if $*RAKUDO_MODULE_DEBUG -> $RMD { $RMD("Loading precompiled\n$unit") } #?if moar my $handle := CompUnit::Loader.load-precompilation-file($unit.bytecode-handle); $unit.close; #?endif #?if !moar my $handle := CompUnit::Loader.load-precompilation($unit.bytecode); #?endif nqp::bindhllsym('perl6', 'GLOBAL', $preserve_global); CATCH { default { nqp::bindhllsym('perl6', 'GLOBAL', $preserve_global); .throw; } } $handle } method !load-file( CompUnit::PrecompilationStore @precomp-stores, CompUnit::PrecompilationId $id, :$repo-id, ) { my $compiler-id = CompUnit::PrecompilationId.new-without-check($*PERL.compiler.id); my $RMD = $*RAKUDO_MODULE_DEBUG; for @precomp-stores -> $store { $RMD("Trying to load {$id ~ ($repo-id ?? '.repo-id' !! '')} from $store.prefix()") if $RMD; my $file = $repo-id ?? $store.load-repo-id($compiler-id, $id) !! $store.load-unit($compiler-id, $id); return $file if $file; } Nil } method !load-dependencies(CompUnit::PrecompilationUnit:D $precomp-unit, @precomp-stores) { my $compiler-id = CompUnit::PrecompilationId.new-without-check($*PERL.compiler.id); my $RMD = $*RAKUDO_MODULE_DEBUG; my $resolve = False; my $repo = $*REPO; $first-repo-id //= $repo.id; my $repo-id = self!load-file(@precomp-stores, $precomp-unit.id, :repo-id); if $repo-id ne $repo.id { $RMD("Repo changed: $repo-id ne {$repo.id}. Need to re-check dependencies.") if $RMD; $resolve = True; } if $repo-id ne $first-repo-id { $RMD("Repo chain changed: $repo-id ne {$first-repo-id}. Need to re-check dependencies.") if $RMD; $resolve = True; } $resolve = False unless %*ENV // 1; my @dependencies; for $precomp-unit.dependencies -> $dependency { $RMD("dependency: $dependency") if $RMD; if $resolve { my $comp-unit = $repo.resolve($dependency.spec); $RMD("Old id: $dependency.id(), new id: {$comp-unit.repo-id}") if $RMD; return False unless $comp-unit and $comp-unit.repo-id eq $dependency.id; } my $dependency-precomp = @precomp-stores .map({ $_.load-unit($compiler-id, $dependency.id) }) .first(*.defined) or do { $RMD("Could not find $dependency.spec()") if $RMD; return False; } unless $dependency-precomp.is-up-to-date($dependency, :check-source($resolve)) { $dependency-precomp.close; return False; } @dependencies.push: $dependency-precomp; } $loaded-lock.protect: { for @dependencies -> $dependency-precomp { unless %loaded{$dependency-precomp.id}:exists { %loaded{$dependency-precomp.id} = self!load-handle-for-path($dependency-precomp); } } } # report back id and source location of dependency to dependant if $*W and $*W.record_precompilation_dependencies { for $precomp-unit.dependencies -> $dependency { say $dependency.serialize; } } if $resolve { self.store.store-repo-id($compiler-id, $precomp-unit.id, :repo-id($repo.id)); } True } proto method load(|) {*} multi method load( Str $id, Instant :$since, IO::Path :$source, CompUnit::PrecompilationStore :@precomp-stores = Array[CompUnit::PrecompilationStore].new($.store), ) { self.load(CompUnit::PrecompilationId.new($id), :$since, :@precomp-stores) } multi method load( CompUnit::PrecompilationId $id, IO::Path :$source, Str :$checksum is copy, Instant :$since, CompUnit::PrecompilationStore :@precomp-stores = Array[CompUnit::PrecompilationStore].new($.store), ) { $loaded-lock.protect: { return %loaded{$id} if %loaded{$id}:exists; } my $RMD = $*RAKUDO_MODULE_DEBUG; my $compiler-id = CompUnit::PrecompilationId.new-without-check($*PERL.compiler.id); my $unit = self!load-file(@precomp-stores, $id); if $unit { if (not $since or $unit.modified > $since) and (not $source or ($checksum //= nqp::sha1($source.slurp(:enc))) eq $unit.source-checksum) and self!load-dependencies($unit, @precomp-stores) { my \loaded = self!load-handle-for-path($unit); $loaded-lock.protect: { %loaded{$id} = loaded }; return (loaded, $unit.checksum); } else { $RMD("Outdated precompiled {$unit}{$source ?? " for $source" !! ''}\n" ~ " mtime: {$unit.modified}{$since ?? ", since: $since" !! ''}\n" ~ " checksum: {$unit.source-checksum}, expected: $checksum") if $RMD; $unit.close; fail "Outdated precompiled $unit"; } } Nil } proto method precompile(|) {*} multi method precompile( IO::Path:D $path, Str $id, Bool :$force = False, :$source-name = $path.Str ) { self.precompile($path, CompUnit::PrecompilationId.new($id), :$force, :$source-name) } multi method precompile( IO::Path:D $path, CompUnit::PrecompilationId $id, Bool :$force = False, :$source-name = $path.Str ) { my $compiler-id = CompUnit::PrecompilationId.new-without-check($*PERL.compiler.id); my $io = self.store.destination($compiler-id, $id); return False unless $io; my $RMD = $*RAKUDO_MODULE_DEBUG; if not $force and $io.e and $io.s { $RMD("$source-name\nalready precompiled into\n$io") if $RMD; self.store.unlock; return True; } my $source-checksum = nqp::sha1($path.slurp(:enc)); my $bc = "$io.bc".IO; $lle //= Rakudo::Internals.LL-EXCEPTION; $profile //= Rakudo::Internals.PROFILE; $optimize //= Rakudo::Internals.OPTIMIZE; my %env = %*ENV; # Local copy for us to tweak %env = $*REPO.repo-chain.map(*.path-spec).join(','); my $rakudo_precomp_loading = %env; my $modules = $rakudo_precomp_loading ?? Rakudo::Internals::JSON.from-json: $rakudo_precomp_loading !! []; die "Circular module loading detected trying to precompile $path" if $modules.Set{$path.Str}:exists; %env = Rakudo::Internals::JSON.to-json: [|$modules, $path.Str]; %env = $*RESOURCES ?? $*RESOURCES.Str !! '{}'; $RMD("Precompiling $path into $bc ($lle $profile $optimize)") if $RMD; my $perl6 = $*EXECUTABLE .subst('perl6-debug', 'perl6') # debugger would try to precompile it's UI .subst('perl6-gdb', 'perl6') .subst('perl6-jdb-server', 'perl6-j') ; if %env { $perl6.subst-mutate('perl6-j', 'perl6-jdb-server'); note "starting jdb on port " ~ ++%env; } my $out = ''; my $err = ''; my $status; react { my $proc = Proc::Async.new( $perl6, $lle, $profile, $optimize, "--target=" ~ Rakudo::Internals.PRECOMP-TARGET, "--output=$bc", "--source-name=$source-name", $path ); whenever $proc.stdout { $out ~= $_ } unless $RMD { whenever $proc.stderr { $err ~= $_ } } whenever $proc.start(ENV => %env) { $status = .exitcode } } my @result = $out.lines.unique; if $status { # something wrong self.store.unlock; $RMD("Precompiling $path failed: $status") if $RMD; Rakudo::Internals.VERBATIM-EXCEPTION(1); die $RMD ?? @result !! $err; } if not $RMD and $err -> $warnings { $*ERR.print($warnings); } unless $bc.e { $RMD("$path aborted precompilation without failure") if $RMD; self.store.unlock; return False; } $RMD("Precompiled $path into $bc") if $RMD; my str $dependencies = ''; my CompUnit::PrecompilationDependency::File @dependencies; my %dependencies; for @result -> $dependency-str { unless $dependency-str ~~ /^<[A..Z0..9]> ** 40 \0 .+/ { say $dependency-str; next } my $dependency = CompUnit::PrecompilationDependency::File.deserialize($dependency-str); next if %dependencies{$dependency.Str}++; # already got that one $RMD($dependency.Str()) if $RMD; @dependencies.push: $dependency; } $RMD("Writing dependencies and byte code to $io.tmp for source checksum: $source-checksum") if $RMD; self.store.store-unit( $compiler-id, $id, self.store.new-unit(:$id, :@dependencies, :$source-checksum, :bytecode($bc.slurp(:bin))), ); $bc.unlink; self.store.store-repo-id($compiler-id, $id, :repo-id($*REPO.id)); self.store.unlock; True } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/PrecompilationStore/File.pm60000644000175000017500000001757413253717231022424 0ustar alexalexclass CompUnit::PrecompilationStore::File does CompUnit::PrecompilationStore { my class CompUnit::PrecompilationUnit::File does CompUnit::PrecompilationUnit { has CompUnit::PrecompilationId $.id; has IO::Path $.path; has IO::Handle $!file; has CompUnit::PrecompilationDependency @!dependencies; has $!initialized = False; has $.checksum; has $.source-checksum; has $!bytecode; has $!store; has Lock $!update-lock = Lock.new; submethod BUILD( CompUnit::PrecompilationId :$!id, IO::Path :$!path, :$!source-checksum, :@!dependencies, :$!bytecode, :$!store, --> Nil ) { if $!bytecode { $!initialized = True; $!checksum = nqp::sha1($!bytecode.decode('iso-8859-1')); } } method !open() { $!file = $!path.open(:r); } method modified(--> Instant:D) { $!path.modified } method !read-dependencies() { $!update-lock.protect: { return if $!initialized; self!open(:r) unless $!file; $!checksum = $!file.get; $!source-checksum = $!file.get; my $dependency = $!file.get; while $dependency { @!dependencies.push: CompUnit::PrecompilationDependency::File.deserialize($dependency); $dependency = $!file.get; } $!initialized = True; } } method dependencies(--> Array[CompUnit::PrecompilationDependency]) { self!read-dependencies; @!dependencies } method bytecode(--> Buf:D) { $!update-lock.protect: { self!read-dependencies; $!bytecode //= $!file.slurp-rest(:bin,:close) } } method bytecode-handle(--> IO::Handle:D) { self!read-dependencies; $!file } method source-checksum() is rw { self!read-dependencies; $!source-checksum } method checksum() is rw { self!read-dependencies; $!checksum } method Str(--> Str:D) { self.path.Str } method close(--> Nil) { $!update-lock.protect: { $!file.close if $!file; $!file = Nil; } } method save-to(IO::Path $precomp-file) { my $handle = $precomp-file.open(:w); $handle.print($!checksum ~ "\n"); $handle.print($!source-checksum ~ "\n"); $handle.print($_.serialize ~ "\n") for @!dependencies; $handle.print("\n"); $handle.write($!bytecode); $handle.close; $!path = $precomp-file; } method is-up-to-date(CompUnit::PrecompilationDependency $dependency, Bool :$check-source --> Bool) { my $result = self.CompUnit::PrecompilationUnit::is-up-to-date($dependency, :$check-source); $!store.remove-from-cache($.id) unless $result; $result } } has IO::Path $.prefix is required; has IO::Handle $!lock; has int $!lock-count = 0; has %!loaded; has %!compiler-cache; has %!dir-cache; has Lock $!update-lock = Lock.new; submethod BUILD(IO::Path :$!prefix --> Nil) { } method new-unit(|c) { CompUnit::PrecompilationUnit::File.new(|c, :store(self)) } method !dir(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id) { $!update-lock.protect: { %!dir-cache{$compiler-id ~ $precomp-id} //= (%!compiler-cache{$compiler-id} //= self.prefix.add($compiler-id)) .add($precomp-id.substr(0, 2)) } } method path(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id, Str :$extension = '') { self!dir($compiler-id, $precomp-id).add($precomp-id ~ $extension) } method !lock(--> Nil) { return if $*W && $*W.is_precompilation_mode(); $!update-lock.lock; $!lock //= $.prefix.add('.lock').open(:create, :rw); $!lock.lock if $!lock-count++ == 0; } method unlock() { return if $*W && $*W.is_precompilation_mode(); { LEAVE $!update-lock.unlock; die "unlock when we're not locked!" if $!lock-count == 0; $!lock-count-- if $!lock-count > 0; $!lock && $!lock-count == 0 ?? $!lock.unlock !! True } } method load-unit(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id) { $!update-lock.protect: { %!loaded{$precomp-id} //= do { my $path = self.path($compiler-id, $precomp-id); $path ~~ :e ?? CompUnit::PrecompilationUnit::File.new(:id($precomp-id), :$path, :store(self)) !! Nil } } } method load-repo-id(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id) { my $path = self.path($compiler-id, $precomp-id, :extension<.repo-id>); if $path ~~ :e { $path.slurp } else { Nil } } method remove-from-cache(CompUnit::PrecompilationId $precomp-id) { $!update-lock.protect: { %!loaded{$precomp-id}:delete }; } method destination(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id, Str :$extension = '' --> IO::Path:D) { unless $!prefix.e { $!prefix.mkdir or return; } return unless $!prefix.w; self!lock(); self!file($compiler-id, $precomp-id, :$extension); } method !file(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id, Str :$extension = '' --> IO::Path:D) { my $compiler-dir = self.prefix.add($compiler-id); $compiler-dir.mkdir unless $compiler-dir.e; my $dest = self!dir($compiler-id, $precomp-id); $dest.mkdir unless $dest.e; $dest.add($precomp-id ~ $extension) } method store-file(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id, IO::Path:D $path, :$extension = '') { $path.rename(self!file($compiler-id, $precomp-id, :$extension)); } method store-unit(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id, CompUnit::PrecompilationUnit $unit) { my $precomp-file = self!file($compiler-id, $precomp-id, :extension<.tmp>); $unit.save-to($precomp-file); $precomp-file.rename(self!file($compiler-id, $precomp-id)); self.remove-from-cache($precomp-id); } method store-repo-id(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id, :$repo-id!) { try self!file($compiler-id, $precomp-id, :extension<.repo-id>).spurt($repo-id); } method delete( CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id, Str :$extension = '') { self.path($compiler-id, $precomp-id, :$extension).unlink; } method delete-by-compiler(CompUnit::PrecompilationId $compiler-id) { my $compiler-dir = self.prefix.add($compiler-id); for $compiler-dir.dir -> $subdir { $subdir.dir>>.unlink; $subdir.rmdir; } $compiler-dir.rmdir; } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/PrecompilationStore.pm60000644000175000017500000000362013253717231021530 0ustar alexalexrole CompUnit::PrecompilationStore { # Prepare a new implementation specific PrecompilationUnit for storage method new-unit(| --> CompUnit::PrecompilationUnit:D) { ... } # Load the precompilation identified by the pairing of the specified # compiler and precompilation ID. method load-unit(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id) { ... } # Return the repository id for which the specified precomp file's # dependencies have been validated method load-repo-id(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id) { ... } # Store the file at the specified path in the precompilation store, # under the given compiler ID and precompilation ID. method store-file(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id, IO::Path:D $path, :$extension = '') { ... } # Store the given precompilation unit in the precompilation store # under the given compiler ID and precompilation ID. method store-unit(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id, CompUnit::PrecompilationUnit $unit) { ... } # Store the given repo-id for a precompilation under the given # compiler ID and precompilation ID. method store-repo-id(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id, :$repo-id!) { ... } # Delete an individual precompilation. method delete(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id) { ... } # Delete all precompilations for a particular compiler. method delete-by-compiler(CompUnit::PrecompilationId $compiler-id) { ... } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/PrecompilationUnit.pm60000644000175000017500000001067713253717231021365 0ustar alexalexclass CompUnit::PrecompilationId { has $.id; my $cache-lock = Lock.new; my %cache; method new(Str:D $id) { $cache-lock.protect: { %cache{$id} //= 2 < $id.chars < 64 && $id ~~ /^<[A..Za..z0..9._-]>+$/ ?? self.bless(:$id) !! die "Invalid precompilation id: $id" } } method new-from-string(Str:D $id) { $cache-lock.protect: { %cache{$id} //= self.bless(:id(nqp::sha1($id))) } } method new-without-check(Str:D $id) { $cache-lock.protect: { %cache{$id} //= self.bless(:id($id)) } } method Str() { $!id } method IO() { $!id.IO } method substr(|c) { $!id.substr(|c) } } role CompUnit::PrecompilationDependency { method id(--> CompUnit::PrecompilationId:D) { ... } method src(--> Str:D) { ... } method spec(--> CompUnit::DependencySpecification:D) { ... } method checksum(--> Str:D) { ... } method Str() { "$.id $.src $.spec" } method serialize(--> Str:D) { ... } method deserialize(Str, --> CompUnit::PrecompilationDependency:D) { ... } } role CompUnit::PrecompilationUnit { method id(--> CompUnit::PrecompilationId:D) { ... } method path(--> IO::Path:D) { ... } method modified(--> Instant:D) { ... } method dependencies(--> Array[CompUnit::PrecompilationDependency]) { ... } method bytecode(--> Buf:D) { ... } method checksum(--> Str:D) { ... } method source-checksum(--> Str:D) { ... } method bytecode-handle(--> IO::Handle:D) { ... } method close(--> Nil) { ... } method is-up-to-date(CompUnit::PrecompilationDependency $dependency, Bool :$check-source --> Bool) { my $RMD = $*RAKUDO_MODULE_DEBUG; if $check-source { # a repo changed, so maybe it's a change in our source file my $source-checksum = $.source-checksum; my $srcIO = CompUnit::RepositoryRegistry.file-for-spec($dependency.src) // $dependency.src.IO; unless $srcIO { return False unless $srcIO.e; } my $current-source-checksum := nqp::sha1($srcIO.slurp(:enc)); $RMD( "$.path\nspec: $dependency.spec()\nsource: $srcIO\n" ~ "source-checksum: $source-checksum\ncurrent-source-checksum: $current-source-checksum" ) if $RMD; return False if $source-checksum ne $current-source-checksum; } $RMD("dependency checksum $dependency.checksum() unit: $.checksum()") if $RMD; $.checksum eq $dependency.checksum } } class CompUnit::PrecompilationDependency::File does CompUnit::PrecompilationDependency { has CompUnit::PrecompilationId $.id; has Str $.src; has Str $.checksum is rw; has Str $!serialized-spec; has CompUnit::DependencySpecification $.spec; method source-name() { "$.src ($.spec.short-name())" } method deserialize(str $str) { my $parts := nqp::split("\0", $str); nqp::p6bindattrinvres( self.new( :id(CompUnit::PrecompilationId.new-without-check(nqp::atpos($parts, 0))), :src(nqp::atpos($parts, 1)), :checksum(nqp::atpos($parts, 2)) ), CompUnit::PrecompilationDependency::File, '$!serialized-spec', nqp::atpos($parts, 3), ); } method spec(--> CompUnit::DependencySpecification:D) { $!spec //= $!serialized-spec ?? do { #?if jvm my @spec = $!serialized-spec.split("\0", 3); my @spec-pairs; for @spec>>.match(/(<-[:]>+)':'(.+)/) { @spec-pairs.push: .[0].Str => (.[1] ~~ / ^ \d+ $ / ?? .[1].Int !! .[1].Str); } CompUnit::DependencySpecification.new: |%(|@spec-pairs); #?endif #?if moar use MONKEY-SEE-NO-EVAL; EVAL $!serialized-spec; #?endif } !! Nil; } method serialize(--> Str:D) { #?if jvm my $specs; for $.spec.^attributes { $specs ~= .name.substr(2) ~ ":" ~ $.spec."$(.name.substr(2))"() ~ "\0"; } "$.id\0$.src\0$.checksum\0$specs" #?endif #?if !jvm "$.id\0$.src\0$.checksum\0{$!serialized-spec ?? $!serialized-spec !! $!spec.perl}" #?endif } method Str() { "$.id $.src $.checksum {$!serialized-spec ?? $!serialized-spec !! $!spec.perl}" } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Repository/AbsolutePath.pm60000644000175000017500000000303013253717231022273 0ustar alexalexclass CompUnit::Repository::AbsolutePath does CompUnit::Repository { has %!loaded; method need(CompUnit::DependencySpecification $spec, CompUnit::PrecompilationRepository $precomp = self.precomp-repository() --> CompUnit:D) { return self.next-repo.need($spec, $precomp) if self.next-repo; X::CompUnit::UnsatisfiedDependency.new(:specification($spec)).throw; } method load(IO::Path:D $file --> CompUnit:D) { if $file.is-absolute { # We have a $file when we hit: require "PATH" or use/require Foo:file; my $precompiled = $file.Str.ends-with(Rakudo::Internals.PRECOMP-EXT); if $file.f { return %!loaded{$file} = CompUnit.new( :handle( $precompiled ?? CompUnit::Loader.load-precompilation-file($file) !! CompUnit::Loader.load-source-file($file) ), :short-name($file.Str), :repo(self), :repo-id($file.Str), :$precompiled, ); } } return self.next-repo.load($file) if self.next-repo; die("Could not find $file in:\n" ~ $*REPO.repo-chain.map(*.Str).join("\n").indent(4)); } method loaded(--> Iterable:D) { return %!loaded.values; } method id() { 'ap' } method path-spec() { 'ap#' } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Repository/FileSystem.pm60000644000175000017500000001720713253717231021777 0ustar alexalexclass CompUnit::Repository::FileSystem does CompUnit::Repository::Locally does CompUnit::Repository { has %!loaded; has $!precomp; has $!id; has %!meta; has $!precomp-stores; has $!precomp-store; my @extensions = ; my $extensions := nqp::hash('pm6',1,'pm',1); # global cache of files seen my %seen; method !matching-file(CompUnit::DependencySpecification $spec) { if $spec.from eq 'Perl6' { my $name = $spec.short-name; return %!loaded{$name} if %!loaded{$name}:exists; my $base := $!prefix.add($name.subst(:g, "::", $*SPEC.dir-sep) ~ '.').Str; return $base if %seen{$base}:exists; my $found; # find source file # pick a META6.json if it is there if not %!meta and (my $meta = $!prefix.add('META6.json')) and $meta.f { try { %!meta = Rakudo::Internals::JSON.from-json: $meta.slurp; CATCH { when JSONException { fail "Invalid JSON found in META6.json"; } } } } if %!meta { if %!meta{$name} -> $file { my $path = $file.IO.is-absolute ?? $file.IO !! $!prefix.add($file); $found = $path if $path.f; } } unless ?$found { # deduce path to compilation unit from package name for @extensions -> $extension { my $path = ($base ~ $extension).IO; $found = $path if $path.f; last if $found; } } return $base, $found if $found; } False } method !comp-unit-id($name) { CompUnit::PrecompilationId.new-from-string($name); } method id() { my $parts := nqp::list_s; my $prefix = self.prefix; my $dir := { .match(/ ^ <.ident> [ <[ ' - ]> <.ident> ]* $ /) }; # ' hl my $file := -> str $file { nqp::eqat($file,'.pm',nqp::sub_i(nqp::chars($file),3)) || nqp::eqat($file,'.pm6',nqp::sub_i(nqp::chars($file),4)) }; nqp::if( $!id, $!id, ($!id = nqp::if( $prefix.e, nqp::stmts( (my $iter := Rakudo::Internals.DIR-RECURSE( $prefix.absolute,:$dir,:$file).iterator), nqp::until( nqp::eqaddr((my $pulled := $iter.pull-one),IterationEnd), nqp::if( nqp::filereadable($pulled), nqp::push_s($parts,nqp::sha1(slurp($pulled, :enc))), ) ), nqp::if( (my $next := self.next-repo), nqp::push_s($parts,$next.id), ), nqp::sha1(nqp::join('',$parts)) ), nqp::sha1('') )) ) } method resolve(CompUnit::DependencySpecification $spec --> CompUnit:D) { my ($base, $file) = self!matching-file($spec); return CompUnit.new( :short-name($spec.short-name), :repo-id(self!comp-unit-id($spec.short-name).Str), :repo(self) ) if $base; return self.next-repo.resolve($spec) if self.next-repo; Nil } method !precomp-stores() { $!precomp-stores //= Array[CompUnit::PrecompilationStore].new( gather { my $repo = $*REPO; while $repo { my \store = $repo.precomp-store; take store if store.defined; $repo = $repo.next-repo; } } ) } method need( CompUnit::DependencySpecification $spec, CompUnit::PrecompilationRepository $precomp = self.precomp-repository(), CompUnit::PrecompilationStore :@precomp-stores = self!precomp-stores(), --> CompUnit:D) { my ($base, $file) = self!matching-file($spec); if $base { my $name = $spec.short-name; return %!loaded{$name} if %!loaded{$name}:exists; return %seen{$base} if %seen{$base}:exists; my $id = self!comp-unit-id($name); my $*RESOURCES = Distribution::Resources.new(:repo(self), :dist-id('')); my $handle = $precomp.try-load( CompUnit::PrecompilationDependency::File.new( :$id, :src($file.Str), :$spec, ), :@precomp-stores, ); my $precompiled = defined $handle; $handle //= CompUnit::Loader.load-source-file($file); # precomp failed return %!loaded{$name} = %seen{$base} = CompUnit.new( :short-name($name), :$handle, :repo(self), :repo-id($id.Str), :$precompiled, ); } return self.next-repo.need($spec, $precomp, :@precomp-stores) if self.next-repo; X::CompUnit::UnsatisfiedDependency.new(:specification($spec)).throw; } method load(IO::Path:D $file --> CompUnit:D) { unless $file.is-absolute { # We have a $file when we hit: require "PATH" or use/require Foo:file; my $precompiled = $file.Str.ends-with(Rakudo::Internals.PRECOMP-EXT); my $path = $!prefix.add($file); if $path.f { return %!loaded{$file.Str} //= %seen{$path.Str} = CompUnit.new( :handle( $precompiled ?? CompUnit::Loader.load-precompilation-file($path) !! CompUnit::Loader.load-source-file($path) ), :short-name($file.Str), :repo(self), :repo-id($file.Str), :$precompiled, ); } } return self.next-repo.load($file) if self.next-repo; nqp::die("Could not find $file in:\n" ~ $*REPO.repo-chain.map(*.Str).join("\n").indent(4)); } method short-id() { 'file' } method loaded(--> Iterable:D) { return %!loaded.values; } method files($file, :$name, :$auth, :$ver) { my $base := $file.IO; $base.f ?? { files => { $file => $base.path }, ver => Version.new('0') } !! (); } method resource($dist-id, $key) { # We now save the 'resources/' part of a resource's path in files, i.e: # "files" : [ "resources/libraries/xxx" => "resources/libraries/xxx.so" ] # but we also want to root any path request to the CUR's resources directory # When $.prefix points at a directory containing a meta file (eg. -I.) return $.prefix.add( %!meta{$key} ) if %!meta && %!meta{$key}; return $.prefix.add( $key ) if %!meta && %!meta.first({ $_ eq $key.subst(/^resources\//, "") }); # When $.prefix is presumably the 'lib' folder (eg. -Ilib) return $.prefix.parent.add($key); } method precomp-store(--> CompUnit::PrecompilationStore:D) { $!precomp-store //= CompUnit::PrecompilationStore::File.new( :prefix(self.prefix.add('.precomp')), ) } method precomp-repository(--> CompUnit::PrecompilationRepository:D) { $!precomp := CompUnit::PrecompilationRepository::Default.new( :store(self.precomp-store), ) unless $!precomp; $!precomp } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Repository/Installable.pm60000644000175000017500000000072413253717231022141 0ustar alexalexrole CompUnit::Repository::Installable does CompUnit::Repository { # Installs a distribution into the repository. method install(Distribution $dist) { ... } # Returns True if we can install modules (this will typically do a # .w check on the module database). method can-install(--> Bool:D) { ... } # Returns the Distribution objects for all installed distributions. method installed(--> Iterable:D) { } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Repository/Installation.pm60000644000175000017500000005615213253717231022356 0ustar alexalexclass CompUnit::Repository::Installation does CompUnit::Repository::Locally does CompUnit::Repository::Installable { has $!cver = nqp::hllize(nqp::atkey(nqp::gethllsym('perl6', '$COMPILER_CONFIG'), 'version')); has %!loaded; has $!precomp; has $!id; has Int $!version; has %!dist-metas; has $!precomp-stores; has $!precomp-store; my $verbose := nqp::getenvhash; submethod BUILD(:$!prefix, :$!lock, :$!WHICH, :$!next-repo --> Nil) { } my class InstalledDistribution is Distribution::Hash { method content($address) { my $entry = $.meta.values.first: { $_{$address}:exists }; my $file = $entry ?? $.prefix.add('sources').add($entry{$address}) !! $.prefix.add('resources').add($.meta{$address}); $file.open(:r) } } method writeable-path { $.prefix.w ?? $.prefix !! IO::Path; } method !writeable-path { self.can-install ?? $.prefix !! IO::Path; } method can-install() { $.prefix.w || ?(!$.prefix.e && try { $.prefix.mkdir } && $.prefix.e); } my $windows_wrapper = '@rem = \'--*-Perl-*-- @echo off if "%OS%" == "Windows_NT" goto WinNT #perl# "%~dpn0" %1 %2 %3 %4 %5 %6 %7 %8 %9 goto endofperl :WinNT #perl# "%~dpn0" %* if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl if %errorlevel% == 9009 echo You do not have Perl in your PATH. if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul goto endofperl @rem \'; __END__ :endofperl '; my $perl_wrapper = '#!/usr/bin/env #perl# sub MAIN(:$name is copy, :$auth, :$ver, *@, *%) { CompUnit::RepositoryRegistry.run-script("#name#", :dist-name<#dist-name#>, :$name, :$auth, :$ver); }'; method !sources-dir() { my $sources = $.prefix.add('sources'); $sources.mkdir unless $sources.e; $sources } method !resources-dir() { my $resources = $.prefix.add('resources'); $resources.mkdir unless $resources.e; $resources } method !dist-dir() { my $dist = $.prefix.add('dist'); $dist.mkdir unless $dist.e; $dist } method !bin-dir() { my $bin = $.prefix.add('bin'); $bin.mkdir unless $bin.e; $bin } method !add-short-name($name, $dist, $source?, $checksum?) { my $short-dir = $.prefix.add('short'); my $id = nqp::sha1($name); my $lookup = $short-dir.add($id); $lookup.mkdir; $lookup.add($dist.id).spurt( "{$dist.meta // ''}\n" ~ "{$dist.meta // ''}\n" ~ "{$dist.meta // ''}\n" ~ "{$source // ''}\n" ~ "{$checksum // ''}\n" ); } method !remove-dist-from-short-name-lookup-files($dist --> Nil) { my $short-dir = $.prefix.add('short'); return unless $short-dir.e; my $id = $dist.id; for $short-dir.dir -> $dir { $dir.add($id).unlink; $dir.rmdir unless $dir.dir; } } method !file-id(Str $name, Str $dist-id) { my $id = $name ~ $dist-id; nqp::sha1($id) } method name(--> Str:D) { CompUnit::RepositoryRegistry.name-for-repository(self) } method !repo-prefix() { my $repo-prefix = self.name // ''; $repo-prefix ~= '#' if $repo-prefix; $repo-prefix } method !read-dist($id) { my $dist = Rakudo::Internals::JSON.from-json($.prefix.add('dist').add($id).slurp); $dist = $dist ?? Version.new( ~$dist ) !! Version.new('0'); $dist } method !repository-version(--> Int:D) { return $!version if defined $!version; my $version-file = $.prefix.add('version'); return $!version = 0 unless $version-file ~~ :f; $!version = $version-file.slurp.Int } method upgrade-repository() { my $version = self!repository-version; my $short-dir = $.prefix.add('short'); mkdir $short-dir unless $short-dir.e; my $precomp-dir = $.prefix.add('precomp'); mkdir $precomp-dir unless $precomp-dir.e; self!sources-dir; my $resources-dir = self!resources-dir; my $dist-dir = self!dist-dir; self!bin-dir; if ($version < 1) { for $short-dir.dir -> $file { my @ids = $file.lines.unique; $file.unlink; $file.mkdir; for @ids -> $id { my $dist = self!read-dist($id); $file.add($id).spurt("{$dist // ''}\n{$dist // ''}\n{$dist // ''}\n"); } } } if ($version < 2) { for $dist-dir.dir -> $dist-file { my %meta = Rakudo::Internals::JSON.from-json($dist-file.slurp); my $files = %meta //= []; for eager $files.keys -> $file { $files{"resources/$file"} = $files{$file}:delete if $resources-dir.add($files{$file}).e and not $.prefix.add($file).e; # bin/ is already included in the path } $dist-file.spurt: Rakudo::Internals::JSON.to-json(%meta); } } $.prefix.add('version').spurt('2'); $!version = 2; } proto method install(|) {*} multi method install($dist, %sources, %scripts?, %resources?, Bool :$force) { # XXX: Deprecation shim my %files; %files{"bin/$_.key()"} = $_.value for %scripts.pairs; %files{"resources/$_.key()"} = $_.value for %resources.pairs; my %meta6 = %( name => $dist.?name, ver => $dist.?ver // $dist.?version, auth => $dist.?auth // $dist.?authority, provides => %sources, files => %files, ); return samewith(Distribution::Hash.new(%meta6, :prefix($*CWD)), :$force); } multi method install(Distribution $distribution, Bool :$force) { my $dist = CompUnit::Repository::Distribution.new($distribution); my %files = $dist.meta.grep(*.defined).map: -> $link { $link ~~ Str ?? ($link => $link) !! ($link.keys[0] => $link.values[0]) } $!lock.protect( { my @*MODULES; my $path = self!writeable-path or die "No writeable path found, $.prefix not writeable"; my $lock = $.prefix.add('repo.lock').open(:create, :w); $lock.lock; my $version = self!repository-version; self.upgrade-repository unless $version == 2; my $dist-id = $dist.id; my $dist-dir = self!dist-dir; if not $force and $dist-dir.add($dist-id) ~~ :e { $lock.unlock; fail "$dist already installed"; } my $sources-dir = self!sources-dir; my $resources-dir = self!resources-dir; my $bin-dir = self!bin-dir; my $is-win = Rakudo::Internals.IS-WIN; self!add-short-name($dist.meta, $dist); # so scripts can find their dist my %links; # map name-path to new content address my %provides; # meta data gets added, but the format needs to change to # only extend the structure, not change it # the following 3 `for` loops should be a single loop, but has been # left this way due to impeding precomp changes # lib/ source files for $dist.meta.kv -> $name, $file is copy { # $name is "Inline::Perl5" while $file is "lib/Inline/Perl5.pm6" my $id = self!file-id(~$name, $dist-id); my $destination = $sources-dir.add($id); my $handle = $dist.content($file); my $content = $handle.open(:bin).slurp(:close); self!add-short-name($name, $dist, $id, nqp::sha1(nqp::join("\n", nqp::split("\r\n", $content.decode('iso-8859-1'))))); %provides{ $name } = ~$file => { :file($id), :time(try $file.IO.modified.Num), :$!cver }; note("Installing {$name} for {$dist.meta}") if $verbose and $name ne $dist.meta; $destination.spurt($content); } # bin/ scripts for %files.kv -> $name-path, $file is copy { next unless $name-path.starts-with('bin/'); my $id = self!file-id(~$file, $dist-id); my $destination = $resources-dir.add($id); # wrappers are put in bin/; originals in resources/ my $withoutext = $name-path.subst(/\.[exe|bat]$/, ''); for '', '-j', '-m' -> $be { $.prefix.add("$withoutext$be").IO.spurt: $perl_wrapper.subst('#name#', $name-path.IO.basename, :g).subst('#perl#', "perl6$be").subst('#dist-name#', $dist.meta); if $is-win { $.prefix.add("$withoutext$be.bat").IO.spurt: $windows_wrapper.subst('#perl#', "perl6$be", :g); } else { $.prefix.add("$withoutext$be").IO.chmod(0o755); } } self!add-short-name($name-path, $dist, $id); %links{$name-path} = $id; my $handle = $dist.content($file); my $content = $handle.open.slurp-rest(:bin,:close); $destination.spurt($content); $handle.close; } # resources/ for %files.kv -> $name-path, $file is copy { next unless $name-path.starts-with('resources/'); # $name-path is 'resources/libraries/p5helper' while $file is 'resources/libraries/libp5helper.so' my $id = self!file-id(~$name-path, $dist-id) ~ '.' ~ $file.IO.extension; my $destination = $resources-dir.add($id); %links{$name-path} = $id; my $handle = $dist.content($file); my $content = $handle.open.slurp-rest(:bin,:close); $destination.spurt($content); $handle.close; } my %meta = %($dist.meta); %meta = %links; # add our new name-path => conent-id mapping %meta = %provides; # new meta data added to provides %!dist-metas{$dist-id} = %meta; $dist-dir.add($dist-id).spurt: Rakudo::Internals::JSON.to-json(%meta); # reset cached id so it's generated again on next access. # identity changes with every installation of a dist. $!id = Any; { my $head = $*REPO; PROCESS::<$REPO> := self; # Precomp files should only depend on downstream repos my $precomp = $*REPO.precomp-repository; my $repo-prefix = self!repo-prefix; my $*RESOURCES = Distribution::Resources.new(:repo(self), :$dist-id); my %done; my $compiler-id = CompUnit::PrecompilationId.new-without-check($*PERL.compiler.id); for %provides.kv -> $source-name, $source-meta { my $id = CompUnit::PrecompilationId.new-without-check($source-meta.values[0]); $precomp.store.delete($compiler-id, $id); } for %provides.kv -> $source-name, $source-meta { my $id = $source-meta.values[0]; my $source = $sources-dir.add($id); my $source-file = $repo-prefix ?? $repo-prefix ~ $source.relative($.prefix) !! $source; if %done{$id} { note "(Already did $id)" if $verbose; next; } note("Precompiling $id ($source-name)") if $verbose; $precomp.precompile( $source, CompUnit::PrecompilationId.new-without-check($id), :source-name("$source-file ($source-name)"), ); %done{$id} = 1; } PROCESS::<$REPO> := $head; } $lock.unlock; } ) } method uninstall(Distribution $distribution) { my $repo-version = self!repository-version; self.upgrade-repository unless $repo-version == 2; # xxx: currently needs to be passed in a distribution object that # has meta pointing at content-ids, so you cannot yet just # pass in the original meta data and have it discovered and deleted # (i.e. update resolve to return such a ::Installation::Distribution) my $dist = CompUnit::Repository::Distribution.new($distribution); my %provides = $dist.meta; my %files = $dist.meta; my $sources-dir = self.prefix.add('sources'); my $resources-dir = self.prefix.add('resources'); my $bin-dir = self.prefix.add('bin'); my $dist-dir = self.prefix.add('dist'); self!remove-dist-from-short-name-lookup-files($dist); my sub unlink-if-exists($path) { unlink($path) if $path.IO.e } # delete special directory files for %files.kv -> $name-path, $file { given $name-path { when /^bin\/(.*)/ { # wrappers are located in $bin-dir (only delete if no other versions use wrapper) unless self.files($name-path, :name($dist.meta)).elems { unlink-if-exists( $bin-dir.add("$0$_") ) for '', '-m', '-j'; } # original bin scripts are in $resources-dir unlink-if-exists( $resources-dir.add($file) ) } when /^resources\// { unlink-if-exists( $resources-dir.add($file) ) } } } # delete sources unlink-if-exists( $sources-dir.add($_) ) for %provides.values.flatmap(*.values.map(*.)); # delete the meta file unlink( $dist-dir.add($dist.id) ) } method script($file, :$name!, :$auth, :$ver) { my $prefix = self.prefix; my $lookup = $prefix.add('short').add(nqp::sha1($file)); return unless $lookup.e; # Scripts using this interface could only have been installed long after the introduction of # repo version 1, so we don't have to care about very old repos in this method. my @dists = $lookup.dir.map({ my ($ver, $auth, $api, $resource-id) = $_.slurp.split("\n"); $resource-id ||= self!read-dist($_.basename){$file}; (id => $_.basename, ver => Version.new( $ver || 0 ), :$auth, :$api, :$resource-id).hash }).grep({ $_. ~~ $auth and $_. ~~ $ver }); for @dists.sort(*.).reverse { return self!resources-dir.add($_); } } method files($file, :$name!, :$auth, :$ver) { my @candi; my $prefix = self.prefix; my $lookup = $prefix.add('short').add(nqp::sha1($name)); if $lookup.e { my $repo-version = self!repository-version; my @dists = $repo-version < 1 ?? $lookup.lines.unique.map({ self!read-dist($_) }) !! $lookup.dir.map({ my ($ver, $auth, $api) = $_.slurp.split("\n"); (id => $_.basename, ver => Version.new( $ver || 0 ), auth => $auth, api => $api).hash }); for @dists.grep({$_ ~~ $auth and $_ ~~ $ver}) -> $dist is copy { $dist = self!read-dist($dist) if $repo-version >= 1; with $dist{$file} { my $candi = %$dist; $candi{$file} = self!resources-dir.add($candi{$file}); @candi.push: $candi; } } } @candi } method !matching-dist(CompUnit::DependencySpecification $spec) { if $spec.from eq 'Perl6' { my $repo-version = self!repository-version; my $lookup = $.prefix.add('short').add(nqp::sha1($spec.short-name)); if $lookup.e { my @dists = ( $repo-version < 1 ?? $lookup.lines.unique.map({ $_ => self!read-dist($_) }) !! $lookup.dir.map({ my ($ver, $auth, $api, $source, $checksum) = $_.slurp.split("\n"); $_.basename => { ver => Version.new( $ver || 0 ), auth => $auth, api => $api, source => $source || Any, checksum => $checksum || Str, } }) ).grep({ $_.value ~~ $spec.auth-matcher and $_.value ~~ (($spec.version-matcher ~~ Bool) ?? $spec.version-matcher # fast path for matching Version.new(*) !! Version.new($spec.version-matcher)) }); for @dists.sort(*.value).reverse.map(*.kv) -> ($dist-id, $dist) { return ($dist-id, $dist); } } } Nil } method !lazy-distribution($dist-id) { class :: does Distribution::Locally { has $.dist-id; has $.read-dist; has $!installed-dist; method !dist { $!installed-dist //= InstalledDistribution.new($.read-dist()(), :$.prefix) } method meta(--> Hash:D) { self!dist.meta } method content($content-id --> IO::Handle:D) { self!dist.content($content-id) } method Str() { self!dist.Str } }.new( :$dist-id, :read-dist(-> { self!read-dist($dist-id) }) :$.prefix, ) } method resolve( CompUnit::DependencySpecification $spec, --> CompUnit:D) { my ($dist-id, $dist) = self!matching-dist($spec); if $dist-id { # xxx: replace :distribution with meta6 return CompUnit.new( :handle(CompUnit::Handle), :short-name($spec.short-name), :version($dist), :auth($dist // Str), :repo(self), :repo-id($dist // self!read-dist($dist-id){$spec.short-name}.values[0]), :distribution(self!lazy-distribution($dist-id)), ); } return self.next-repo.resolve($spec) if self.next-repo; Nil } method !precomp-stores() { $!precomp-stores //= Array[CompUnit::PrecompilationStore].new( self.repo-chain.map(*.precomp-store).grep(*.defined) ) } method need( CompUnit::DependencySpecification $spec, CompUnit::PrecompilationRepository $precomp = self.precomp-repository(), CompUnit::PrecompilationStore :@precomp-stores = self!precomp-stores(), --> CompUnit:D) { my ($dist-id, $dist) = self!matching-dist($spec); if $dist-id { return %!loaded{~$spec} if %!loaded{~$spec}:exists; my $source-file-name = $dist // do { my $provides = self!read-dist($dist-id); X::CompUnit::UnsatisfiedDependency.new(:specification($spec)).throw unless $provides{$spec.short-name}:exists; $provides{$spec.short-name}.values[0] }; my $loader = $.prefix.add('sources').add($source-file-name); my $*RESOURCES = Distribution::Resources.new(:repo(self), :$dist-id); my $id = $loader.basename; my $repo-prefix = self!repo-prefix; my $handle = $precomp.try-load( CompUnit::PrecompilationDependency::File.new( :id(CompUnit::PrecompilationId.new-without-check($id)), :src($repo-prefix ?? $repo-prefix ~ $loader.relative($.prefix) !! $loader.absolute), :checksum($dist:exists ?? $dist !! Str), :$spec, ), :source($loader), :@precomp-stores, ); my $precompiled = defined $handle; $handle //= CompUnit::Loader.load-source-file($loader); # xxx: replace :distribution with meta6 my $compunit = CompUnit.new( :$handle, :short-name($spec.short-name), :version($dist), :auth($dist // Str), :repo(self), :repo-id($id), :$precompiled, :distribution(self!lazy-distribution($dist-id)), ); return %!loaded{~$spec} = $compunit; } return self.next-repo.need($spec, $precomp, :@precomp-stores) if self.next-repo; X::CompUnit::UnsatisfiedDependency.new(:specification($spec)).throw; } method resource($dist-id, $key) { my $dist = %!dist-metas{$dist-id} //= Rakudo::Internals::JSON.from-json(self!dist-dir.add($dist-id).slurp); # need to strip the leading resources/ on old repositories self!resources-dir.add($dist{$key.substr(self!repository-version < 2 ?? 10 !! 0)}) } method id() { return $!id if $!id; my $name = self.path-spec; $name ~= ',' ~ self.next-repo.id if self.next-repo; my $dist-dir = $.prefix.add('dist'); $!id = nqp::sha1(nqp::sha1($name) ~ ($dist-dir.e ?? $dist-dir.dir !! '')) } method short-id() { 'inst' } method loaded(--> Iterable:D) { return %!loaded.values; } method distribution($id) { InstalledDistribution.new(self!read-dist($id), :prefix(self.prefix)) } method installed(--> Iterable:D) { my $dist-dir = self.prefix.add('dist'); $dist-dir.e ?? $dist-dir.dir.map({ self.distribution($_.basename) }) !! Nil } method precomp-store(--> CompUnit::PrecompilationStore:D) { $!precomp-store //= CompUnit::PrecompilationStore::File.new( :prefix(self.prefix.add('precomp')), ) } method precomp-repository(--> CompUnit::PrecompilationRepository:D) { $!precomp := CompUnit::PrecompilationRepository::Default.new( :store(self.precomp-store), ) unless $!precomp; $!precomp } sub provides-warning($is-win, $name --> Nil) { my ($red,$clear) = Rakudo::Internals.error-rcgye; note "$red==={$clear}WARNING!$red===$clear The distribution $name does not seem to have a \"provides\" section in its META.info file, and so the packages will not be installed in the correct location. Please ask the author to add a \"provides\" section, mapping every exposed namespace to a file location in the distribution. See http://design.perl6.org/S22.html#provides for more information.\n"; } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Repository/Locally.pm60000644000175000017500000000260713253717231021310 0ustar alexalexrole CompUnit::Repository::Locally { has Lock $!lock; has IO::Path $.prefix is required; has Str $.WHICH; method new(CompUnit::Repository::Locally: Str:D :$prefix, CompUnit::Repository :$next-repo, *%args) { my $abspath := $*SPEC.rel2abs($prefix); my $IO := $abspath.IO; state %instances; my $WHICH = self.^name ~ '|' ~ $abspath; %instances{$WHICH} //= self.bless(:prefix($IO), :lock(Lock.new), :$WHICH, :$next-repo, |%args); } multi method Str(CompUnit::Repository::Locally:D:) { $!prefix.absolute } multi method gist(CompUnit::Repository::Locally:D:) { self.path-spec } multi method perl(CompUnit::Repository::Locally:D:) { $?CLASS.perl ~ '.new(prefix => ' ~ $!prefix.absolute.perl ~ ')'; } multi method WHICH(CompUnit::Repository::Locally:D:) { $!WHICH } method path-spec(CompUnit::Repository::Locally:D:) { self.short-id ~ '#' ~ $!prefix.absolute; } method source-file(Str $name --> IO::Path:D) { self.prefix.add($name) } method prefix { "{$!prefix}".IO } method id() { my $name = self.path-spec; $name ~= ',' ~ self.next-repo.id if self.next-repo; return nqp::sha1($name); } # stubs method short-id(CompUnit::Repository::Locally:D:) {...} } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Repository/NQP.pm60000644000175000017500000000170013253717231020340 0ustar alexalexclass CompUnit::Repository::NQP does CompUnit::Repository { method need( CompUnit::DependencySpecification $spec, CompUnit::PrecompilationRepository $precomp = self.precomp-repository(), --> CompUnit:D) { if $spec.from eq 'NQP' { my $nqp := nqp::gethllsym('perl6', 'ModuleLoader'); return CompUnit.new( :short-name($spec.short-name), :handle(CompUnit::Handle.new($nqp.load_module($spec.short-name, {:from}))), :repo(self), :repo-id($spec.short-name), :from($spec.from), ); } return self.next-repo.need($spec, $precomp) if self.next-repo; X::CompUnit::UnsatisfiedDependency.new(:specification($spec)).throw; } method loaded() { [] } method id() { 'NQP' } method path-spec() { 'nqp#' } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Repository/Perl5.pm60000644000175000017500000000267213253717231020702 0ustar alexalexclass CompUnit::Repository::Perl5 does CompUnit::Repository { method need( CompUnit::DependencySpecification $spec, CompUnit::PrecompilationRepository $precomp = self.precomp-repository(), --> CompUnit:D) { if $spec.from eq 'Perl5' { require Inline::Perl5; my $perl5 = ::('Inline::Perl5').default_perl5; if $*RAKUDO_MODULE_DEBUG -> $RMD { $RMD("Loading {$spec.short-name} via Inline::Perl5"); } my $handle := $perl5.require( $spec.short-name, $spec.version-matcher !== True ?? $spec.version-matcher.Num !! Num, :handle ); return CompUnit.new( :short-name($spec.short-name), :$handle, :repo(self), :repo-id($spec.short-name), :from($spec.from), ); CATCH { when X::CompUnit::UnsatisfiedDependency { X::NYI::Available.new(:available('Inline::Perl5'), :feature('Perl 5')).throw; } } } return self.next-repo.need($spec, $precomp) if self.next-repo; X::CompUnit::UnsatisfiedDependency.new(:specification($spec)).throw; } method loaded() { [] } method id() { 'Perl5' } method path-spec() { 'perl5#' } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Repository.pm60000644000175000017500000000411613253717231017706 0ustar alexalexrole CompUnit::Repository { has CompUnit::Repository $.next-repo is rw; # Resolves a dependency specification to a concrete dependency. If the # dependency was not already loaded, loads it. Returns a CompUnit # object that represents the selected dependency. If there is no # matching dependency, throws X::CompUnit::UnsatisfiedDependency. method need(CompUnit::DependencySpecification $spec, # If we're first in the chain, our precomp repo is the chosen one. CompUnit::PrecompilationRepository $precomp = self.precomp-repository(), CompUnit::PrecompilationStore :@precomp-stores = Array[CompUnit::PrecompilationStore].new($precomp.store) --> CompUnit:D) { ... } # Resolves a dependency specification to a concrete dependency. # Returns a CompUnit object that represents the selected dependency. # If there is no matching dependency, Nil is returned. method resolve(CompUnit::DependencySpecification $spec --> CompUnit:D) { self.next-repo ?? self.next-repo.resolve($spec) !! Nil } # Just load the file and return a CompUnit object representing it. method load(IO::Path:D $file --> CompUnit:D) { self.next-repo ?? self.next-repo.load($file) !! nqp::die("Could not find $file in:\n" ~ $*REPO.repo-chain.map(*.Str).join("\n").indent(4)); } # Returns the CompUnit objects describing all of the compilation # units that have been loaded by this repository in the current # process. method loaded(--> Iterable:D) { ... } # Returns a unique ID of this repository method id(--> Str:D) { ... } method precomp-store(--> CompUnit::PrecompilationStore) { CompUnit::PrecompilationStore } method precomp-repository(--> CompUnit::PrecompilationRepository) { CompUnit::PrecompilationRepository::None } method repo-chain() { ($.next-repo and $.next-repo.defined) ?? (self, |$.next-repo.repo-chain()) !! (self, ); } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/RepositoryRegistry.pm60000644000175000017500000003545013253717231021444 0ustar alexalexclass CompUnit::Repository::FileSystem { ... } class CompUnit::Repository::Installation { ... } class CompUnit::Repository::AbsolutePath { ... } class CompUnit::Repository::Unknown { ... } class CompUnit::Repository::NQP { ... } class CompUnit::Repository::Perl5 { ... } #?if jvm class CompUnit::Repository::JavaRuntime { ... } #?endif class CompUnit::RepositoryRegistry { my $lock = Lock.new; my %include-spec2cur; proto method repository-for-spec(|) { * } multi method repository-for-spec(Str $spec, CompUnit::Repository :$next-repo) { self.repository-for-spec(CompUnit::Repository::Spec.from-string($spec), :$next-repo) } multi method repository-for-spec(CompUnit::Repository::Spec $spec, CompUnit::Repository :$next-repo) { my $short-id := $spec.short-id; my %options := $spec.options; my $path := $spec.path; my $class := short-id2class($short-id); return CompUnit::Repository::Unknown.new(:path-spec($spec), :short-name($short-id)) if so $class && nqp::istype($class, Failure) or !nqp::istype($class, CompUnit::Repository); my $abspath = $class.?absolutify($path) // $path; my $id = "$short-id#$abspath"; %options = $next-repo if $next-repo; $lock.protect( { %include-spec2cur{$id}:exists ?? %include-spec2cur{$id} !! (%include-spec2cur{$id} := $class.new(:prefix($abspath), |%options)); } ); } method !register-repository($id, CompUnit::Repository $repo) { $lock.protect( { %include-spec2cur{$id}:exists ?? %include-spec2cur{$id} !! (%include-spec2cur{$id} := $repo); } ); } my $custom-lib := nqp::hash(); method setup-repositories() { my $raw-specs; # only look up environment once my $ENV := nqp::getattr(%*ENV,Map,'$!storage'); # starting up for creating precomp my $precomp-specs = nqp::existskey($ENV,'RAKUDO_PRECOMP_WITH') ?? nqp::atkey($ENV,'RAKUDO_PRECOMP_WITH') !! False; if $precomp-specs { # assume well formed strings $raw-specs := nqp::split(',', $precomp-specs); } # normal start up else { $raw-specs := nqp::list(); for Rakudo::Internals.INCLUDE -> $specs { nqp::push($raw-specs,$_) for parse-include-specS($specs); } if nqp::existskey($ENV,'RAKUDOLIB') { nqp::push($raw-specs,$_) for parse-include-specS(nqp::atkey($ENV,'RAKUDOLIB')); } if nqp::existskey($ENV,'PERL6LIB') { nqp::push($raw-specs,$_) for parse-include-specS(nqp::atkey($ENV,'PERL6LIB')); } } my $prefix := nqp::existskey($ENV,'RAKUDO_PREFIX') ?? nqp::atkey($ENV,'RAKUDO_PREFIX') !! nqp::concat( nqp::atkey(nqp::getcomp('perl6').config,'libdir'), '/perl6' ); # XXX Various issues with this stuff on JVM , TEMPORARY my str $home; try { if nqp::existskey($ENV,'HOME') ?? nqp::atkey($ENV,'HOME') !! nqp::concat( (nqp::existskey($ENV,'HOMEDRIVE') ?? nqp::atkey($ENV,'HOMEDRIVE') !! ''), (nqp::existskey($ENV,'HOMEPATH') ?? nqp::atkey($ENV,'HOMEPATH') !! '') ) -> $home-path { $home = "$home-path/.perl6"; my str $path = "inst#$home"; } } # set up custom libs my str $site = "inst#$prefix/site"; my str $vendor = "inst#$prefix/vendor"; my str $perl = "inst#$prefix"; # your basic repo chain my CompUnit::Repository $next-repo := $precomp-specs ?? CompUnit::Repository !! CompUnit::Repository::AbsolutePath.new( :next-repo( CompUnit::Repository::NQP.new( :next-repo(CompUnit::Repository::Perl5.new( #?if jvm :next-repo(CompUnit::Repository::JavaRuntime.new) #?endif )) ) ) ); # create reverted, unique list of path-specs my $iter := nqp::iterator($raw-specs); my $unique := nqp::hash(); my $specs := nqp::list(); while $iter { my $repo-spec := nqp::shift($iter); my str $path-spec = $repo-spec.Str; unless nqp::existskey($unique,$path-spec) { nqp::bindkey($unique,$path-spec,1); nqp::unshift($specs,$repo-spec); } } unless $precomp-specs { nqp::bindkey($custom-lib, 'perl', $next-repo := self!register-repository( $perl, CompUnit::Repository::Installation.new(:prefix($prefix), :$next-repo) )) unless nqp::existskey($unique, $perl); nqp::bindkey($custom-lib, 'vendor', $next-repo := self!register-repository( $vendor, CompUnit::Repository::Installation.new(:prefix("$prefix/vendor"), :$next-repo) )) unless nqp::existskey($unique, $vendor); nqp::bindkey($custom-lib, 'site', $next-repo := self!register-repository( $site, CompUnit::Repository::Installation.new(:prefix("$prefix/site"), :$next-repo) )) unless nqp::existskey($unique, $site); nqp::bindkey($custom-lib, 'home', $next-repo := self!register-repository( "inst#$home/.perl6", CompUnit::Repository::Installation.new(:prefix($home), :$next-repo) )) if $home and not nqp::existskey($unique, $home); } # convert repo-specs to repos my $repos := nqp::hash(); $iter := nqp::iterator($specs); while $iter { my $spec = nqp::shift($iter); $next-repo := self.use-repository( self.repository-for-spec($spec), :current($next-repo)); nqp::bindkey($repos,$spec.Str,$next-repo); } # register manually set custom-lib repos unless nqp::existskey($custom-lib, 'perl') { my $repo := nqp::atkey($repos, $perl); if nqp::isnull($repo) { nqp::deletekey($custom-lib, 'perl'); } else { nqp::bindkey($custom-lib, 'perl', $repo); } } unless nqp::existskey($custom-lib, 'vendor') { my $repo := nqp::atkey($repos, $vendor); if nqp::isnull($repo) { nqp::deletekey($custom-lib, 'vendor'); } else { nqp::bindkey($custom-lib, 'vendor', $repo); } } unless nqp::existskey($custom-lib, 'site') { my $repo := nqp::atkey($repos, $site); if nqp::isnull($repo) { nqp::deletekey($custom-lib, 'site'); } else { nqp::bindkey($custom-lib, 'site', $repo); } } unless nqp::existskey($custom-lib, 'home') { my $repo := nqp::atkey($repos, $home); if nqp::isnull($repo) { nqp::deletekey($custom-lib, 'home'); } else { nqp::bindkey($custom-lib, 'home', $repo); } } $next-repo } method !remove-from-chain(CompUnit::Repository $repo, CompUnit::Repository :$current = $*REPO) { my $item = $current; while $item { if $item.next-repo === $repo { $item.next-repo = $repo.next-repo; last; } $item = $item.next-repo; } } method use-repository(CompUnit::Repository $repo, CompUnit::Repository :$current = $*REPO) { return $repo if $current === $repo; self!remove-from-chain($repo, :$current); $repo.next-repo = $current; PROCESS::<$REPO> := $repo; } method repository-for-name(Str:D \name) { $*REPO; # initialize if not yet done my str $name = nqp::unbox_s(name); nqp::existskey($custom-lib,$name) ?? nqp::atkey($custom-lib,$name) !! Nil } method register-name($name, CompUnit::Repository $repo) { nqp::bindkey($custom-lib, $name, $repo); } method name-for-repository(CompUnit::Repository $repo) { $*REPO; # initialize if not yet done my $iter := nqp::iterator($custom-lib); while $iter { my \pair = nqp::shift($iter); return nqp::iterkey_s(pair) if nqp::iterval(pair).prefix eq $repo.prefix; } Nil } method file-for-spec(Str $spec) { my @parts = $spec.split('#', 2); if @parts.elems == 2 { my $repo = self.repository-for-name(@parts[0]); return $repo.source-file(@parts[1]) if $repo.can('source-file'); } Nil } method run-script($script, :$dist-name, :$name is copy, :$auth, :$ver) { shift @*ARGS if $name; shift @*ARGS if $auth; shift @*ARGS if $ver; $name //= $dist-name; my @installations = $*REPO.repo-chain.grep(CompUnit::Repository::Installation); my @binaries = @installations.map({ .script("bin/$script", :$name, :$auth, :$ver) }).grep(*.defined); unless +@binaries { @binaries = flat @installations.map: { .script("bin/$script", :$name) }; if +@binaries { note "===SORRY!===\n" ~ "No candidate found for '$script' that match your criteria.\n" ~ "Did you perhaps mean one of these?"; my %caps = :name(['Distribution', 12]), :auth(['Author(ity)', 11]), :ver(['Version', 7]); for @binaries -> $dist { for %caps.kv -> $caption, @opts { @opts[1] = max @opts[1], ($dist{$caption} // '').Str.chars } } note ' ' ~ %caps.values.map({ sprintf('%-*s', .[1], .[0]) }).join(' | '); for @binaries -> $dist { note ' ' ~ %caps.kv.map( -> $k, $v { sprintf('%-*s', $v.[1], $dist{$k} // '') } ).join(' | ') } } else { note "===SORRY!===\nNo candidate found for '$script'.\n"; } exit 1; } my $bin = @binaries[0]; require "$bin"; } method head() { # mostly usefull for access from NQP $*REPO } method resolve-unknown-repos($repo is copy) { # Cannot just use GLOBAL.WHO here as that gives a BOOTHash my $global := nqp::list("GLOBAL"); my $prev-repo; while defined $repo { if nqp::istype($repo, CompUnit::Repository::Unknown) { my $next-repo := $repo.next-repo; my $head := PROCESS<$REPO>; PROCESS::<$REPO> := $next-repo; my $comp_unit = $next-repo.need( CompUnit::DependencySpecification.new(:short-name($repo.short-name)) ); PROCESS::<$REPO> := $head; $*W.find_symbol($global).WHO.merge-symbols($comp_unit.handle.globalish-package); $repo = self.repository-for-spec($repo.path-spec, :$next-repo); if defined $prev-repo { $prev-repo.next-repo = $repo; } else { PROCESS::<$REPO> := nqp::decont($repo); } } $prev-repo = $repo; $repo = $repo.next-repo; } } # Handles any object repossession conflicts that occurred during module load, # or complains about any that cannot be resolved. method resolve_repossession_conflicts(@conflicts) { for @conflicts -> $orig is raw, $current is raw { # If it's a Stash in conflict, we make sure any original entries get # appropriately copied. if $orig.HOW.name($orig) eq 'Stash' { $current.merge-symbols($orig); } # We could complain about anything else, and may in the future; for # now, we let it pass by with "latest wins" semantics. } } sub short-id2class(Str:D $short-id) { state %short-id2class; state $lock = Lock.new; Proxy.new( FETCH => { $lock.protect( { if %short-id2class.EXISTS-KEY($short-id) { %short-id2class.AT-KEY($short-id); } else { my $type = try ::($short-id); if $type !=== Any { if $type.?short-id -> $id { if %short-id2class.EXISTS-KEY($id) { %short-id2class.AT-KEY($id); } else { %short-id2class.BIND-KEY($id, $type); } } else { die "Class '$type.^name()' is not a CompUnit::Repository"; } } else { Any } } } ); }, STORE => -> $, $class { my $type = ::($class); die "Must load class '$class' first" if nqp::istype($type,Failure); $lock.protect( { %short-id2class{$short-id} := $type } ); }, ); } # prime the short-id -> class lookup short-id2class('file') = 'CompUnit::Repository::FileSystem'; short-id2class('inst') = 'CompUnit::Repository::Installation'; short-id2class('ap') = 'CompUnit::Repository::AbsolutePath'; short-id2class('nqp') = 'CompUnit::Repository::NQP'; short-id2class('perl5') = 'CompUnit::Repository::Perl5'; #?if jvm short-id2class('javart') = 'CompUnit::Repository::JavaRuntime'; short-id2class('java') = 'CompUnit::Repository::Java'; #?endif sub parse-include-specS(Str:D $specs) { my @found; my $default-short-id = 'file'; if $*RAKUDO_MODULE_DEBUG -> $RMD { $RMD("Parsing specs: $specs") } # for all possible specs my $spec-list := nqp::split(',', $specs); my $iter := nqp::iterator($spec-list); while $iter { my $spec := nqp::shift($iter); if CompUnit::Repository::Spec.from-string($spec.trim, :$default-short-id) -> $repo-spec { @found.push: $repo-spec; $default-short-id = $repo-spec.short-id; } elsif $spec { die "Don't know how to handle $spec"; } } @found; } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Repository/Spec.pm60000644000175000017500000000227713253717231020606 0ustar alexalexclass CompUnit::Repository::Spec { has $.short-id; has %.options; has $.path; has $.Str; method from-string(Str:D $spec, :$default-short-id = 'file') { return unless $spec.chars; # something we understand if $spec.contains('#') { if $spec ~~ /^ [ $=[ <.ident>+ % '::' ] $=[ '#' $=\w+ <[ < ( [ { ]> $=<[\w-]>+? <[ > ) \] } ]> ]* '#' ]? $=.* $/ { my $short-id := ~($ // $default-short-id); my $path := $*SPEC.canonpath(~$); self.new( :$short-id, :options(%($>>.Str Z=> $>>.Str)), :$path :Str($short-id ~ $ ~ '#' ~ $path) ); } } else { my $path := $*SPEC.canonpath($spec); self.new(:short-id($default-short-id), :$path, :Str($default-short-id ~ '#' ~ $path)) } } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CompUnit/Repository/Unknown.pm60000644000175000017500000000156313253717231021350 0ustar alexalexclass CompUnit::Repository::Unknown does CompUnit::Repository { has $.path-spec; has $.short-name; method need( CompUnit::DependencySpecification $spec, CompUnit::PrecompilationRepository $precomp?, CompUnit::PrecompilationStore :@precomp-stores = Array[CompUnit::PrecompilationStore].new( self.repo-chain.map(*.precomp-store).grep(*.defined) ), --> CompUnit:D) { return $precomp ?? self.next-repo.need($spec, $precomp, :@precomp-stores) !! self.next-repo.need($spec, :@precomp-stores) if self.next-repo; X::CompUnit::UnsatisfiedDependency.new(:specification($spec)).throw; } method loaded() { [] } method id() { $.path-spec } method Str() { self.^name ~ " $.short-name $.path-spec" } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/control.pm60000644000175000017500000001527613253717231015462 0ustar alexalexmy class X::ControlFlow::Return { ... } my class X::Eval::NoSuchLang { ... } my class X::Multi::NoMatch { ... } my class X::NYI { ... } my class PseudoStash { ... } my class Label { ... } class CompUnit::DependencySpecification { ... } sub THROW(int $type, Mu \arg) { my Mu $ex := nqp::newexception(); nqp::setpayload($ex, arg); nqp::setextype($ex, $type); nqp::throw($ex); arg; } sub THROW-NIL(int $type --> Nil) { my Mu $ex := nqp::newexception(); # nqp::setpayload($ex, Nil); nqp::setextype($ex, $type); nqp::throw($ex); } sub RETURN-LIST(Mu \list) is raw { my Mu $storage := nqp::getattr(list, List, '$!reified'); nqp::isgt_i(nqp::elems($storage),1) ?? list !! nqp::elems($storage) ?? nqp::shift($storage) !! Nil } proto sub return-rw(|) {*} multi sub return-rw(--> Nil) { nqp::throwpayloadlexcaller(nqp::const::CONTROL_RETURN, Nil); } multi sub return-rw(Mu \x --> Nil) { nqp::throwpayloadlexcaller(nqp::const::CONTROL_RETURN, x); } multi sub return-rw(**@x is raw --> Nil) { nqp::throwpayloadlexcaller(nqp::const::CONTROL_RETURN, @x); } proto sub return(|) {*} multi sub return(--> Nil) { nqp::throwpayloadlexcaller(nqp::const::CONTROL_RETURN, Nil); } multi sub return(Mu \x --> Nil) { nqp::throwpayloadlexcaller(nqp::const::CONTROL_RETURN, nqp::p6recont_ro(x)); } multi sub return(**@x is raw --> Nil) { nqp::throwpayloadlexcaller(nqp::const::CONTROL_RETURN, @x); } proto sub take-rw(|) {*} multi sub take-rw() { die "take-rw without parameters doesn't make sense" } multi sub take-rw(\x) { THROW(nqp::const::CONTROL_TAKE, x) } multi sub take-rw(|) { THROW(nqp::const::CONTROL_TAKE,RETURN-LIST(nqp::p6argvmarray)) } proto sub take(|) {*} multi sub take() { die "take without parameters doesn't make sense" } multi sub take(\x) { THROW(nqp::const::CONTROL_TAKE, nqp::p6recont_ro(x)) } multi sub take(|) { THROW( nqp::const::CONTROL_TAKE, nqp::p6recont_ro(RETURN-LIST(nqp::p6argvmarray)) ) } proto sub goto(|) {*} multi sub goto(Label:D \x --> Nil) { x.goto } proto sub last(|) {*} multi sub last(--> Nil) { nqp::throwextype(nqp::const::CONTROL_LAST); Nil } multi sub last(Label:D \x --> Nil) { x.last } proto sub next(|) {*} multi sub next(--> Nil) { nqp::throwextype(nqp::const::CONTROL_NEXT); Nil } multi sub next(Label:D \x --> Nil) { x.next } proto sub redo(|) {*} multi sub redo(--> Nil) { nqp::throwextype(nqp::const::CONTROL_REDO); Nil } multi sub redo(Label:D \x --> Nil) { x.redo } proto sub succeed(|) {*} multi sub succeed(--> Nil) { THROW-NIL(nqp::const::CONTROL_SUCCEED) } multi sub succeed(\x --> Nil) { THROW(nqp::const::CONTROL_SUCCEED, x) } multi sub succeed(| --> Nil) { THROW(nqp::const::CONTROL_SUCCEED,RETURN-LIST(nqp::p6argvmarray)) } sub proceed(--> Nil) { THROW-NIL(nqp::const::CONTROL_PROCEED) } sub callwith(|c) is raw { $/ := nqp::getlexcaller('$/'); my Mu $dispatcher := nqp::p6finddispatcher('callwith'); $dispatcher.exhausted ?? Nil !! $dispatcher.call_with_args(|c) } sub nextwith(|c) is raw { $/ := nqp::getlexcaller('$/'); my Mu $dispatcher := nqp::p6finddispatcher('nextwith'); nqp::throwpayloadlexcaller(nqp::const::CONTROL_RETURN, $dispatcher.exhausted ?? Nil !! $dispatcher.call_with_args(|c)) } sub callsame() is raw { $/ := nqp::getlexcaller('$/'); my Mu $dispatcher := nqp::p6finddispatcher('callsame'); $dispatcher.exhausted ?? Nil !! $dispatcher.call_with_capture( nqp::p6argsfordispatcher($dispatcher)) } sub nextsame() is raw { $/ := nqp::getlexcaller('$/'); my Mu $dispatcher := nqp::p6finddispatcher('nextsame'); nqp::throwpayloadlexcaller(nqp::const::CONTROL_RETURN, $dispatcher.exhausted ?? Nil !! $dispatcher.call_with_capture(nqp::p6argsfordispatcher($dispatcher))) } sub lastcall(--> True) { nqp::p6finddispatcher('lastcall').last(); } sub nextcallee() { my Mu $dispatcher := nqp::p6finddispatcher('nextsame'); $dispatcher.exhausted ?? Nil !! $dispatcher.shift_callee() } sub samewith(|c) { $/ := nqp::getlexcaller('$/'); my Mu $ctx := nqp::ctxcaller(nqp::ctx()); until nqp::isnull($ctx) { my $caller := nqp::getcodeobj(nqp::ctxcode($ctx)); if nqp::istype($caller, Routine) { if $caller.multi { my $dispatcher := $caller.?dispatcher || die "Could not find dispatcher"; return nqp::istype($caller, Method) ?? $dispatcher(nqp::atkey($ctx, 'self') // $caller.package,|c) !! $dispatcher(|c); } else { return $caller(|c); } } $ctx := nqp::ctxouter($ctx); } die "Cannot use samewith outside of a routine"; } sub leave(|) { X::NYI.new(feature => 'leave').throw } sub emit(\value --> Nil) { THROW(nqp::const::CONTROL_EMIT, nqp::p6recont_ro(value)); } sub done(--> Nil) { THROW-NIL(nqp::const::CONTROL_DONE); } proto sub die(|) {*}; multi sub die(--> Nil) { my $stash := CALLER::; my $payload = $stash<$!>.DEFINITE ?? $stash<$!> !! "Died"; $payload ~~ Exception ?? $payload.throw !! X::AdHoc.new(:$payload).throw } multi sub die(Exception:U $e --> Nil) { X::AdHoc.new(:payload("Died with undefined " ~ $e.^name)).throw; } multi sub die($payload --> Nil) { $payload ~~ Exception ?? $payload.throw !! X::AdHoc.new(:$payload).throw } multi sub die(|cap ( *@msg ) --> Nil) { X::AdHoc.from-slurpy(|cap).throw } multi sub warn(*@msg) { my $msg = @msg.join || "Warning: something's wrong"; my $ex := nqp::newexception(); nqp::setmessage($ex, nqp::unbox_s($msg)); nqp::setextype($ex, nqp::const::CONTROL_WARN); nqp::throw($ex); 0; } multi sub warn(Junction:D \j) { j.THREAD: &warn } constant Inf = nqp::p6box_n(nqp::inf()); constant NaN = nqp::p6box_n(nqp::nan()); # For some reason, we cannot move this to Rakudo::Internals as a class # method, because then the return value is always HLLized :-( sub CLONE-HASH-DECONTAINERIZED(\hash) { nqp::if( nqp::getattr(hash,Map,'$!storage').DEFINITE, nqp::stmts( (my $clone := nqp::hash), (my $iter := nqp::iterator(nqp::getattr(hash,Map,'$!storage'))), nqp::while( $iter, nqp::bindkey($clone, nqp::iterkey_s(nqp::shift($iter)), nqp::if( nqp::defined(nqp::iterval($iter)), nqp::decont(nqp::iterval($iter)).Str, '' ) ) ), $clone ), nqp::hash ) } sub CLONE-LIST-DECONTAINERIZED(*@list) { my Mu $list-without := nqp::list(); nqp::push($list-without, nqp::decont(~$_)) for @list.eager; $list-without; } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Cool.pm60000644000175000017500000005341113253717231014667 0ustar alexalexBEGIN { # Workaround for regression in https://github.com/rakudo/rakudo/issues/1566 # The actual bug is that Callable role gets mixed in into routines # before it's composed, and when it is composed, the routines end up # not "doing" `Callable` role, even though they do. There are many more # routines suffering this issue, but these three regressed since last # release and we don't have the time to fix the primary bug before the # release, so in this fudge goes. &min.^compose; &max.^compose; &minmax.^compose; } my class Cool { # declared in BOOTSTRAP # class Cool is Any ## numeric methods method abs() { self.Numeric.abs } method conj() { self.Numeric.conj } method sqrt() { self.Numeric.sqrt } method sign() { self.Real.sign } method rand() { self.Num.rand } method sin() { self.Numeric.sin } method asin() { self.Numeric.asin } method cos() { self.Numeric.cos } method acos() { self.Numeric.acos } method tan() { self.Numeric.tan } method atan() { self.Numeric.atan } method atan2($y = 1e0) { self.Numeric.atan2($y.Numeric) } method sec() { self.Numeric.sec } method asec() { self.Numeric.asec } method cosec() { self.Numeric.cosec } method acosec() { self.Numeric.acosec } method cotan() { self.Numeric.cotan } method acotan() { self.Numeric.acotan } method sinh() { self.Numeric.sinh } method asinh() { self.Numeric.asinh } method cosh() { self.Numeric.cosh } method acosh() { self.Numeric.acosh } method tanh() { self.Numeric.tanh } method atanh() { self.Numeric.atanh } method sech() { self.Numeric.sech } method asech() { self.Numeric.asech } method cosech() { self.Numeric.cosech } method acosech() { self.Numeric.acosech } method cotanh() { self.Numeric.cotanh } method acotanh() { self.Numeric.acotanh } method cis() { self.Numeric.cis } method is-prime(--> Bool:D) { self.Real.is-prime } proto method log(|) {*} multi method log(Cool:D: ) { self.Numeric.log } multi method log(Cool:D: $base) { self.Numeric.log($base.Numeric) } proto method exp(|) {*} multi method exp(Cool:D: ) { self.Numeric.exp } multi method exp(Cool:D: $base) { self.Numeric.exp($base.Numeric) } proto method round(|) {*} multi method round() { self.Numeric.round() } multi method round($base) { self.Numeric.round($base) } method roots(Cool $n) { self.Numeric.roots($n) } method log10() { self.Numeric.log10 } method unpolar($n) { self.Numeric.unpolar($n.Numeric) } method floor() { self.Numeric.floor } method ceiling() { self.Numeric.ceiling } method truncate() { self.Numeric.truncate } ## string methods method chars(--> Int:D) { self.Str.chars } method codes() { self.Str.codes } method fmt($format = '%s') { Rakudo::Internals.initialize-sprintf-handler; nqp::p6box_s( nqp::sprintf(nqp::unbox_s($format.Stringy), nqp::list(self)) ) } method uc() { self.Str.uc } method lc() { self.Str.lc } method tc() { self.Str.tc } method fc() { self.Str.fc } method tclc() { self.Str.tclc } method wordcase() { self.Str.wordcase } method uniname() { uniname(self) } method uninames() { uninames(self) } method unival() { unival(self) } method univals() { univals(self) } method uniprop(|c) { uniprop(self, |c) } method uniprop-int(|c) { uniprop-int(self, |c) } method uniprop-bool(|c) { uniprop-bool(self, |c) } method uniprop-str(|c) { uniprop-str(self, |c) } method uniprops(|c) { uniprops(self, |c) } method unimatch(|c) { unimatch(self, |c) } method chomp(Cool:D:) { self.Str.chomp } proto method chop(|) {*} multi method chop(Cool:D:) { self.Str.chop } multi method chop(Cool:D: Int() $n) { self.Str.chop($n) } method ord(--> Int:D) { self.Str.ord } method chr() { self.Int.chr; } proto method chrs(|) {*} multi method chrs(Cool:D:) { self.list.chrs } proto method ords(|) {*} multi method ords(Cool:D:) { self.Str.ords } method flip() { self.Str.flip } method trans(|c) { self.Str.trans(|c) } method starts-with(Cool:D: |c) { self.Str.starts-with(|c) } method ends-with(Cool:D: |c) { self.Str.ends-with(|c) } proto method substr(|) {*} multi method substr() { self.Str.substr } multi method substr(\from) { self.Str.substr(from) } multi method substr(\from, \chars) { self.Str.substr(from,chars) } proto method substr-rw(|) {*} multi method substr-rw(\SELF:) is rw { (SELF = self.Str).substr-rw } multi method substr-rw(\SELF: \from) is rw { (SELF = self.Str).substr-rw(from) } multi method substr-rw(\SELF: \from, \chars) is rw { (SELF = self.Str).substr-rw(from,chars) } method substr-eq(Cool:D: |c) { self.Str.substr-eq(|c) } method contains(Cool:D: |c) { self.Str.contains(|c) } method indices(Cool:D: |c) { self.Str.indices(|c) } method index(Cool:D: |c) { self.Str.index(|c) } method rindex(Cool:D: |c) { self.Str.rindex(|c) } method split(Cool: |c) { self.Stringy.split(|c); } method match(Cool:D: |c) { $/ := nqp::getlexcaller('$/'); self.Stringy.match(|c) } method comb(|c) { self.Str.comb(|c) } method lines(Cool:D: |c) { self.Str.lines(|c) } method words(Cool:D: |c) { self.Str.words(|c) } method subst(|c) { $/ := nqp::getlexcaller('$/'); self.Stringy.subst(|c); } # `$value-to-subst-mutate` will show up in errors when called on non-rw # container, so use more descriptive name instead of just `$self` method subst-mutate(Cool:D $value-to-subst-mutate is rw: |c) { $/ := nqp::getlexcaller('$/'); my $str = $value-to-subst-mutate.Str; my $match := $str.subst-mutate(|c); $value-to-subst-mutate = $str if $match; # only change if successful $match } proto method IO(|) {*} multi method IO(Cool:D:) { IO::Path.new(self) } multi method IO(Cool:U:) { IO::Path } method sprintf(*@args) { sprintf(self, @args) }; method printf (*@args) { printf(self, @args) }; method samecase(Cool:D: Cool $pattern) { self.Stringy.samecase($pattern) } method path() { self.Stringy.IO } method trim () { self.Stringy.trim }; method trim-leading () { self.Stringy.trim-leading }; method trim-trailing() { self.Stringy.trim-trailing }; method EVAL(*%opts) { EVAL(self, context => CALLER::, |%opts); } multi method Real() { nqp::if( nqp::istype((my $numeric := self.Numeric), Failure), $numeric, $numeric.Real ) } proto method Int(|) {*} multi method Int() { nqp::if( nqp::istype((my $numeric := self.Numeric), Failure), $numeric, $numeric.Int ) } proto method UInt(|) {*} multi method UInt() { my $got := self.Int; $got < 0 ?? Failure.new(X::OutOfRange.new( :what('Coercion to UInt'), :$got, :range<0..^Inf>)) !! $got } method Num() { nqp::if( nqp::istype((my $numeric := self.Numeric), Failure), $numeric, $numeric.Num ) } method Rat() { nqp::if( nqp::istype((my $numeric := self.Numeric), Failure), $numeric, $numeric.Rat ) } method FatRat() { nqp::if( nqp::istype((my $numeric := self.Numeric), Failure), $numeric, $numeric.FatRat ) } method Complex() { nqp::if( nqp::istype((my $numeric := self.Numeric), Failure), $numeric, $numeric.Complex ) } } Metamodel::ClassHOW.exclude_parent(Cool); proto sub chop(|) {*} multi sub chop(Cool:D $s --> Str:D) { $s.chop } multi sub chop(Cool:D $s, Int() $n --> Str:D) { $s.chop($n) } proto sub chomp(|) {*} multi sub chomp(Cool $s --> Str:D) { $s.chomp } proto sub flip(|) {*} multi sub flip(Cool $s --> Str:D) { $s.flip } proto sub index(|) {*} multi sub index(Cool $s, Cool $needle) { $s.index($needle) } multi sub index(Cool $s, Cool $needle, Cool $pos) { $s.index($needle,$pos) } proto sub rindex(|) {*} multi sub rindex(Cool $s, Cool $needle, Cool $pos) { $s.rindex($needle, $pos) } multi sub rindex(Cool $s, Cool $needle) { $s.rindex($needle) } proto sub lc(|) {*} multi sub lc(Cool $s) { $s.lc } proto sub ord(|) {*} multi sub ord(Cool $s) { $s.ord } proto sub uc(|) {*} multi sub uc(Cool $s) { $s.uc } proto sub tc(|) {*} multi sub tc(Cool $s) { $s.tc } proto sub fc(|) {*} multi sub fc(Cool $s) { $s.fc } proto sub tclc(|) {*} multi sub tclc(Cool $s) { $s.tclc } proto sub indices(|) {*} multi sub indices(Cool $s, |c) { $s.indices(|c) } proto sub ords($) {*} multi sub ords(Cool:D $s) { $s.ords } proto sub comb($, $, $?) {*} multi sub comb(Regex $matcher, Cool $input, $limit = *) { $input.comb($matcher, $limit) } multi sub comb(Str $matcher, Cool $input, $limit = *) { $input.comb($matcher, $limit) } multi sub comb(Int:D $matcher, Cool $input, $limit = *) { $input.comb($matcher, $limit) } proto sub wordcase($) is pure {*} multi sub wordcase(Str:D $x) {$x.wordcase } multi sub wordcase(Cool $x) {$x.Str.wordcase } proto sub sprintf(|) {*} multi sub sprintf(Cool:D $format, *@args) { CATCH { when X::Cannot::Lazy { X::Cannot::Lazy.new(:action('(s)printf')).throw } default { Rakudo::Internals.HANDLE-NQP-SPRINTF-ERRORS($_).throw } } Rakudo::Internals.initialize-sprintf-handler; @args.elems; nqp::p6box_s( nqp::sprintf(nqp::unbox_s($format.Stringy), nqp::clone(nqp::getattr(@args||[], List, '$!reified')) ) ) } proto sub printf(|) {*} multi sub printf(Cool:D $format, *@args) { print sprintf $format, @args } proto sub samecase(|) {*} multi sub samecase(Cool:D $string, Cool:D $pattern) { $string.samecase($pattern) } proto sub split(|) {*} multi sub split($pat, Cool:D $target, |c) { $target.split($pat, |c) } proto sub chars($) is pure {*} multi sub chars(Cool $x) { $x.Str.chars } multi sub chars(Str:D $x) { nqp::p6box_i(nqp::chars($x)) } multi sub chars(str $x --> int) { nqp::chars($x) } # These probably belong in a separate unicodey file proto sub uniname(|) {*} multi sub uniname(Str:D $str) { $str ?? uniname($str.ord) !! Nil } multi sub uniname(Int:D $code) { nqp::getuniname($code) } proto sub uninames(|) {*} multi sub uninames(Str:D $str) { $str.NFC.map: { uniname($_) } } #?if jvm multi sub unival(|) { die 'unival NYI on jvm backend' } multi sub univals(|) { die 'univals NYI on jvm backend' } multi sub uniprop(|) { die 'uniprop NYI on jvm backend' } multi sub uniprop-int(|) { die 'uniprop-int NYI on jvm backend' } multi sub uniprop-bool(|) { die 'uniprop-bool NYI on jvm backend' } multi sub uniprop-str(|) { die 'uniprop-str NYI on jvm backend' } multi sub uniprops(|) { die 'uniprops NYI on jvm backend' } multi sub unimatch(|) { die 'unimatch NYI on jvm backend' } #?endif #?if moar proto sub uniprop(|) {*} multi sub uniprop(Str:D $str, |c) { $str ?? uniprop($str.ord, |c) !! Nil } multi sub uniprop(Int:D $code) { nqp::getuniprop_str($code,nqp::unipropcode('General_Category')); } multi sub uniprop(Int:D $code, Stringy:D $propname) { # prop-mappings can be removed when MoarVM bug #448 is fixed... ## The code below was generated by tools/build/makeUNIPROP.pl6 my constant $prop-mappings = nqp::hash( 'OGr_Ext','Other_Grapheme_Extend','tc','Titlecase_Mapping', 'cjkIRG_MSource','kIRG_MSource','Dash','Dash','Pat_Syn','Pattern_Syntax', 'IDST','IDS_Trinary_Operator','IDC','ID_Continue','Dia','Diacritic', 'Cased','Cased','hst','Hangul_Syllable_Type','QMark','Quotation_Mark', 'Radical','Radical','NFD_QC','NFD_Quick_Check','jt','Joining_Type', 'cf','Case_Folding','cjkIRG_TSource','kIRG_TSource','sc','Script', 'SD','Soft_Dotted','CWCM','Changes_When_Casemapped', 'cjkOtherNumeric','kOtherNumeric','scf','Simple_Case_Folding', 'sfc','Simple_Case_Folding','isc','ISO_Comment','na1','Unicode_1_Name', 'Lower','Lowercase','Join_C','Join_Control','JSN','Jamo_Short_Name', 'bc','Bidi_Class','jg','Joining_Group','dm','Decomposition_Mapping', 'lc','Lowercase_Mapping','cjkIRG_USource','kIRG_USource', 'NFKC_CF','NFKC_Casefold','slc','Simple_Lowercase_Mapping', 'InSC','Indic_Syllabic_Category','XO_NFC','Expands_On_NFC', 'XO_NFD','Expands_On_NFD','cjkAccountingNumeric','kAccountingNumeric', 'Upper','Uppercase','WSpace','White_Space','space','White_Space', 'cjkIRG_VSource','kIRG_VSource','STerm','Sentence_Terminal', 'NFKD_QC','NFKD_Quick_Check','CWT','Changes_When_Titlecased','Math','Math', 'uc','Uppercase_Mapping','NFKC_QC','NFKC_Quick_Check','SB','Sentence_Break', 'stc','Simple_Titlecase_Mapping','Alpha','Alphabetic', 'CE','Composition_Exclusion','NChar','Noncharacter_Code_Point', 'OAlpha','Other_Alphabetic','XIDC','XID_Continue','age','Age', 'cjkPrimaryNumeric','kPrimaryNumeric','OIDS','Other_ID_Start', 'UIdeo','Unified_Ideograph','FC_NFKC','FC_NFKC_Closure','CI','Case_Ignorable', 'Hyphen','Hyphen','nv','Numeric_Value','CWKCF','Changes_When_NFKC_Casefolded', 'XO_NFKD','Expands_On_NFKD','InPC','Indic_Positional_Category', 'dt','Decomposition_Type','cjkIICore','kIICore','Bidi_M','Bidi_Mirrored', 'CWU','Changes_When_Uppercased','IDS','ID_Start','Gr_Ext','Grapheme_Extend', 'XIDS','XID_Start','XO_NFKC','Expands_On_NFKC','OUpper','Other_Uppercase', 'OMath','Other_Math','Gr_Link','Grapheme_Link','Bidi_C','Bidi_Control', 'DI','Default_Ignorable_Code_Point','CWCF','Changes_When_Casefolded', 'cjkIRG_GSource','kIRG_GSource','WB','Word_Break','NFC_QC','NFC_Quick_Check', 'cjkIRG_JSource','kIRG_JSource','ODI','Other_Default_Ignorable_Code_Point', 'LOE','Logical_Order_Exception','bpb','Bidi_Paired_Bracket', 'PCM','Prepended_Concatenation_Mark','OLower','Other_Lowercase', 'OIDC','Other_ID_Continue','VS','Variation_Selector','Ext','Extender', 'Comp_Ex','Full_Composition_Exclusion','IDSB','IDS_Binary_Operator', 'nt','Numeric_Type','cjkCompatibilityVariant','kCompatibilityVariant', 'suc','Simple_Uppercase_Mapping','Term','Terminal_Punctuation', 'lb','Line_Break','cjkIRG_HSource','kIRG_HSource','ea','East_Asian_Width', 'AHex','ASCII_Hex_Digit','cjkIRG_KSource','kIRG_KSource', 'Pat_WS','Pattern_White_Space','Hex','Hex_Digit', 'cjkIRG_KPSource','kIRG_KPSource','bpt','Bidi_Paired_Bracket_Type', 'gc','General_Category','GCB','Grapheme_Cluster_Break', 'Gr_Base','Grapheme_Base','na','Name','scx','Script_Extensions', 'Ideo','Ideographic','Name_Alias','Name_Alias','blk','Block','Dep','Deprecated', 'CWL','Changes_When_Lowercased','bmg','Bidi_Mirroring_Glyph', 'cjkRSUnicode','kRSUnicode','Unicode_Radical_Stroke','kRSUnicode', 'URS','kRSUnicode','ccc','Canonical_Combining_Class', ); my constant $prefs = nqp::hash( 'Other_Grapheme_Extend','B','Titlecase_Mapping','tc','Dash','B', 'Emoji_Modifier_Base','B','Emoji_Modifier','B','Pattern_Syntax','B', 'IDS_Trinary_Operator','B','ID_Continue','B','Diacritic','B','Cased','B', 'Hangul_Syllable_Type','S','Quotation_Mark','B','Radical','B', 'NFD_Quick_Check','S','Joining_Type','S','Case_Folding','S','Script','S', 'Soft_Dotted','B','Changes_When_Casemapped','B','Simple_Case_Folding','S', 'ISO_Comment','S','Lowercase','B','Join_Control','B','Bidi_Class','S', 'Joining_Group','S','Decomposition_Mapping','S','Lowercase_Mapping','lc', 'NFKC_Casefold','S','Simple_Lowercase_Mapping','S', 'Indic_Syllabic_Category','S','Expands_On_NFC','B','Expands_On_NFD','B', 'Uppercase','B','White_Space','B','Sentence_Terminal','B', 'NFKD_Quick_Check','S','Changes_When_Titlecased','B','Math','B', 'Uppercase_Mapping','uc','NFKC_Quick_Check','S','Sentence_Break','S', 'Simple_Titlecase_Mapping','S','Alphabetic','B','Composition_Exclusion','B', 'Noncharacter_Code_Point','B','Other_Alphabetic','B','XID_Continue','B', 'Age','S','Other_ID_Start','B','Unified_Ideograph','B','FC_NFKC_Closure','S', 'Case_Ignorable','B','Hyphen','B','Numeric_Value','nv', 'Changes_When_NFKC_Casefolded','B','Expands_On_NFKD','B', 'Indic_Positional_Category','S','Decomposition_Type','S','Bidi_Mirrored','B', 'Changes_When_Uppercased','B','ID_Start','B','Grapheme_Extend','B', 'XID_Start','B','Expands_On_NFKC','B','Other_Uppercase','B','Other_Math','B', 'Grapheme_Link','B','Bidi_Control','B','Default_Ignorable_Code_Point','B', 'Changes_When_Casefolded','B','Word_Break','S','NFC_Quick_Check','S', 'Other_Default_Ignorable_Code_Point','B','Logical_Order_Exception','B', 'Prepended_Concatenation_Mark','B','Other_Lowercase','B', 'Other_ID_Continue','B','Variation_Selector','B','Extender','B', 'Full_Composition_Exclusion','B','IDS_Binary_Operator','B','Numeric_Type','S', 'kCompatibilityVariant','S','Simple_Uppercase_Mapping','S', 'Terminal_Punctuation','B','Line_Break','S','East_Asian_Width','S', 'ASCII_Hex_Digit','B','Pattern_White_Space','B','Hex_Digit','B', 'Bidi_Paired_Bracket_Type','S','General_Category','S', 'Grapheme_Cluster_Break','S','Grapheme_Base','B','Name','na','Ideographic','B', 'Block','S','Emoji_Presentation','B','Emoji','B','Deprecated','B', 'Changes_When_Lowercased','B','Bidi_Mirroring_Glyph','bmg', 'Canonical_Combining_Class','S', ); ## End generated code $propname := nqp::atkey($prop-mappings, $propname) if nqp::existskey($prop-mappings,$propname); my $prop := nqp::unipropcode($propname); my str $pref = nqp::ifnull(nqp::atkey($prefs, $propname),''); nqp::if( nqp::iseq_s($pref, 'S'), nqp::getuniprop_str($code,$prop), nqp::if( nqp::iseq_s($pref, 'I'), nqp::getuniprop_int($code,$prop), nqp::if( nqp::iseq_s($pref, 'B'), nqp::p6bool(nqp::getuniprop_bool($code,$prop)), nqp::if( nqp::iseq_s($pref, 'lc'), nqp::lc(nqp::chr(nqp::unbox_i($code))), nqp::if( nqp::iseq_s($pref, 'tc'), nqp::tc(nqp::chr(nqp::unbox_i($code))), nqp::if( nqp::iseq_s($pref, 'uc'), nqp::uc(nqp::chr(nqp::unbox_i($code))), nqp::if( nqp::iseq_s($pref, 'na'), nqp::getuniname($code), nqp::if( nqp::iseq_s($pref, 'nv'), unival($code), nqp::if( nqp::iseq_s($pref, 'bmg'), nqp::stmts( (my int $bmg-ord = nqp::getuniprop_int($code, $prop)), $bmg-ord ?? nqp::chr($bmg-ord) !! ''), nqp::stmts( (my $result := nqp::getuniprop_str($code,$prop)), nqp::if( nqp::istrue($result), nqp::stmts( nqp::bindkey($prefs, $propname, 'S'), $result), nqp::stmts( nqp::bindkey($prefs, $propname, 'I'), nqp::getuniprop_int($code,$prop))))))))))))) } # Unicode functions proto sub uniprop-int(|) {*} multi sub uniprop-int(Str:D $str, Stringy:D $propname) { $str ?? uniprop-int($str.ord, $propname) !! Nil } multi sub uniprop-int(Int:D $code, Stringy:D $propname) { nqp::getuniprop_int($code,nqp::unipropcode($propname)); } proto sub uniprop-bool(|) {*} multi sub uniprop-bool(Str:D $str, Stringy:D $propname) { $str ?? uniprop-bool($str.ord, $propname) !! Nil } multi sub uniprop-bool(Int:D $code, Stringy:D $propname) { nqp::p6bool(nqp::getuniprop_bool($code,nqp::unipropcode($propname))); } proto sub uniprop-str(|) {*} multi sub uniprop-str(Str:D $str, Stringy:D $propname) { $str ?? uniprop-str($str.ord, $propname) !! Nil } multi sub uniprop-str(Int:D $code, Stringy:D $propname) { nqp::getuniprop_str($code,nqp::unipropcode($propname)); } proto sub uniprops(|) {*} multi sub uniprops(Str:D $str, Stringy:D $propname = "General_Category") { $str.ords.map: { uniprop($_, $propname) } } proto sub unival(|) {*} multi sub unival(Str:D $str) { $str ?? unival($str.ord) !! Nil } multi sub unival(Int:D $code) { state $nuprop = nqp::unipropcode("Numeric_Value_Numerator"); state $deprop = nqp::unipropcode("Numeric_Value_Denominator"); my $nu = nqp::getuniprop_str($code, $nuprop); my $de = nqp::getuniprop_str($code, $deprop); !$de || $de eq '1' ?? $nu.Int !! $nu / $de; } proto sub univals(|) {*} multi sub univals(Str:D $str) { $str.ords.map: { unival($_) } } proto sub unimatch(|) {*} multi sub unimatch(Str:D $str, |c) { $str ?? unimatch($str.ord, |c) !! Nil } # This multi below can be removed when MoarVM bug #448 is fixed multi sub unimatch(Int:D $code, Stringy:D $pvalname, Stringy:D $propname) { uniprop($code, $propname) eq $pvalname; } multi sub unimatch(Int:D $code, Stringy:D $pvalname, Stringy:D $propname = $pvalname) { my $prop := nqp::unipropcode($propname); nqp::p6bool(nqp::matchuniprop($code,$prop,nqp::unipvalcode($prop,$pvalname))); } #?endif # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/core_epilogue.pm60000644000175000017500000000330213253717231016606 0ustar alexalex# Re-parent meta-objects so they appear to be under Any. BEGIN { Perl6::Metamodel::ClassHOW.HOW.reparent(Perl6::Metamodel::ClassHOW, Any); Perl6::Metamodel::ConcreteRoleHOW.HOW.reparent(Perl6::Metamodel::ConcreteRoleHOW, Any); Perl6::Metamodel::CurriedRoleHOW.HOW.reparent(Perl6::Metamodel::CurriedRoleHOW, Any); Perl6::Metamodel::EnumHOW.HOW.reparent(Perl6::Metamodel::EnumHOW, Any); Perl6::Metamodel::GenericHOW.HOW.reparent(Perl6::Metamodel::GenericHOW, Any); Perl6::Metamodel::ModuleHOW.HOW.reparent(Perl6::Metamodel::ModuleHOW, Any); Perl6::Metamodel::NativeHOW.HOW.reparent(Perl6::Metamodel::NativeHOW, Any); Perl6::Metamodel::PackageHOW.HOW.reparent(Perl6::Metamodel::PackageHOW, Any); Perl6::Metamodel::ParametricRoleGroupHOW.HOW.reparent(Perl6::Metamodel::ParametricRoleGroupHOW, Any); Perl6::Metamodel::ParametricRoleHOW.HOW.reparent(Perl6::Metamodel::ParametricRoleHOW, Any); Perl6::Metamodel::SubsetHOW.HOW.reparent(Perl6::Metamodel::SubsetHOW, Any); Perl6::Metamodel::GrammarHOW.HOW.compose(Perl6::Metamodel::GrammarHOW); Perl6::Metamodel::BaseDispatcher.HOW.reparent(Perl6::Metamodel::BaseDispatcher, Any); Perl6::Metamodel::MethodDispatcher.HOW.compose(Perl6::Metamodel::MethodDispatcher); Perl6::Metamodel::MultiDispatcher.HOW.compose(Perl6::Metamodel::MultiDispatcher); Perl6::Metamodel::WrapDispatcher.HOW.compose(Perl6::Metamodel::WrapDispatcher); } BEGIN { # Create pun at compile time as buf8 is used extensively in file I/O and module loading buf8.elems; } { my $perl := BEGIN Perl.new; Rakudo::Internals.REGISTER-DYNAMIC: '$*PERL', { PROCESS::<$PERL> := $perl; } } {YOU_ARE_HERE} # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/core_prologue.pm60000644000175000017500000000323613253717231016637 0ustar alexalex# Stub a few things the compiler wants to have really early on. my class Pair { ... } # must be first for some reason my class Block { ... } my class HyperWhatever { ... } my class List { ... } my class Map { ... } my class Match { ... } my class Failure { ... } my class Rakudo::Internals { ... } my class Rakudo::Internals::JSON { ... } my class Rakudo::Iterator { ... } my class ThreadPoolScheduler { ... } my class Whatever { ... } my class WhateverCode { ... } my class X::Attribute::Required { ... } my class X::Numeric::Overflow { ... } my class X::Numeric::Underflow { ... } # Stub these or we can't use any sigil other than $. my role Positional { ... } my role Associative { ... } my role Callable { ... } my role Iterable { ... } my role PositionalBindFailover { ... } # Set up Empty, which is a Slip created with an empty IterationBuffer (which # we also stub here). This is needed in a bunch of simple constructs (like if # with only one branch). my class IterationBuffer is repr('VMArray') { ... } my constant Empty = nqp::p6bindattrinvres(nqp::create(Slip), List, '$!reified', nqp::create(IterationBuffer)); # We use a sentinel value to mark the end of an iteration. my constant IterationEnd = nqp::create(Mu); # To allow passing of nqp::hash without being HLLized, we create a HLL class # with the same low level REPR as nqp::hash. my class Rakudo::Internals::IterationSet is repr('VMHash') { } # The value for \n. my constant $?NL = "\x0A"; # Make sure we have an environment PROCESS::<%ENV> := Rakudo::Internals.createENV(0); # This thread pool scheduler will be the default one. PROCESS::<$SCHEDULER> = ThreadPoolScheduler.new(); # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/CurrentThreadScheduler.pm60000644000175000017500000000165513253717231020407 0ustar alexalex# Scheduler that always does things immediately, on the current thread. my class CurrentThreadScheduler does Scheduler { method handle_uncaught($exception) { $exception.throw } method cue(&code, :$at, :$in, :$every, :$times = 1, :&catch is copy ) { die "Cannot specify :at and :in at the same time" if $at.defined and $in.defined; die "Cannot specify :every and :times at the same time" if $every.defined and $times > 1; die "Cannot specify :every in {self.^name}" if $every; my $delay = $at ?? $at - now !! $in; sleep $delay if $delay; &catch //= (self && self.uncaught_handler) // -> $ex { self.handle_uncaught($ex) }; for 1 .. $times { code(); CATCH { default { catch($_) } }; } class { method cancel() {} } } method loads(--> 0) { } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Cursor.pm60000644000175000017500000000007413253717231015245 0ustar alexalexmy constant Cursor = Match; # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Dateish.pm60000644000175000017500000001167713253717231015364 0ustar alexalexmy role Dateish { has Int $.year; has Int $.month; # should be int has Int $.day; # should be int has Int $.daycount; has &.formatter; method IO(Dateish:D:) { IO::Path.new(~self) } # because Dateish is not Cool # this sub is also used by DAYS-IN-MONTH, which is used by other types sub IS-LEAP-YEAR($y) { $y %% 4 and not $y %% 100 or $y %% 400 } method is-leap-year(Dateish:D:) { IS-LEAP-YEAR($!year) } my $days-in-month := nqp::list_i( 0, 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); # This method is used by Date and DateTime: method DAYS-IN-MONTH(\year, \month) { nqp::atpos_i($days-in-month,month) || ( month == 2 ?? 28 + IS-LEAP-YEAR(year) !! Nil ); } method days-in-month(Dateish:D:) { self.DAYS-IN-MONTH($!year,$!month) } method !year-Str() { sprintf 0 <= $!year <= 9999 ?? '%04d' !! '%+05d', $!year; } multi method new(Dateish:) { Failure.new( "Cannot call {self.^name}.new with " ~ (%_ ?? "these named parameters: {%_.keys}" !! "no parameters") ) } multi method Str(Dateish:D:) { &!formatter ?? &!formatter(self) !! self!formatter } multi method gist(Dateish:D:) { self.Str } method daycount() { $!daycount //= do { # taken from my int $m = $!month < 3 ?? $!month + 12 !! $!month; my int $y = $!year - ($!month < 3); -678973 + $!day + (153 * $m - 2) div 5 + 365 * $y + $y div 4 - $y div 100 + $y div 400; } } method !ymd-from-daycount($daycount,\year,\month,\day --> Nil) { # taken from my Int $dc = $daycount.Int + 678881; my Int $ti = (4 * ($dc + 36525)) div 146097 - 1; my Int $year = 100 * $ti; my int $day = $dc - (36524 * $ti + ($ti div 4)); my int $t = (4 * ($day + 366)) div 1461 - 1; year = $year + $t; $day = $day - (365 * $t + ($t div 4)); my int $month = (5 * $day + 2) div 153; day = $day - ((2 + $month * 153) div 5 - 1); if ($month > 9) { month = $month - 9; year = year + 1; } else { month = $month + 3; } } method day-of-month() { $!day } method day-of-week(Dateish:D:) { (self.daycount + 2) % 7 + 1 } method week() { # algorithm from Claus Tøndering my int $a = $!year - ($!month <= 2).floor.Int; my int $b = $a div 4 - $a div 100 + $a div 400; my int $c = ($a - 1) div 4 - ($a - 1) div 100 + ($a - 1) div 400; my int $s = $b - $c; my int $e = $!month <= 2 ?? 0 !! $s + 1; my int $f = $!day + ($!month <= 2 ?? 31*($!month - 1) - 1 !! (153*($!month - 3) + 2) div 5 + 58 + $s); my int $g = ($a + $b) % 7; my int $d = ($f + $g - $e) % 7; my int $n = $f + 3 - $d; $n < 0 ?? ($!year - 1, 53 - ($g - $s) div 5) !! $n > 364 + $s ?? ($!year + 1, 1 ) !! ($!year, $n div 7 + 1 ); } method week-year() { self.week.AT-POS(0) } method week-number() { self.week.AT-POS(1) } method weekday-of-month { ($!day - 1) div 7 + 1 } my $days-at-start-of-month := nqp::list_i( 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 ); method day-of-year() { $!day + nqp::atpos_i($days-at-start-of-month,$!month) + ($!month > 2 && IS-LEAP-YEAR($!year)); } method yyyy-mm-dd() { sprintf '%04d-%02d-%02d',$!year,$!month,$!day } method earlier(*%unit) { self.later(:earlier, |%unit) } method !truncate-ymd(Cool:D $unit, %parts? is copy) { if $unit eq 'week' | 'weeks' { my $new-dc = self.daycount - self.day-of-week + 1; self!ymd-from-daycount($new-dc, %parts,%parts,%parts); } else { # $unit eq 'month' | 'months' | 'year' | 'years' %parts = 1; %parts = 1 if $unit eq 'year' | 'years'; } %parts; } } # =begin pod # # =head1 SEE ALSO # Perl 6 spec . # The Perl 5 DateTime Project home page L. # Perl 5 perldoc L and L. # # The best yet seen explanation of calendars, by Claus Tøndering # L. # Similar algorithms at L # and L. # # #
), :actions($LANG)) if $LANG); $*W.add_additional_frames(mast_frames) if $*W and $*W.is_precompilation_mode; # we are still compiling nqp::forceouterctx(nqp::getattr($compiled, ForeignCode, '$!do'), $eval_ctx); $compiled(); } multi sub EVAL($code, Str :$lang where { ($lang // '') eq 'Perl5' }, PseudoStash :$context) { my $eval_ctx := nqp::getattr(nqp::decont($context // CALLER::), PseudoStash, '$!ctx'); my $?FILES := 'EVAL_' ~ (state $no)++; state $p5; unless $p5 { { my $compunit := $*REPO.need(CompUnit::DependencySpecification.new(:short-name)); GLOBAL.WHO.merge-symbols($compunit.handle.globalish-package); CATCH { #X::Eval::NoSuchLang.new(:$lang).throw; note $_; } } $p5 = ::("Inline::Perl5").default_perl5; } $p5.run: nqp::istype($code,Blob) ?? Blob.new($code).decode('utf8-c8') !! $code.Str; } proto sub EVALFILE($, *%) {*} multi sub EVALFILE($filename, :$lang = 'perl6') { EVAL slurp(:bin, $filename), :$lang, :context(CALLER::); } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Grammar.pm60000644000175000017500000000410513253717231015355 0ustar alexalexmy class Grammar is Match { method parse(\target, :$rule, :$args, Mu :$actions, :$filename) is raw { my $*LINEPOSCACHE; nqp::stmts( (my $grammar := self.new(:orig(target), |%_).set_actions($actions)), nqp::decont(nqp::getlexcaller('$/') = nqp::if( (my $cursor := nqp::if( $rule, nqp::if( $args, $grammar."$rule"(|$args.Capture), $grammar."$rule"() ), nqp::if( $args, $grammar.TOP(|$args.Capture), $grammar.TOP() ), )), nqp::stmts( (my $match := $cursor.MATCH), nqp::while( $match && nqp::isne_i( nqp::getattr_i(($match := $cursor.MATCH),Match,'$!pos'), target.chars ), $match := ($cursor := $cursor.'!cursor_next'()).MATCH ), $match || Nil ), Nil ) ) ) } method subparse(\target, :$rule, :$args, :$actions) is raw { nqp::stmts( (my $grammar := self.new(:orig(target), |%_).set_actions($actions)), nqp::decont(nqp::getlexcaller('$/') = nqp::if( $rule, nqp::if( $args, $grammar."$rule"(|$args.Capture).MATCH, $grammar."$rule"().MATCH, ), nqp::if( $args, $grammar.TOP(|$args.Capture).MATCH, $grammar.TOP().MATCH ), ) ) ) } method parsefile(Str(Cool) $filename, :$enc) is raw { nqp::decont(nqp::getlexcaller('$/') = nqp::if( nqp::elems(nqp::getattr(%_,Map,'$!storage')), self.parse($filename.IO.slurp(:$enc), :$filename, |%_), self.parse($filename.IO.slurp(:$enc), :$filename) )) } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Hash.pm60000644000175000017500000007341113253717231014660 0ustar alexalexmy class X::Invalid::ComputedValue { ... }; my class Hash { # declared in BOOTSTRAP # my class Hash is Map # has Mu $!descriptor; multi method WHICH(Hash:D:) { self.Mu::WHICH } multi method Hash(Hash:) { self } multi method Map(Hash:U:) { Map } multi method Map(Hash:D: :$view) { my $hash := nqp::getattr(self,Map,'$!storage'); # empty if nqp::not_i(nqp::defined($hash)) { nqp::create(Map) } # view, assuming no change in hash elsif $view { nqp::p6bindattrinvres(nqp::create(Map),Map,'$!storage',$hash) } # make cow copy else { my $map := nqp::hash; my \iter := nqp::iterator($hash); my str $key; nqp::while( iter, nqp::bindkey( $map, ($key = nqp::iterkey_s(nqp::shift(iter))), nqp::decont(nqp::atkey($hash,$key)) ) ); nqp::p6bindattrinvres(nqp::create(Map),Map,'$!storage',$map) } } method clone(Hash:D:) is raw { nqp::p6bindattrinvres( nqp::p6bindattrinvres( nqp::create(self),Map,'$!storage', nqp::clone(nqp::getattr(self,Map,'$!storage'))), Hash, '$!descriptor', nqp::isnull($!descriptor) ?? (nqp::null) !! nqp::clone($!descriptor)) } method !AT-KEY-CONTAINER(Str:D \key) is raw { nqp::p6bindattrinvres( (my \v := nqp::p6scalarfromdesc($!descriptor)), Scalar, '$!whence', -> { nqp::bindkey( nqp::if( nqp::isconcrete(nqp::getattr(self,Map,'$!storage')), nqp::getattr(self,Map,'$!storage'), nqp::bindattr(self,Map,'$!storage',nqp::hash) ),key,v) } ) } multi method AT-KEY(Hash:D: Str:D \key) is raw { nqp::if( nqp::isconcrete(nqp::getattr(self,Map,'$!storage')), nqp::ifnull( nqp::atkey(nqp::getattr(self,Map,'$!storage'),key), self!AT-KEY-CONTAINER(key) ), self!AT-KEY-CONTAINER(key) ) } multi method AT-KEY(Hash:D: \key) is raw { nqp::if( nqp::isconcrete(nqp::getattr(self,Map,'$!storage')), nqp::ifnull( nqp::atkey(nqp::getattr(self,Map,'$!storage'),key.Str), self!AT-KEY-CONTAINER(key.Str) ), self!AT-KEY-CONTAINER(key.Str) ) } multi method STORE_AT_KEY(Str:D \key, Mu \x --> Nil) { nqp::bindkey( nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key), (nqp::p6scalarfromdesc($!descriptor) = x), ) } multi method STORE_AT_KEY(\key, Mu \x --> Nil) { nqp::bindkey( nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key.Str), (nqp::p6scalarfromdesc($!descriptor) = x), ) } multi method ASSIGN-KEY(Hash:D: Str:D \key, Mu \assignval) is raw { nqp::if( nqp::getattr(self,Map,'$!storage').DEFINITE, (nqp::ifnull( nqp::atkey( nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key) ), nqp::bindkey( nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key), nqp::p6scalarfromdesc($!descriptor) ) ) = assignval), nqp::bindkey( nqp::bindattr(self,Map,'$!storage',nqp::hash), nqp::unbox_s(key), nqp::p6scalarfromdesc($!descriptor) = assignval ) ) } multi method ASSIGN-KEY(Hash:D: \key, Mu \assignval) is raw { nqp::if( nqp::getattr(self,Map,'$!storage').DEFINITE, (nqp::ifnull( nqp::atkey( nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key.Str) ), nqp::bindkey( nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key.Str), nqp::p6scalarfromdesc($!descriptor) ) ) = assignval), nqp::bindkey( nqp::bindattr(self,Map,'$!storage',nqp::hash), nqp::unbox_s(key.Str), nqp::p6scalarfromdesc($!descriptor) = assignval ) ) } # for some reason, this can't be turned into a multi without # making setting compilation get very confused indeed method BIND-KEY(Hash:D: \key, Mu \bindval) is raw { nqp::bindattr(self,Map,'$!storage',nqp::hash) unless nqp::defined(nqp::getattr(self,Map,'$!storage')); nqp::bindkey(nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(nqp::istype(key,Str) ?? key !! key.Str), bindval) } multi method DELETE-KEY(Hash:U: --> Nil) { } multi method DELETE-KEY(Hash:D: Str:D \key) { nqp::if( (nqp::getattr(self,Map,'$!storage').DEFINITE && nqp::existskey(nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key))), nqp::stmts( (my $value = nqp::atkey(nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key))), nqp::deletekey(nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key)), $value ), nqp::p6scalarfromdesc($!descriptor) ) } multi method DELETE-KEY(Hash:D: \key) { nqp::stmts( (my str $key = nqp::unbox_s(key.Str)), nqp::if( (nqp::getattr(self,Map,'$!storage').DEFINITE && nqp::existskey(nqp::getattr(self,Map,'$!storage'),$key)), nqp::stmts( (my $value = nqp::atkey(nqp::getattr(self,Map,'$!storage'),$key)), nqp::deletekey(nqp::getattr(self,Map,'$!storage'),$key), $value ), nqp::p6scalarfromdesc($!descriptor) ) ) } multi method perl(Hash:D \SELF:) { SELF.perlseen(self.^name, { '$' x nqp::iscont(SELF) # self is always deconted ~ '{' ~ self.sort.map({.perl}).join(', ') ~ '}' }) } multi method gist(Hash:D:) { self.gistseen(self.^name, { '{' ~ self.sort.map({ state $i = 0; ++$i == 101 ?? '...' !! $i == 102 ?? last() !! .gist }).join(', ') ~ '}' }) } multi method DUMP(Hash:D: :$indent-step = 4, :%ctx) { nqp::if( %ctx, self.DUMP-OBJECT-ATTRS( nqp::list( '$!descriptor', $!descriptor, '$!storage', nqp::getattr(nqp::decont(self),Map,'$!storage') ), :$indent-step, :%ctx ), DUMP(self, :$indent-step) ) } # introspection method name() { nqp::isnull($!descriptor) ?? Nil !! $!descriptor.name } method keyof() { Str(Any) } method of() { nqp::isnull($!descriptor) ?? Mu !! $!descriptor.of } method default() { nqp::isnull($!descriptor) ?? Any !! $!descriptor.default } method dynamic() { nqp::isnull($!descriptor) ?? False !! nqp::p6bool($!descriptor.dynamic) } method push(+values) { fail X::Cannot::Lazy.new(:action, :what(self.^name)) if values.is-lazy; my $previous; my int $has_previous = 0; nqp::if( $has_previous, nqp::stmts( self!_push_construct($previous,$_), ($has_previous = 0) ), nqp::if( nqp::istype($_,Pair), self!_push_construct(.key,.value), nqp::stmts( ($previous := $_), ($has_previous = 1) ) ) ) for values; warn "Trailing item in {self.^name}.push" if $has_previous; self } method append(+values) { fail X::Cannot::Lazy.new(:action, :what(self.^name)) if values.is-lazy; my $previous; my int $has_previous = 0; nqp::if( $has_previous, nqp::stmts( self!_append_construct($previous,$_), ($has_previous = 0) ), nqp::if( nqp::istype($_,Pair), self!_append_construct(.key,.value), nqp::stmts( ($previous := $_), ($has_previous = 1) ) ) ) for values; warn "Trailing item in {self.^name}.append" if $has_previous; self } proto method classify-list(|) {*} multi method classify-list( &test, \list, :&as ) { fail X::Cannot::Lazy.new(:action) if list.is-lazy; my \iter = (nqp::istype(list, Iterable) ?? list !! list.list).iterator; my $value := iter.pull-one; unless $value =:= IterationEnd { my $tested := test($value); # multi-level classify if nqp::istype($tested, Iterable) { my $els = $tested.elems; loop { my @keys = @$tested; @keys == $els or X::Invalid::ComputedValue.new( :name, :method, :value('an item with different number of elements ' ~ 'in it than previous items'), :reason('all values need to have the same number ' ~ 'of elements. Mixed-level classification is ' ~ 'not supported.'), ).throw; my $last := @keys.pop; my $hash = self; $hash = $hash{$_} //= self.new for @keys; $hash{$last}.push(&as ?? as($value) !! $value); last if ($value := iter.pull-one) =:= IterationEnd; $tested := test($value); }; } # just a simple classify else { loop { self{$tested}.push(&as ?? as($value) !! $value); last if ($value := iter.pull-one) =:= IterationEnd; nqp::istype(($tested := test($value)), Iterable) and X::Invalid::ComputedValue.new( :name, :method, :value('an item with different number of elements ' ~ 'in it than previous items'), :reason('all values need to have the same number ' ~ 'of elements. Mixed-level classification is ' ~ 'not supported.'), ).throw; }; } } self; } multi method classify-list( %test, |c ) { self.classify-list( { %test{$^a} }, |c ); } multi method classify-list( @test, |c ) { self.classify-list( { @test[$^a] }, |c ); } multi method classify-list(&test, **@list, |c) { self.classify-list(&test, @list, |c); } proto method categorize-list(|) {*} multi method categorize-list( &test, \list, :&as ) { fail X::Cannot::Lazy.new(:action) if list.is-lazy; my \iter = (nqp::istype(list, Iterable) ?? list !! list.list).iterator; my $value := iter.pull-one; unless $value =:= IterationEnd { my $tested := test($value); # multi-level categorize if nqp::istype($tested[0],Iterable) { my $els = $tested[0].elems; loop { for $tested.cache -> $cat { my @keys = @$cat or next; my $last := @keys.pop; my $hash = self; $hash = $hash{$_} //= self.new for @keys; $hash{$last}.push(&as ?? as($value) !! $value); } last if ($value := iter.pull-one) =:= IterationEnd; $tested := test($value); nqp::istype($tested[0],Iterable) and $els == $tested[0] or X::Invalid::ComputedValue.new( :name, :method, :value('an item with different number of elements ' ~ 'in it than previous items'), :reason('all values need to have the same number ' ~ 'of elements. Mixed-level classification is ' ~ 'not supported.'), ).throw; } } # simple categorize else { loop { self{$_}.push(&as ?? as($value) !! $value) for @$tested; last if ($value := iter.pull-one) =:= IterationEnd; nqp::istype(($tested := test($value))[0], Iterable) and X::Invalid::ComputedValue.new( :name, :method, :value('an item with different number of elements ' ~ 'in it than previous items'), :reason('all values need to have the same number ' ~ 'of elements. Mixed-level classification is ' ~ 'not supported.'), ).throw; }; } } self; } multi method categorize-list( %test, |c ) { self.categorize-list( { %test{$^a} }, |c ); } multi method categorize-list( @test, |c ) { self.categorize-list( { @test[$^a] }, |c ); } multi method categorize-list( &test, **@list, |c ) { self.categorize-list( &test, @list, |c ); } # push a value onto a hash slot, constructing an array if necessary method !_push_construct(Mu $key, Mu \value --> Nil) { self.EXISTS-KEY($key) ?? self.AT-KEY($key).^isa(Array) ?? self.AT-KEY($key).push(value) !! self.ASSIGN-KEY($key,[self.AT-KEY($key),value]) !! self.ASSIGN-KEY($key,value) } # append values into a hash slot, constructing an array if necessary method !_append_construct(Mu $key, Mu \value --> Nil) { self.EXISTS-KEY($key) ?? self.AT-KEY($key).^isa(Array) ?? self.AT-KEY($key).append(|value) !! self.ASSIGN-KEY($key,[|self.AT-KEY($key),|value]) !! self.ASSIGN-KEY($key,value) } my role TypedHash[::TValue] does Associative[TValue] { # These ASSIGN-KEY candidates are only needed because of: # my Int %h; try %h = "foo"; dd %h # leaving an uninitialized Int for key in the hash. If # we could live with that, then these candidates can be # removed. However, there are spectest covering this # eventuality, so to appease roast, we need these. multi method ASSIGN-KEY(::?CLASS:D: Str:D \key, Mu \assignval) is raw { nqp::if( nqp::getattr(self,Map,'$!storage').DEFINITE, nqp::if( nqp::existskey( nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key) ), (nqp::atkey( nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key) ) = assignval), nqp::bindkey( nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key), nqp::p6scalarfromdesc( nqp::getattr(self,Hash,'$!descriptor')) = assignval ) ), nqp::bindkey( nqp::bindattr(self,Map,'$!storage',nqp::hash), nqp::unbox_s(key), nqp::p6scalarfromdesc( nqp::getattr(self,Hash,'$!descriptor')) = assignval ) ) } multi method ASSIGN-KEY(::?CLASS:D: \key, Mu \assignval) is raw { nqp::stmts( (my str $key = nqp::unbox_s(key.Str)), nqp::if( nqp::getattr(self,Map,'$!storage').DEFINITE, nqp::if( nqp::existskey( nqp::getattr(self,Map,'$!storage'), $key ), (nqp::atkey( nqp::getattr(self,Map,'$!storage'), $key ) = assignval), nqp::bindkey( nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key.Str), nqp::p6scalarfromdesc( nqp::getattr(self,Hash,'$!descriptor')) = assignval ) ), nqp::bindkey( nqp::bindattr(self,Map,'$!storage',nqp::hash), $key, nqp::p6scalarfromdesc( nqp::getattr(self,Hash,'$!descriptor')) = assignval ) ) ) } multi method perl(::?CLASS:D \SELF:) { SELF.perlseen('Hash', { '$' x nqp::iscont(SELF) # self is always deconted ~ (self.elems ?? "(my {TValue.perl} % = { self.sort.map({.perl}).join(', ') })" !! "(my {TValue.perl} %)" ) }) } } my role TypedHash[::TValue, ::TKey] does Associative[TValue] { method keyof () { TKey } method AT-KEY(::?CLASS:D: TKey \key) is raw { nqp::if( nqp::getattr(self,Map,'$!storage').DEFINITE, nqp::if( nqp::existskey(nqp::getattr(self,Map,'$!storage'), (my str $which = nqp::unbox_s(key.WHICH))), nqp::getattr( nqp::atkey(nqp::getattr(self,Map,'$!storage'),$which), Pair,'$!value'), nqp::p6bindattrinvres( (my \v := nqp::p6scalarfromdesc( nqp::getattr(self,Hash,'$!descriptor'))), Scalar, '$!whence', -> { nqp::bindkey(nqp::getattr(self,Map,'$!storage'), $which,Pair.new(key,v)); v } ) ), nqp::p6bindattrinvres( (my \vv := nqp::p6scalarfromdesc( nqp::getattr(self,Hash,'$!descriptor'))), Scalar, '$!whence', -> { nqp::bindkey( nqp::if( nqp::getattr(self,Map,'$!storage').DEFINITE, nqp::getattr(self,Map,'$!storage'), nqp::bindattr(self,Map,'$!storage',nqp::hash) ), nqp::unbox_s(key.WHICH), Pair.new(key,vv)); vv } ) ) } method STORE_AT_KEY(TKey \key, TValue \x --> Nil) { nqp::bindkey( nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key.WHICH), Pair.new( key, nqp::p6scalarfromdesc(nqp::getattr(self,Hash,'$!descriptor')) = x ) ) } method ASSIGN-KEY(::?CLASS:D: TKey \key, TValue \assignval) is raw { nqp::if( nqp::getattr(self,Map,'$!storage').DEFINITE, nqp::if( nqp::existskey(nqp::getattr(self,Map,'$!storage'), my str $which = nqp::unbox_s(key.WHICH)), (nqp::getattr( nqp::atkey(nqp::getattr(self,Map,'$!storage'),$which), Pair,'$!value') = assignval), nqp::getattr( (nqp::bindkey(nqp::getattr(self,Map,'$!storage'),$which, Pair.new(key,nqp::p6scalarfromdesc( nqp::getattr(self,Hash,'$!descriptor')) = assignval))), Pair,'$!value') ), nqp::getattr( (nqp::bindkey(nqp::bindattr(self,Map,'$!storage',nqp::hash), nqp::unbox_s(key.WHICH), Pair.new(key,nqp::p6scalarfromdesc( nqp::getattr(self,Hash,'$!descriptor')) = assignval))), Pair,'$!value') ) } method BIND-KEY(TKey \key, TValue \bindval) is raw { nqp::getattr( nqp::if( nqp::getattr(self,Map,'$!storage').DEFINITE, nqp::bindkey(nqp::getattr(self,Map,'$!storage'), nqp::unbox_s(key.WHICH), Pair.new(key,bindval)), nqp::bindkey(nqp::bindattr(self,Map,'$!storage',nqp::hash), nqp::unbox_s(key.WHICH), Pair.new(key,bindval)) ), Pair,'$!value' ) } method EXISTS-KEY(TKey \key) { nqp::p6bool( nqp::defined(nqp::getattr(self,Map,'$!storage')) && nqp::existskey(nqp::getattr(self,Map,'$!storage'),key.WHICH) ) } method DELETE-KEY(TKey \key) { nqp::if( (nqp::getattr(self,Map,'$!storage').DEFINITE && nqp::existskey(nqp::getattr(self,Map,'$!storage'), (my str $which = key.WHICH))), nqp::stmts( (my TValue $value = nqp::getattr( nqp::atkey(nqp::getattr(self,Map,'$!storage'),$which), Pair,'$!value')), nqp::deletekey(nqp::getattr(self,Map,'$!storage'),$which), $value ), TValue ) } method FLATTENABLE_HASH() { nqp::stmts( (my $flattened := nqp::hash), nqp::if( (my $raw := nqp::getattr(self,Map,'$!storage')) && (my $iter := nqp::iterator($raw)), nqp::while( $iter, nqp::bindkey( $flattened, nqp::if( nqp::istype( (my $key := nqp::getattr( nqp::iterval(nqp::shift($iter)), Pair, '$!key' )), Str, ), $key, $key.Str ), nqp::getattr(nqp::iterval($iter),Pair,'$!value') ) ) ), $flattened ) } method IterationBuffer() { nqp::stmts( (my $buffer := nqp::create(IterationBuffer)), nqp::if( nqp::defined( nqp::getattr(self,Map,'$!storage') ) && nqp::elems( nqp::getattr(self,Map,'$!storage') ), nqp::stmts( (my $iterator := nqp::iterator( nqp::getattr(self,Map,'$!storage') )), nqp::setelems($buffer,nqp::elems( nqp::getattr(self,Map,'$!storage') )), (my int $i = -1), nqp::while( $iterator, nqp::bindpos($buffer,($i = nqp::add_i($i,1)), nqp::iterval(nqp::shift($iterator))) ) ) ), $buffer ) } method keys() { Seq.new(class :: does Rakudo::Iterator::Mappy { method pull-one() { nqp::if( $!iter, nqp::getattr(nqp::iterval(nqp::shift($!iter)), Pair,'$!key'), IterationEnd ) } }.new(self)) } method values() { Seq.new(class :: does Rakudo::Iterator::Mappy { method pull-one() { nqp::if( $!iter, nqp::getattr(nqp::iterval(nqp::shift($!iter)), Pair,'$!value'), IterationEnd ) } }.new(self)) } method kv() { Seq.new(Rakudo::Iterator.Mappy-kv-from-pairs(self)) } method iterator() { Rakudo::Iterator.Mappy-values(self) } method antipairs() { Seq.new(class :: does Rakudo::Iterator::Mappy { method pull-one() { nqp::if( $!iter, nqp::iterval(nqp::shift($!iter)).antipair, IterationEnd ) } }.new(self)) } multi method roll(::?CLASS:D:) { nqp::if( (my $raw := nqp::getattr(self,Map,'$!storage')) && nqp::elems($raw), nqp::stmts( (my int $i = nqp::add_i(nqp::elems($raw).rand.floor,1)), (my $iter := nqp::iterator($raw)), nqp::while( nqp::shift($iter) && ($i = nqp::sub_i($i,1)), nqp::null ), nqp::iterval($iter) ), Nil ) } multi method roll(::?CLASS:D: Callable:D $calculate) { self.roll( $calculate(self.elems) ) } multi method roll(::?CLASS:D: Whatever $) { self.roll(Inf) } multi method roll(::?CLASS:D: $count) { Seq.new(nqp::if( (my $raw := nqp::getattr(self,Map,'$!storage')) && nqp::elems($raw) && $count > 0, class :: does Iterator { has $!storage; has $!keys; has $!count; method !SET-SELF(\hash,\count) { nqp::stmts( ($!storage := nqp::getattr(hash,Map,'$!storage')), ($!count = $count), (my $iter := nqp::iterator($!storage)), ($!keys := nqp::list_s), nqp::while( $iter, nqp::push_s($!keys,nqp::iterkey_s(nqp::shift($iter))) ), self ) } method new(\h,\c) { nqp::create(self)!SET-SELF(h,c) } method pull-one() { nqp::if( $!count, nqp::stmts( --$!count, # must be HLL to handle Inf nqp::atkey( $!storage, nqp::atpos_s($!keys,nqp::elems($!keys).rand.floor) ) ), IterationEnd ) } method is-lazy() { $!count == Inf } }.new(self,$count), Rakudo::Iterator.Empty )) } multi method perl(::?CLASS:D \SELF:) { SELF.perlseen('Hash', { my $TKey-perl := TKey.perl; my $TValue-perl := TValue.perl; $TKey-perl eq 'Any' && $TValue-perl eq 'Mu' ?? ( '$(' x nqp::iscont(SELF) ~ ':{' ~ SELF.sort.map({.perl}).join(', ') ~ '}' ~ ')' x nqp::iscont(SELF) ) !! '$' x nqp::iscont(SELF) ~ (self.elems ?? "(my $TValue-perl %\{$TKey-perl\} = { self.sort.map({.perl}).join(', ') })" !! "(my $TValue-perl %\{$TKey-perl\})" ) }) } # gotta force capture keys to strings or binder fails method Capture() { nqp::defined(nqp::getattr(self,Map,'$!storage')) ?? do { my $cap := nqp::create(Capture); my $h := nqp::hash(); for self.kv -> \k, \v { nqp::bindkey($h, nqp::unbox_s(nqp::istype(k,Str) ?? k !! k.Str), v) } nqp::bindattr($cap,Capture,'%!hash',$h); $cap } !! nqp::create(Capture) } method Map() { self.pairs.Map } } method ^parameterize(Mu:U \hash, Mu:U \t, |c) { if c.elems == 0 { my $what := hash.^mixin(TypedHash[t]); # needs to be done in COMPOSE phaser when that works $what.^set_name("{hash.^name}[{t.^name}]"); $what; } elsif c.elems == 1 { my $what := hash.^mixin(TypedHash[t, c[0].WHAT]); # needs to be done in COMPOSE phaser when that works $what.^set_name("{hash.^name}[{t.^name},{c[0].^name}]"); $what; } else { die "Can only type-constrain Hash with [ValueType] or [ValueType,KeyType]"; } } } proto sub circumfix:<{ }>(|) {*} multi sub circumfix:<{ }>(*@elems) { my % = @elems } # XXX parse dies with 'don't change grammar in the setting, please!' # with ordinary sub declaration #sub circumfix:<:{ }>(*@elems) { Hash.^parameterize(Mu,Any).new(@elems) } BEGIN my &circumfix:<:{ }> = sub (*@e) { Hash.^parameterize(Mu,Any).new(@e) } proto sub hash(|) {*} multi sub hash(*%h) { %h } multi sub hash(*@a, *%h) { my % = flat @a, %h } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/hash_slice.pm60000644000175000017500000002150013253717231016067 0ustar alexalex# all sub postcircumfix {} candidates here please proto sub postcircumfix:<{ }>(|) is nodal {*} # %h multi sub postcircumfix:<{ }>( \SELF, \key ) is raw { SELF.AT-KEY(key); } multi sub postcircumfix:<{ }>(\SELF, \key, Mu \ASSIGN) is raw { SELF.ASSIGN-KEY(key, ASSIGN); } multi sub postcircumfix:<{ }>(\SELF, \key, Mu :$BIND! is raw) is raw { SELF.BIND-KEY(key, $BIND); } multi sub postcircumfix:<{ }>( \SELF, \key, :$delete!, *%other ) is raw { nqp::if( $delete && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))), SELF.DELETE-KEY(key), SLICE_ONE_HASH( SELF, key, 'delete', $delete, %other ) ) } multi sub postcircumfix:<{ }>( \SELF, \key, :$exists!, *%other ) is raw { nqp::if( $exists && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))), SELF.EXISTS-KEY(key), SLICE_ONE_HASH( SELF, key, 'exists', $exists, %other ) ) } multi sub postcircumfix:<{ }>( \SELF, \key, :$kv!, *%other ) is raw { $kv && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-KEY(key) ?? (key,SELF.AT-KEY(key)) !! ()) !! SLICE_ONE_HASH( SELF, key, 'kv', $kv, %other ); } multi sub postcircumfix:<{ }>( \SELF, \key, :$p!, *%other ) is raw { $p && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-KEY(key) ?? Pair.new(key,SELF.AT-KEY(key)) !! ()) !! SLICE_ONE_HASH( SELF, key, 'p', $p, %other ); } multi sub postcircumfix:<{ }>( \SELF, \key, :$k!, *%other ) is raw { $k && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-KEY(key) ?? key !! ()) !! SLICE_ONE_HASH( SELF, key, 'k', $k, %other ); } multi sub postcircumfix:<{ }>( \SELF, \key, :$v!, *%other ) is raw { $v && nqp::not_i(nqp::elems(nqp::getattr(%other,Map,'$!storage'))) ?? (SELF.EXISTS-KEY(key) ?? nqp::decont(SELF.AT-KEY(key)) !! ()) !! SLICE_ONE_HASH( SELF, key, 'v', $v, %other ); } # %h multi sub postcircumfix:<{ }>( \SELF, Iterable \key ) is raw { nqp::iscont(key) ?? SELF.AT-KEY(key) !! key.flatmap({ SELF{$_} }).eager.list; } multi sub postcircumfix:<{ }>(\SELF, Iterable \key, Mu \ASSIGN) is raw { nqp::iscont(key) ?? SELF.ASSIGN-KEY(key, ASSIGN) !! (key.flatmap({ SELF{$_} }).eager.list = ASSIGN) } multi sub postcircumfix:<{ }>(\SELF, Iterable \key, :$BIND!) is raw { X::Bind::Slice.new(type => SELF.WHAT).throw; } multi sub postcircumfix:<{ }>(\SELF,Iterable \key, :$delete!,*%other) is raw { nqp::iscont(key) ?? SLICE_ONE_HASH( SELF, key, 'delete', $delete, %other ) !! SLICE_MORE_HASH( SELF, key, 'delete', $delete, %other ) } multi sub postcircumfix:<{ }>(\SELF,Iterable \key, :$exists!,*%other) is raw { nqp::iscont(key) ?? SLICE_ONE_HASH( SELF, key, 'exists', $exists, %other ) !! SLICE_MORE_HASH( SELF, key, 'exists', $exists, %other ) } multi sub postcircumfix:<{ }>(\SELF, Iterable \key, :$kv!, *%other) is raw { nqp::iscont(key) ?? SLICE_ONE_HASH( SELF, key, 'kv', $kv, %other ) !! SLICE_MORE_HASH( SELF, key, 'kv', $kv, %other ) } multi sub postcircumfix:<{ }>(\SELF, Iterable \key, :$p!, *%other) is raw { nqp::iscont(key) ?? SLICE_ONE_HASH( SELF, key, 'p', $p, %other ) !! SLICE_MORE_HASH( SELF, key, 'p', $p, %other ) } multi sub postcircumfix:<{ }>(\SELF, Iterable \key, :$k!, *%other) is raw { nqp::iscont(key) ?? SLICE_ONE_HASH( SELF, key, 'k', $k, %other ) !! SLICE_MORE_HASH( SELF, key, 'k', $k, %other ) } multi sub postcircumfix:<{ }>(\SELF, Iterable \key, :$v!, *%other) is raw { nqp::iscont(key) ?? SLICE_ONE_HASH( SELF, key, 'v', $v, %other ) !! SLICE_MORE_HASH( SELF, key, 'v', $v, %other ) } # %h{*} multi sub postcircumfix:<{ }>( \SELF, Whatever ) is raw { SELF{SELF.keys.list}; } multi sub postcircumfix:<{ }>(\SELF, Whatever, Mu \ASSIGN) is raw { die "Cannot assign to *, as the order of keys is non-deterministic"; } multi sub postcircumfix:<{ }>(\SELF, Whatever, :$BIND!) is raw { X::Bind::Slice.new(type => SELF.WHAT).throw; } multi sub postcircumfix:<{ }>(\SELF, Whatever, :$delete!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'delete', $delete, %other ); } multi sub postcircumfix:<{ }>(\SELF, Whatever, :$exists!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'exists', $exists, %other ); } multi sub postcircumfix:<{ }>(\SELF, Whatever, :$kv!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'kv', $kv, %other ); } multi sub postcircumfix:<{ }>(\SELF, Whatever, :$p!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'p', $p, %other ); } multi sub postcircumfix:<{ }>(\SELF, Whatever, :$k!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'k', $k, %other ); } multi sub postcircumfix:<{ }>(\SELF, Whatever, :$p!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'p', $p, %other ); } multi sub postcircumfix:<{ }>(\SELF, Whatever, :$v!, *%other) is raw { nqp::elems(nqp::getattr(%other,Map,'$!storage')) ?? SLICE_MORE_HASH( SELF, SELF.keys.list, 'v', $v, %other ) !! SELF{SELF.keys.list}; } # %h{} multi sub postcircumfix:<{ }>(\SELF, :$BIND!) is raw { X::Bind::ZenSlice.new(type => SELF.WHAT).throw; } multi sub postcircumfix:<{ }>(\SELF, :$delete!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'delete', $delete, %other ); } multi sub postcircumfix:<{ }>(\SELF, :$exists!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'exists', $exists, %other ); } multi sub postcircumfix:<{ }>(\SELF, :$kv!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'kv', $kv, %other ); } multi sub postcircumfix:<{ }>(\SELF, :$p!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'p', $p, %other ); } multi sub postcircumfix:<{ }>(\SELF, :$k!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'k', $k, %other ); } multi sub postcircumfix:<{ }>(\SELF, :$p!, *%other) is raw { SLICE_MORE_HASH( SELF, SELF.keys.list, 'p', $p, %other ); } multi sub postcircumfix:<{ }>(\SELF, :$v!, *%other) is raw { nqp::elems(nqp::getattr(%other,Map,'$!storage')) ?? SLICE_MORE_HASH( SELF, SELF.keys.list, 'v', $v, %other ) !! SELF{SELF.keys.list}; } multi sub postcircumfix:<{ }>( \SELF, *%other ) is raw { SELF.ZEN-KEY(|%other); } proto sub postcircumfix:<{; }>(|) is nodal {*} sub MD-HASH-SLICE-ONE-POSITION(\SELF, \indices, \idx, int $dim, \target) { my int $next-dim = $dim + 1; if $next-dim < indices.elems { if nqp::istype(idx, Iterable) && !nqp::iscont(idx) { for idx { MD-HASH-SLICE-ONE-POSITION(SELF, indices, $_, $dim, target) } } elsif nqp::istype(idx, Str) { MD-HASH-SLICE-ONE-POSITION(SELF.AT-KEY(idx), indices, indices.AT-POS($next-dim), $next-dim, target) } elsif nqp::istype(idx, Whatever) { for SELF.keys { MD-HASH-SLICE-ONE-POSITION(SELF.AT-KEY($_), indices, indices.AT-POS($next-dim), $next-dim, target) } } else { MD-HASH-SLICE-ONE-POSITION(SELF.AT-KEY(idx), indices, indices.AT-POS($next-dim), $next-dim, target) } } else { if nqp::istype(idx, Iterable) && !nqp::iscont(idx) { for idx { MD-HASH-SLICE-ONE-POSITION(SELF, indices, $_, $dim, target) } } elsif nqp::istype(idx, Str) { nqp::push(target, SELF.AT-KEY(idx)) } elsif nqp::istype(idx, Whatever) { for SELF.keys { nqp::push(target, SELF.AT-KEY($_)) } } else { nqp::push(target, SELF.AT-KEY(idx)) } } } multi sub postcircumfix:<{; }>(\SELF, @indices) { my \target = IterationBuffer.new; MD-HASH-SLICE-ONE-POSITION(SELF, @indices, @indices.AT-POS(0), 0, target); nqp::p6bindattrinvres(nqp::create(List), List, '$!reified', target) } multi sub postcircumfix:<{; }>(\SELF, @indices, :$exists!) { sub recurse-at-key(\SELF, \indices) { my \idx := indices[0]; my \exists := SELF.EXISTS-KEY(idx); nqp::if( nqp::istype(idx, Iterable), idx.map({ |recurse-at-key(SELF, ($_, |indices.skip.cache)) }).List, nqp::if( nqp::iseq_I(indices.elems, 1), exists, nqp::if( exists, recurse-at-key(SELF{idx}, indices.skip.cache), nqp::stmts( (my \times := indices.map({ .elems }).reduce(&[*])), nqp::if( nqp::iseq_I(times, 1), False, (False xx times).List ) ).head ) ) ); } recurse-at-key(SELF, @indices) } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/HyperConfiguration.pm60000644000175000017500000000034013253717231017603 0ustar alexalex# Configuration for hyper/race, controlling how we parallelize (number of # items at a time, and number of threads). my class HyperConfiguration { has int $.batch; has Int $.degree; } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/HyperSeq.pm60000644000175000017500000000237313253717231015534 0ustar alexalex# A HyperSeq performs batches of work in parallel, but retains order of output # values relative to input values. my class HyperSeq does Iterable does Sequence { has HyperConfiguration $.configuration; has Rakudo::Internals::HyperWorkStage $!work-stage-head; submethod BUILD(:$!configuration!, :$!work-stage-head!) {} method iterator(HyperSeq:D: --> Iterator) { my $joiner := Rakudo::Internals::HyperToIterator.new: source => $!work-stage-head; Rakudo::Internals::HyperPipeline.start($joiner, $!configuration); $joiner } method grep(HyperSeq:D: $matcher, *%options) { Rakudo::Internals::HyperRaceSharedImpl.grep: self, $!work-stage-head, $matcher, %options } method map(HyperSeq:D: $matcher, *%options) { Rakudo::Internals::HyperRaceSharedImpl.map: self, $!work-stage-head, $matcher, %options } method hyper(HyperSeq:D:) { self } method is-lazy() { False } method race(HyperSeq:D:) { RaceSeq.new(:$!configuration, :$!work-stage-head) } multi method serial(HyperSeq:D:) { self.Seq } method sink(--> Nil) { Rakudo::Internals::HyperRaceSharedImpl.sink(self, $!work-stage-head) } } # vim: ft=perl6 expandtab sw=4 rakudo-2018.03/src/core/Instant.pm60000644000175000017500000000746513253717231015423 0ustar alexalexmy class Date { ... } my class DateTime { ... } my class Duration {... } my class Instant is Cool does Real { has Rat $.tai; # A linear count of seconds since 1970-01-01T00:00:00Z, plus # Rakudo::Internals.initial-offset. Thus, $.tai matches TAI from 1970 # to the present. method SET-SELF($!tai) { self } # cannot be private because of operators method new(*@) { X::Cannot::New.new(class => self).throw } proto method from-posix(|) {*} multi method from-posix($posix) { nqp::create(Instant).SET-SELF( Rakudo::Internals.tai-from-posix($posix,0).Rat ) } multi method from-posix($posix, Bool $prefer-leap-second) { # $posix is in general not expected to be an integer. # If $prefer-leap-second is true, 915148800 is interpreted to # mean 1998-12-31T23:59:60Z rather than 1999-01-01T00:00:00Z. nqp::create(Instant).SET-SELF( Rakudo::Internals.tai-from-posix($posix,$prefer-leap-second).Rat ) } method to-posix() { # The inverse of .from-posix, except that the second return # value is true if *and only if* this Instant is in a leap # second. Rakudo::Internals.posix-from-tai($!tai) } multi method Str(Instant:D:) { 'Instant:' ~ $!tai } multi method perl(Instant:D:) { "Instant.from-posix{self.to-posix.perl}"; } method Bridge(Instant:D:) { $!tai.Bridge } method Num (Instant:D:) { $!tai.Num } method Rat (Instant:D:) { $!tai } method Int (Instant:D:) { $!tai.Int } method narrow(Instant:D:) { $!tai.narrow } method Date(Instant:D:) { Date.new(self) } method DateTime(Instant:D:) { DateTime.new(self) } method Instant() { self } # TODO: should be the new .gist, probably # method Str() { # 'Instant:' ~ default-formatter # ::DateTime.new(self), :subseconds # } } multi sub infix:«cmp»(Instant:D $a, Instant:D $b) { $a.tai <=> $b.tai } multi sub infix:«<=>»(Instant:D $a, Instant:D $b) { $a.tai <=> $b.tai } multi sub infix:«==»(Instant:D $a, Instant:D $b) { $a.tai == $b.tai } multi sub infix:«!=»(Instant:D $a, Instant:D $b) { $a.tai != $b.tai } multi sub infix:«<»(Instant:D $a, Instant:D $b) { $a.tai < $b.tai } multi sub infix:«>»(Instant:D $a, Instant:D $b) { $a.tai > $b.tai } multi sub infix:«<=»(Instant:D $a, Instant:D $b) { $a.tai <= $b.tai } multi sub infix:«>=»(Instant:D $a, Instant:D $b) { $a.tai >= $b.tai } multi sub infix:<+>(Instant:D $a, Real:D $b) { nqp::create(Instant).SET-SELF($a.tai + $b.Rat) } multi sub infix:<+>(Real:D $a, Instant:D $b) { nqp::create(Instant).SET-SELF($a.Rat + $b.tai) } multi sub infix:<+>(Instant:D $a, Duration:D $b) { nqp::create(Instant).SET-SELF($a.tai + $b.tai) } multi sub infix:<+>(Duration:D $a, Instant:D $b) { nqp::create(Instant).SET-SELF($a.tai + $b.tai) } multi sub infix:<->(Instant:D $a, Instant:D $b) { Duration.new: $a.tai - $b.tai; } multi sub infix:<->(Instant:D $a, Real:D $b) { nqp::create(Instant).SET-SELF($a.tai - $b.Rat) } sub term: