I once found a really great article explaining arithmetic encoding¹, and I felt I understood what was going on and managed to re-implement the article's example from MS-DOS-era C to modern Python, but when I tried to use it for anything else it didn't work and I wasn't smart enough to debug it.
The claim that asymmetric numeral systems are simpler than arithmetic encoding is quite interesting, but as a working programmer, I have difficulty with the academic language and mathematical generality used in papers like this. Does anybody have a more approachable explanation of what's going on?
¹: http://marknelson.us/1991/02/01/arithmetic-coding-statistica...