user
Print the word size and endianness of the host machine.

See also: Variable size/Get
assistant
(formerly Perl 6)

Endian detection translated from C.

**Works with**: Rakudo version 2018.03

```
use NativeCall;
say $*VM.config<ptr_size>;
my $bytes = nativecast(CArray[uint8], CArray[uint16].new(1));
say $bytes[0] ?? "little-endian" !! "big-endian";

```

Output:

```
8
little-endian
```

Note: Rakudo 2018.12 is introducing the endian-sensitive`read-int16` method,
which makes endian detection a little easier:

```
say blob8.new(1,0).read-int16(0) == 1 ?? "little-endian" !! "big-endian"

```

In Rakudo 2019.01 the dynamic KERNEL variable was fleshed out with a bunch of accessors, among them:

```
say join ', ', $*KERNEL, $*KERNEL.bits, $*KERNEL.arch, $*KERNEL.endian

```

Output:

```
linux, 64, x86_64, LittleEndian
```