r/AskComputerScience • u/No_Necessary_9267 • Jun 30 '26
Machine language binary folding?
Been learning a bit about basic foundational computer hardware’s interactions with instruction data. Like, machine language instructions.
More specifically, I came across this whole rabbithole about data compression. Theoretically, there shouldn’t be a limit to how much we can compress data; accepting that quality may be lost… etc, etc.. Also at some point it will probably cost more energy to decode super heavy compressed data than is relatively necessary.
Right, so unrelated, a little while back, I was looking into the concept of protein folding and how instructions are encoded into proteins relating to biology.
My question is: hypothetically, theoretically, could we “fold” binary machine language instructions like nature does with proteins? Would it even be practical?
Can anyone provide any resources related?
(If relevant: Kindly, I won’t click links. If it’s a paper, tell me the name and author please.) thanks.
View all comments
Show parent comment
5
u/nuclear_splines Ph.D Data Science Jun 30 '26
Binary isn't a compression scheme, but an encoding scheme. Given a fixed number of bits, say, eight, you can only represent a finite number of values (for eight bits, 28 or 256). No further compression is possible - you need all eight bits to represent all 256 values.
Now maybe we can represent more common values with fewer bits and less common values with more bits (Huffman encoding), or maybe we can identify and simplify common patterns like "change 'xxxxx' to '5x'" (run-length encoding), or in the case of lossy compression we may decide that some data simply doesn't matter (did you really need all those frequencies close to the edge of human hearing in your music? Could we use just a few less colors to represent this image?) and delete or simplify some of the information. These techniques are useful in practice, but all have quite well-defined limits.
Put another way, if there were no limit to how much we can compress data, we should be able to simplify every image to a single digit: 1.