<commit_before>---
layout:     post
title:      "These weeks in PlanetKit #5: bits and bobs"
date:       2016-11-18
summary:    Finding structure, preparing for movement, and learning a lot from Yasteroids.
tags:       rust planetkit specs slog
published:  true
---

PlanetKit is a project aimed at creating a toolkit for making interactive virtual worlds. I'm writing it in the Rust programming language, which I'm finding delightful to work with, and a great fit for the task.

It's been nearly a month since I last posted here, so I'm going to drop the pretense of it being a weekly blog. The main reason it's been so long is that I've been chipping away at a few unglamorous bits and pieces. So, alas, no pretty screenshots this week.


## What have I been up to?

A lot of my commits recently have been boring housekeeping:

- Split draw code out into its own module.
- Un-bundle meshes from Pipeline State Objects so I can share the PSOs across multiple meshes. This is more efficient, because it avoids loading a new shader program if multiple meshes could re-use the same program.
- Emit a separate mesh per chunk of the world in preparation for dynamically loading/unloading chunks.
- Turn PlanetKit into a library crate. (I haven't published it on [crates.io](https://crates.io) yet.)
- Add some structured logging using the `slog` crate. [<NAME> recently wrote about slog](https://siciarz.net/24-days-rust-structured-logging/) in his "24 days of Rust" series.

![Structured logging using slog](/images/these-weeks-5/slog-output.png)

The more interesting changes in the mix were...

## Keep the simple case simple

One of my core philosophies going into this project has been that the simple case should be simple. Here's the `main.rs` for my example:

{% highlight rust %}
extern crate planetkit as pk;

fn main() {
    let (mut app, mut window) = pk::simple::new();
    app.run(&mut window);<commit_msg>Fix TWIPK 5 date but preserve permalink<commit_after>---
layout:     post
title:      "These weeks in PlanetKit #5: bits and bobs"
date:       2016-12-19
permalink:  2016/11/18/twipk-5
summary:    Finding structure, preparing for movement, and learning a lot from Yasteroids.
tags:       rust planetkit specs slog
published:  true
---

**UPDATE**: I accidentally published this with the same date as the previous post. I've corrected the date above to 2016-12-19, but I'm leaving the incorrect date in the URL to preserve permalinks.

PlanetKit is a project aimed at creating a toolkit for making interactive virtual worlds. I'm writing it in the Rust programming language, which I'm finding delightful to work with, and a great fit for the task.

It's been nearly a month since I last posted here, so I'm going to drop the pretense of it being a weekly blog. The main reason it's been so long is that I've been chipping away at a few unglamorous bits and pieces. So, alas, no pretty screenshots this week.


## What have I been up to?

A lot of my commits recently have been boring housekeeping:

- Split draw code out into its own module.
- Un-bundle meshes from Pipeline State Objects so I can share the PSOs across multiple meshes. This is more efficient, because it avoids loading a new shader program if multiple meshes could re-use the same program.
- Emit a separate mesh per chunk of the world in preparation for dynamically loading/unloading chunks.
- Turn PlanetKit into a library crate. (I haven't published it on [crates.io](https://crates.io) yet.)
- Add some structured logging using the `slog` crate. [<NAME> recently wrote about slog](https://siciarz.net/24-days-rust-structured-logging/) in his "24 days of Rust" series.

![Structured logging using slog](/images/these-weeks-5/slog-output.png)

The more interesting changes in the mix were...

## Keep the simple case simple

One of my core philosophies going into this project has been that the simple case should be simple. Here's the `main.rs` for my example:

{% highlight rust %}
extern crate planetkit as pk;

fn main() {
    let (mut app, mut window) = pk::simple::new();
    app.run(&mut window);
{'fraction_non_alphanumeric': 0.07265166340508807, 'fraction_numerical': 0.011252446183953033, 'mean_word_length': 3.8505338078291813, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '490591', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1098, 'n_words': 607}