Ignite

Photo of an Ignite-created ebook on a Kindle Paperwhite

I use an Amazon Kindle. Kindles do not support the standard, open source ePub format—they use proprietary & undocumented formats (.azw3, .mobi), so you have to convert ePub files before you can read them on a Kindle.

I read a lot of web serials, which means I'm often converting the same book a few times a month as new chapters come out.

The only way (besides of Amazon's cloud tool) to convert ePub files to Kindle-supported formats is Calibre. However, Calibre tends to be quite slow. Converting an ePub of The Wandering Inn created by leech takes over 40 minutes.

Although Calibre open source the codebase is very hard to contribute to. I also noticed that many people wanted to embed a converter in their applications, but unfortunately Calibre is difficult to embed due to requiring a Python interpreter and its focus on being a GUI application rather than a library.

I decided to try writing a from-scratch reader and writer for KF8/.azw3. I chose Rust because it's easy to embed and has a great ecosystem for binary serialization/deserialization.

The first step was implementing the custom compression format used by Kindle formats (a flavor of LZ77). My implementation is 300-400x faster than Calibre's.

The next step was deserialization (if I have a deserializer, it's easier to test a serializer). Parsing was tedious but not too difficult.

Writing the serializer is much more frusterating because there's no way to test created files besides loading them on a Kindle. If they're invalid, the Kindle will often freeze or crash. A created file that Calibre considers valid and parsable may still be invalid on a Kindle.

As of 01/25, I have a basic serializer that can convert a single chapter. I'm still working on getting it to work with an entire ePub. :)