Question Policy

Mind The Unicode:

Perl 6 lets you use fancy-pants Unicode terms and operators that you'll see in this presentation. All of them have "Texas variants" that use ASCII characters only. If you rather use those, see http://docs.perl6.org/language/unicode_texas to find them.

Hyper Operators

Put » before the dot method call and the method you're calling will be called on individual elements instead.
Further methods in the chain will be called on the array (list, etc.), unless they're hypered as well.

BONUS: it's a compiler hint to use multiple threads.

Hyper Seqs

What if you want to "do stuff" on a bunch of things, but on multiple cores? Loop over a HyperSeq.
You get one by calling either:

.hyper—preserves element order

.race—does not preserve element order

Hyper Seqs

Iterate over a 4-element sequence, sleep for 1 second for each element:

BTW: A Safety Tip

NativeCall

NativeCall

int8 (int8_t in C, also used for char)
int16 (int16_t in C, also used for short)
int32 (int32_t in C, also used for int)
int64 (int64_t in C)
uint8 (uint8_t in C, also used for unsigned char)
uint16 (uint16_t in C, also used for unsigned short)
uint32 (uint32_t in C, also used for unsigned int)
uint64 (uint64_t in C)
long (long in C)
longlong (long long in C, at least 64-bit)
num32 (float in C)
num64 (double in C)
Str (C string)
CArray[int32] (int* in C, an array of ints)
Pointer[void] (void* in C, can point to all other types)
bool (bool from C99)
size_t (size_t in C)