The {pnk}f(eli)x Blog

The informal ramblings of an ex-pat PL enthusiast

GC and Rust Part 1: Specifying the Problem

This is the first in a series of posts will discuss why garbage collection is hard, especially for Rust, and brainstorm about solutions to the problems we face.

The relationship between garbage collection (GC) and the Rust programming language has been an interesting one.

GC was originally deeply integrated into the language, complete with dedicated syntax (good old @T …). Over time the team found ways to lessen the dependency on GC, and then finally remove it from the language entirely.

However, we still want to provide support for garbage collection.

To explain why, I need to define the actual problems we seek to solve. So let us explore the problem space.

GC and Rust Part 0: Garbage Collection Background

This post is a prequel to a series of posts discussing why garbage collection is hard, especially for Rust, and brainstorming about solutions to the problems we face.

The goal of this post is to provide the background foundational material about Garbage Collection that the other posts will then build upon.

Vis-a-vis, Part 1: Visualizing Graphs via viz.js

This is a post discussing a couple different ways to draw pictures, mostly those of graphs (nodes and edges, i.e. circles or boxes, and lines between them).

The technology covered by this post is viz.js, a Javascript library for rendering graphs specified via the DOT language.

Updating Octopress post-Mavericks Upgrade.

I decided this morning to write a blog post related to Rust. I have not posted to this blog in months, and in the meantime I had upgraded this computer at home to Mac OS X Mavericks (10.9.2).

So of course my existing set of commands for Octopress workflow did not work.

Detective Work on Rust Closures

I have recently been trying to keep myself abreast of a flurry of discussion about reforming the design of Rust closures. Niko has a series of blog posts (1, 2, 3, 4, 5, 6, 7, 8); the content of some of those posts were further discussed at Rust team meetings (11, 12, 13, 14, 15, 16), and there have been some more formalized proposals with their own set of discussions: (9, 10).

There are also associated github issues (17, 18, 19), though without sufficient context the discussion in the github issues may not always be intelligible.

Some of the links above are more about “Dynamically Sized Types” (DST), a related topic, as we shall see.

This post is my attempt to condense all of this information down into something where I can see all the pieces at once, and discard the red herrings along the way.

Rusty Chain Puzzle 1.

I have been trying to get my feet wet programming in Rust.

A month and a half ago, I thought “Maybe I will hack up an Earley parser in a variety of languages, including Rust.” That sent me down a long path of learning about how Earley parsing works; I have not yet written up my results from that investigation, and I still have not written the Rust version of the code.

Last weekend, I sat down and said, “Let’s try a simpler goal: A couple simple exercies, maybe taken from Knuth’s TAOCP” This was indeed a much simpler goal, but it was more difficult than I had expected.

Implicit Versus Explicit Finalization

(This post is largely a response to Niko Matsakis’s blog post Destructors and Finalizers in Rust. I started composing it as a comment there, but eventually realized I needed more breathing room.)

I agree wholeheartedly with Niko’s statement that the Boehm paper “Destructors, Finalizers, and Synchronization” is a really nice discussion of this topic. However, a significant portion of the destructor/finalizer design space is only briefly discussed in that paper, and I worry that Niko’s post overlooks it.