All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Why bzip is the best compression algorithm for constrained environments like ComputerCraft

By

signa11

2mo ago· 8 min readenInsight

Summary

The article explores implementing the bzip compression algorithm in Lua for ComputerCraft, a Minecraft mod that allows programming in-game. The author explains why bzip, despite being outdated and criticized, is actually the best choice for this constrained environment due to its simplicity and compression ratio. The piece walks through implementing bzip's core components: Burrows-Wheeler Transform (BWT), Move-to-Front Transform (MTF), zero-length coding, and Huffman coding, all within Lua's limitations. The author argues that bzip's simplicity makes it ideal for scenarios where decoder size matters, such as in-game programming with limited disk space.

Key quotes

· 3 pulled
So the question becomes: what's the shortest, simplest, most ratio-efficient compression algorithm?
My answer is bzip, even though this algorithm has been critiqued multiple times and has fallen into obscurity since xz and zstd became popular.
I initially thought this was a complex question full of tradeoffs, but it turns out it's very clear-cut.
Snippet from the RSS feed
The story goes like this. ComputerCraft is a mod that adds programming to Minecraft. You write Lua code that gets executed by a bespoke interpreter with access to world APIs, and now you’re writing code instead of having fun. Computers have limited disk s

You might also wanna read