I'm implementing virtual memory on dual cassette tape decks on a Commodore PET (for fun) for a Forth I'm writing. What I have so far is at http://github.com/chitselb/pettil if you're interested.
I'm planning to use the PET's native 192-byte cassette datafile format. Oh yeah, only 32K of RAM for everything. I have imbedded Woz's excellent and very memory-efficient Sweet-16 interpreter inside the language.
A Forth block is (typically) 1024 bytes. Adding two bytes for the block ID caps the available virtual address space at 64 meg, way more than what would fit on a tape. There would be a "play" deck (device 1) and a "record" deck (device 2) and the FLUSH would involve copying the entire virtual memory from one drive to the other. Why tilt at windmills? Because back in the day, cassette tape is what most PET owners had, self included.
Most of the data will be screens of Forth code, which in this implementation will be 1000 bytes of text and a 24-byte line-wrap table, since I'm leveraging the PET ROM screen editor too. What I'm looking for are suggestions for anything that will (probably) beat simple Run Length Encoding for this purpose, but without the CPU and memory overhead of something as complex as Lempel-Ziv. All suggestions other than "just forget it" are appreciated.