Charles Childers

blog | parable | retro | ios apps | fountain pens

Parable as a Service

I recently replaced the ika scripting interface with allegory, a single interface that provides both scripting and interactive modes in a single file. I've taken advantage of this to add some new facilities that will be useful in the future.

One of these is the ability to save and reload a snapshot of the Parable environment. I've done the core element of saving before (with apologue), though reloading is new. The biggest issue is the size. I'm using JSON, which works, but its far from compact. with my work on allegory I enhanced this by adding gzip compression. this reduces the data size to a few kilobytes instead of 1+ megabytes. To keep this easy to transmit I'm also using base64 to encode the compressed results as a string.

So what Ive done recently (while stuck in bed trying to recover from a flu) is implement a new apologue-based backend that takes and returns a Parable snapshot. So what I now have is a Parable as a Service thing that allows for at least potential interactivity over the network.

I haven't tied this into apologue yet, but have a proof of concept as an implementation of the standard listener that uses the new backend code. It works pretty well. There is still a lot that I'd like to do before I begin work on adding support for this into apologue. I want to have a larger API for working on data in a snapshot so that I can optionally offload work to the server and keep the client aide lighter.

For those who would like to try this, the code will be hitting the repository in a day or two.

(As an aside, this does not represent a focus shift: I'm continuing to work on getting an offline Parable environment that can be folded into Apologue. But having a richer online one will be of benefit until this is ready.)