Our serializer and deserializer in scrapscript.py are here. This handles serialization of recursive data structures using a reasonably compact encoding (including, for example, variable-length integers). It's not what Taylor originally envisioned, but it works pretty well.