6
6
7
7
= head1 General
8
8
9
- = head2 What's the difference between Rakudo and Perl 6?
9
+ = head2 What's the difference between Rakudo and Perl 6?
10
10
11
- Rakudo is an implementation of Perl 6. It's currently the most developed, but
11
+ Rakudo is an implementation of Perl 6. It's currently the most developed, but
12
12
there have been other implementations in the past and should be others in the
13
13
future. Perl 6 is the definition of the language. Many times the two names will
14
14
be used loosely and interchangeably.
15
15
16
- = head2 As a Perl 6 beginner what should I install?
16
+ = head2 As a Perl 6 beginner what should I install?
17
17
18
18
If you are a Linux or Mac user you probably want to download Rakudo Star and
19
19
install via compilation (a simple process) the MoarVM version available from
@@ -30,27 +30,27 @@ parties. Although vendor versions may be outdated.
30
30
Install L < rakudobrew|https://github.com/tadzik/rakudobrew > which resembles
31
31
Perl 5's perlbrew and the equivalent Python and Ruby tools.
32
32
33
- = head2 Where can I find good documentation on Perl 6?
33
+ = head2 Where can I find good documentation on Perl 6?
34
34
35
35
The most reliable information is to be found either under the perl6.org domains or directly linked from it.
36
36
37
37
L < http://www.perl6.org/documentation/|http://www.perl6.org/documentation/ > with
38
38
L < http://doc.perl6.org/|http://doc.perl6.org/ > as the canonical technical reference.
39
39
40
40
There is much good recent material on Youtube but be careful to check any dates
41
- on webpages since much of the Perl 6 information on random websites found by
41
+ on webpages since much of the Perl 6 information on random websites found by
42
42
Google is often outdated.
43
43
44
44
You could also try searching the Freenode #perl6 IRC channel log via
45
45
L < Google|https://www.google.co.uk/search?q=site:irclog.perlgeek.de+inurl:perl6 >
46
46
47
- = head2 What is the Perl 6 spec?
47
+ = head2 What is the Perl 6 spec?
48
48
49
- The "spec" refers to the official test suite for Perl 6. It's called
49
+ The "spec" refers to the official test suite for Perl 6. It's called
50
50
roast and L < hosted on github|https://github.com/perl6/roast > . It
51
- is the measure of how complete a Perl 6 implementation is.
51
+ is the measure of how complete a Perl 6 implementation is.
52
52
53
- = head2 Is there a glossary of Perl 6 related terms?
53
+ = head2 Is there a glossary of Perl 6 related terms?
54
54
55
55
See L < S99|http://design.perl6.org/S99.html >
56
56
@@ -60,22 +60,22 @@ See the pod with the 5to6- prefix under L<http://doc.perl6.org/language.html|htt
60
60
61
61
= head1 Modules
62
62
63
- = head2 Is there a CPAN for Perl 6?
63
+ = head2 Is there a CPAN for Perl 6?
64
64
65
- There isn't yet a module repository for Perl 6 as sophisticated as CPAN. But
66
- L < modules.perl6.org|http://modules.perl6.org/ > has a list of known Perl 6
65
+ There isn't yet a module repository for Perl 6 as sophisticated as CPAN. But
66
+ L < modules.perl6.org|http://modules.perl6.org/ > has a list of known Perl 6
67
67
modules called the "ecosystem" hosted on github, and
68
68
L < panda|https://github.com/tadzik/panda/ > can install those that work with
69
69
L < rakudo|http://rakudo.org/ > .
70
70
71
- Support for installing Perl 6 modules from the Perl 5 CPAN is on its way.
71
+ Support for installing Perl 6 modules from the Perl 5 CPAN is on its way.
72
72
73
- = head2 Can I use Perl 5 modules from Perl 6?
73
+ = head2 Can I use Perl 5 modules from Perl 6?
74
74
75
75
Yes, with L < Inline::Perl5|https://github.com/niner/Inline-Perl5/ > , which works
76
76
well with most Perl 5 modules. It can even run Perl 5 Catalyst and DBI.
77
77
78
- = head2 Can I use C and C++ from Perl 6?
78
+ = head2 Can I use C and C++ from Perl 6?
79
79
80
80
L < Nativecall|http://docs.perl6.org/language/nativecall > makes this particularly easy.
81
81
@@ -98,7 +98,7 @@ and many more can be installed from the ecosystem.
98
98
99
99
= head1 Language Features
100
100
101
- = head2 How can I dump Perl 6 data structures (like Perl 5 Data::Dumper and similar)?
101
+ = head2 How can I dump Perl 6 data structures (like Perl 5 Data::Dumper and similar)?
102
102
103
103
Examples:
104
104
@@ -110,7 +110,7 @@ Examples:
110
110
There are also modules in the ecosystem to do this, like
111
111
L < Data::Dump|https://github.com/tony-o/perl6-data-dump/ > , which uses color.
112
112
113
- = head2 How can I get command line history in the perl 6 prompt (REPL)?
113
+ = head2 How can I get command line history in the Perl 6 prompt (REPL)?
114
114
115
115
Install L < Linenoise|https://github.com/hoelzro/p6-linenoise/ > from the
116
116
ecosystem.
@@ -143,7 +143,7 @@ Example:
143
143
say $foo # (Any) note the parens indicate type object
144
144
say $foo.^name # Any
145
145
146
- (Any) shouldn't be used to check for definedness. In Perl 6, definedness is a
146
+ (Any) shouldn't be used to check for definedness. In Perl 6, definedness is a
147
147
property of an object. Usually instances are defined and type objects are
148
148
undefined.
149
149
@@ -227,15 +227,15 @@ If you want to do it anyway, you can abuse autothreading for that:
227
227
228
228
In Perl 6, many basic types are immutable, but the variables holding them are
229
229
not. The C < s/// > operator works on a variable, into which it puts a newly
230
- creates string object. Likewise C < $i++ > works on the C < $i > variable, not
230
+ created string object. Likewise C < $i++ > works on the C < $i > variable, not
231
231
just on the value in it.
232
232
233
233
See the documentation on L < containers|/language/containers > for more
234
234
information.
235
235
236
236
= head2 What's up with array references and automatic dereferencing? Do I still need the C < @ > sigil?
237
237
238
- In Perl 6, nearly everything is a reference, so talking about taking
238
+ In Perl 6, nearly everything is a reference, so talking about taking
239
239
references doesn't make much sense. Unlike Perl 5, scalar variables
240
240
can also contain arrays directly:
241
241
@@ -280,9 +280,9 @@ There are several reasons:
280
280
= item many natural languages use mandatory noun markers, so our brains are built to handle it
281
281
282
282
283
- = head2 Does Perl 6 have coroutines? What about C < yield > ?
283
+ = head2 Does Perl 6 have coroutines? What about C < yield > ?
284
284
285
- Perl 6 has no C < yield > statement like python does, but it does offer similar
285
+ Perl 6 has no C < yield > statement like python does, but it does offer similar
286
286
functionality through lazy lists. There are two popular ways to write
287
287
routines that return lazy lists:
288
288
@@ -299,7 +299,7 @@ routines that return lazy lists:
299
299
300
300
= head2 Why can't I initialize private attributes from the new method, and how can I fix this?
301
301
302
- A code like
302
+ Code like
303
303
304
304
class A {
305
305
has $!x;
@@ -392,22 +392,22 @@ the exception with the C<exception> method.
392
392
= head2 Why is C < wantarray > or C < want > gone? Can I return different things in different contexts?
393
393
394
394
Perl 5 has the C < wantarray > function that tells you whether it is called in
395
- void, scalar or list context. Perl 6 has no equivalent construct,
395
+ void, scalar or list context. Perl 6 has no equivalent construct,
396
396
because context does not flow inwards, i.e. a routine cannot know which
397
397
context it is called in.
398
398
399
- One reason is that Perl 6 has multi dispatch, and in a code example like
399
+ One reason is that Perl 6 has multi dispatch, and in a code example like
400
400
401
401
multi w(Int $x) { say 'Int' }
402
402
multi w(Str $x) { say 'Str' }
403
403
w(f());
404
404
405
405
there is no way to determine if the caller of sub C < f > wants a string or
406
406
an integer, because it is not yet known what the caller is. In general
407
- this requires solving the halting problem, which even Perl 6 compiler
407
+ this requires solving the halting problem, which even Perl 6 compiler
408
408
writers have trouble with.
409
409
410
- The way to achieve context sensitivity in Perl 6 is to return an object
410
+ The way to achieve context sensitivity in Perl 6 is to return an object
411
411
that knows how to respond to method calls that are typical for a context.
412
412
413
413
For example regex matches return L < Match objects that know how to respond
@@ -416,21 +416,21 @@ string|/type/Match>.
416
416
417
417
= head1 Meta Questions and Advocacy
418
418
419
- = head2 When will Perl 6 be ready? Is it ready now?
419
+ = head2 When will Perl 6 be ready? Is it ready now?
420
420
421
421
Readiness of programming languages and their compilers is not a binary
422
422
decision. As they (both the language and the implementations) evolve, they
423
423
grow steadily more usable. Depending on your demands on a programming
424
- language, Perl 6 and its compilers might or might not be ready for you.
424
+ language, Perl 6 and its compilers might or might not be ready for you.
425
425
426
426
Please see the L < feature comparison
427
427
matrix|http://perl6.org/compilers/features > for an overview of implemented
428
428
features.
429
429
430
430
431
- = head2 Why should I learn Perl 6? What's so great about it?
431
+ = head2 Why should I learn Perl 6? What's so great about it?
432
432
433
- Perl 6 unifies many great ideas that aren't usually found in other programming
433
+ Perl 6 unifies many great ideas that aren't usually found in other programming
434
434
languages. While several other languages offer some of these features, none of
435
435
them offer all.
436
436
@@ -491,31 +491,31 @@ Please see the L<feature comparison
491
491
matrix|http://perl6.org/compilers/features > for an overview of implemented
492
492
features.
493
493
494
- = head2 Is Perl 6 fast enough for me?
494
+ = head2 Is Perl 6 fast enough for me?
495
495
496
496
That depends on what you are doing. Rakudo has been developed with the
497
497
philosophy of "make it work right then make it work fast". It's fast for some
498
498
things already but needs work on others.
499
499
500
- Perl 6 is mostly being worked on by volunteers but it's expected that Perl 6
500
+ Perl 6 is mostly being worked on by volunteers but it's expected that Perl 6
501
501
performance will improve in the near future since the MoarVM backend contains a
502
502
modern Just In Time (JIT) compiler.
503
503
504
- Perl 5 programmers should be aware that Perl 6 comes with more built in in
504
+ Perl 5 programmers should be aware that Perl 6 comes with more built in in
505
505
terms of object orientation and much else. Simple benchmarks will be misleading
506
506
unless you include things like Moose, type checking modules etc. in your Perl 5
507
507
script.
508
508
509
509
The following crude benchmarks, with all the usual caveats about such things,
510
- can show Perl 6 to be of roughly equivalent speed to Perl 5 for some similar
510
+ can show Perl 6 to be of roughly equivalent speed to Perl 5 for some similar
511
511
common tasks.
512
512
513
513
Try it on your system you may be pleasantly surprised!
514
514
515
515
Examples:
516
516
517
517
518
- # perl 6 version
518
+ # Perl 6 version
519
519
use v6;
520
520
521
521
class Foo { has $.i is rw};
@@ -526,7 +526,7 @@ Examples:
526
526
say $obj.i;
527
527
}
528
528
529
- # perl 5 version
529
+ # Perl 5 version
530
530
package Foo;
531
531
use 5.10.0;
532
532
use Moose;
0 commit comments