Garbage Collection in Parable

While working on adding the new type system to Parable I decided to rewrite the garbage collector. This has finally fixed some longstanding issues and will be very beneficial going forward.

The previous garbage collector was very simple: it scanned all named slices, appending all values they contained as probable references. Anything not in this set was then released. There were a few issues:

  • Without type information a lot of unneeded slices were being kept
  • The code to find references didn't always follow all dependent chains, so some neccessary slices were being discarded
  • Pointers on the stack were not scanned

These issues led to a number of bugs, and prevented me from making good use of the garbage collector. With the addition of type information it became possible to resolve these issues, and make it into a fully functional part of the language.

So the new approach is:

  • Scan all named slices for strings, comments, pointers, and function calls
  • Scan all references to pointers and function calls for the above types. Repeat until all nested references have been scanned
  • Repeat the above process for all values on the stack
  • Remove any duplicates
  • Release any allocated slices that are not in the above set

At this point everything is working. I haven't completely tested it, but it's certainly more stable than the previous implementation. Further work on this will be done as necessary, but for now I'm moving onto other tasks.

Revising the Parable Memory Model and Virtual Machine

I was nearly done. Parable (in the repository) was pretty stable, and I was nearing completion of the initial standard library. But recent events have prompted me to delve deep into the code again, making further changes to the entire underlying code.

Currently Parable is based on a heavily extended model derived from my work on Retro and Toka. It uses sliced memory and garbage collection like Toka (but with dynamic sizing of the slices), and a byte coded virtual machine like Retro. This works, but the big downside is that the Parable language supports types on the stack, but does not save them when storing. This becomes an issue in that the user needs to manually track and restore types when storing and fetching data.

I'm going to fix this. I'm adding a secondary set of slices which will shadow the data slices, storing the type information for each element. When I'm done, this will allow a bunch of benefits. The biggest ones for me are probably:

  • all quotations will be treatable as data structures
  • arrays, variables, etc will all store the types for each element stored
  • less code noise, since the user will no longer need to restore types when working with data stored in memory

I'll also be changing the parser a bit. It'll allow for numbers without the # prefix. After extensive use of Apologue with the "numbers without prefixes" option, I've decided that the convenience of using numbers directly is worth the slight tradeoffs.

I will probably push out one more interim Apologue release to fix bugs in the released version. Since the changes I'm making now are going to be extensive, I can't see holding up the bugfix release any longer. I won't be running a new beta of Apologue until the backend changes are completed.

Work on this has begun. To follow development, check the main Parable page and get a copy of the git repository.

Ink Notes

I've finally had a chance to try a couple of new inks. Some initial thoughts:

Kaweco Summer Purple: it's a bit lighter than the older Kaweco Aubergine Purple that I used previously. It's still a nice color, but it'll take some time to get used to. (I use this in my Kaweco Liliput).

The following were tested with a glass dip pen.

Rohrer & Klingner Scabiosa: this is pretty nice. It's a dark, dusty purple. With the dip pen it writes a nice, fairly wet line. I see some shading. The color reminds me a lot of the older Kaweco Aubergine Purple, though it's a little darker, and has a touch less blue.

Rohrer & Klingner Scalix: I typically find blues a bit boring. This isn't too bad: it tends towards a darker color, lightening up considerably as the ink on the nib is used up. The color is a pretty nice complement to Scabiosa.

I didn't get a chance to take any pictures of these yet; I'll try to post a followup in a few days with some pictures and maybe some further thoughts after I get a little more time using them.


I had my first rejection from Apple's App Review. I submitted an update to the Passphrase Generator which adds support for capitalizing the first character in each word. The update was rejected due to the reviewer not finding where to toggle this option. 

I've been keeping the settings in a bundle visible under the iOS Settings app.  When I resubmit (probably tonight), I'll include screenshots and clearer instructions on accessing these.