<commit_before>{% import 'macros/ork.jinja' as ork with context %}

Boxes, Pointers, and ownership, oh my!
======================================

Since you program in Ruby, you probably don't know about pointers, nor care.
If you're going to work in a language like Rust, though, you gotta know about
them. So let's talk about the concept real quick, then discuss how Rust handles
pointers.

Pointer recap
-------------

When you create a variable, you're really giving a name to a chunk of
memory somewhere. We'll use C syntax for these examples:

``int i = 5; int j = 6;```

======== =====
location value
======== =====
0x000000 5
0x000001 6
======== =====

This is of course slightly simplified. Anyway, we can introduce indirection by
making a pointer:

``int i = 5; int j = 6; int *pi = &i;```

======== ========
location value
======== ========
0x000000 5
0x000001 6
0x000002 0x000000
======== ========

``pi`` has a pointer to another memory location. We can access the value of the
thing that ``pi`` points at by using the ``*``::

  printf("The value of the thing pi points to is: %d\n", *pi);

The ``*`` dereferences the pointer, and gives us the value. Simple!
<commit_msg>punctuation, thanks @colindean<commit_after>{% import 'macros/ork.jinja' as ork with context %}

Boxes, Pointers, and ownership, oh my!
======================================

Since you program in Ruby, you probably don't know about pointers, nor care.
If you're going to work in a language like Rust, though, you gotta know about
them. So let's talk about the concept real quick, then discuss how Rust handles
pointers.

Pointer recap
-------------

When you create a variable, you're really giving a name to a chunk of
memory somewhere. We'll use C syntax for these examples:

``int i = 5; int j = 6;``

======== =====
location value
======== =====
0x000000 5
0x000001 6
======== =====

This is of course slightly simplified. Anyway, we can introduce indirection by
making a pointer:

``int i = 5; int j = 6; int *pi = &i;``

======== ========
location value
======== ========
0x000000 5
0x000001 6
0x000002 0x000000
======== ========

``pi`` has a pointer to another memory location. We can access the value of the
thing that ``pi`` points at by using the ``*``::

  printf("The value of the thing pi points to is: %d\n", *pi);

The ``*`` dereferences the pointer, and gives us the value. Simple!

{'fraction_non_alphanumeric': 0.19119496855345913, 'fraction_numerical': 0.041928721174004195, 'mean_word_length': 4.198257080610022, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '723915', 'n_tokens_mistral': 793, 'n_tokens_neox': 674, 'n_words': 342}