Skip to content

Commit

Permalink
more FAQ tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Nov 30, 2015
1 parent 1ce53ae commit 9e90d1d
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions doc/Language/faq.pod
Expand Up @@ -400,8 +400,7 @@ C<regex> declares a plain regex without any implied modifiers.
C<die> throws an exception.
C<fail> returns a C<Failure> object. (If the caller has declared C<use fatal;>
in the calling lexical scope, C<fail> instead throws an exception
instead of returning.)
in the calling lexical scope, C<fail> throws an exception instead of returning.)
A C<Failure> is an "unthrown" or "lazy" exception. It is an object that
contains the exception, and throws the exception if you try to use the C<Failure>
Expand All @@ -414,10 +413,10 @@ the exception with the C<exception> method.
Perl 5 has the C<wantarray> function that tells you whether it is called in
void, scalar or list context. Perl 6 has no equivalent construct,
because context does not flow inwards, i.e. a routine cannot know which
context it is called in.
because context does not flow inwards, i.e. a routine would need time travel to know which
context it is called in because context is lazy, known only when the results are used later.
One reason is that Perl 6 has multi dispatch, and in a code example like
For example, Perl 6 has multiple dispatch, so in a code example like
multi w(Int $x) { say 'Int' }
multi w(Str $x) { say 'Str' }
Expand All @@ -444,10 +443,8 @@ decision. As they (both the language and the implementations) evolve, they
grow steadily more usable. Depending on your demands on a programming
language, Perl 6 and its compilers might or might not be ready for you.
Please see the L<feature comparison
matrix|http://perl6.org/compilers/features> for an overview of implemented
features.
That said, version 6c (Christmas 2015) is the first official release of Perl 6
as a language, along with a validation suite and a compiler that passes it.
=head2 Why should I learn Perl 6? What's so great about it?
Expand All @@ -473,8 +470,7 @@ Unlike most languages, it offers
=item optional type annotations
=item powerful run-time multi dispatch for both subroutines and methods based on
arity, types and additional code constraints
=item powerful run-time multi dispatch for both subroutines and methods based on arity, types and additional code constraints
=item lexical imports
Expand Down Expand Up @@ -516,16 +512,15 @@ features.
That depends on what you are doing. Rakudo has been developed with the
philosophy of "make it work right then make it work fast". It's fast for some
things already but needs work on others.
Perl 6 is mostly being worked on by volunteers but it's expected that Perl 6
performance will improve in the near future since the MoarVM backend contains a
modern Just In Time (JIT) compiler.
Perl 5 programmers should be aware that Perl 6 comes with more built in in
terms of object orientation and much else. Simple benchmarks will be misleading
unless you include things like Moose, type checking modules etc. in your Perl 5
script.
things already but needs work on others. After the Christmas 2015 release stabilizes
the definition of the language, we'll be spending much of our effort on optimizing in 2016.
Since Perl 6 provides lots of clues to the JIT that other dynamic languages don't, we think
we'll have a lot of headroom for performance improvements. Some things already
run faster than Perl 5.
Perl 5 programmers should be aware that Perl 6 comes with more built-in
functionality. Simple benchmarks will be misleading unless you include
things like Moose, type checking modules etc. in your Perl 5 script.
The following crude benchmarks, with all the usual caveats about such things,
can show Perl 6 can be faster than Perl 5 for some similar common tasks if
Expand Down

0 comments on commit 9e90d1d

Please sign in to comment.