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.
20
u/nuclear_splines Ph.D Data Science Jun 30 '26
What? There absolutely is. The pigeonhole principle for discrete data, resolution limits and noise for continuous or analog data. The theoretical limits of compression are very well studied.
6
u/Beregolas Jun 30 '26
I mean, there is. You can't just assume "quality loss" is okay. I assume you learned about compression from images, where certain kinds of quality loss are allowable, especially if the image is just for human viewing. But you can't generalize that. Even in images, when it needs to be fed into a machine to further processing, you might not be in a position where anything less than a perfect compression/decompression is acceptable. Same goes for most files to be honest. And since you are talking about machine language later: ESPECIALLY when we talk about code, we can't accept any information loss (because that really is what quality loss means).
I don't follow... proteins are 3D structures, hence they can fold. What exactly do you envision folding in a 1D structure (code) to be?
2
u/stonerism Jun 30 '26
These are separate things. Protein folding has more to do predicting what a protein does given the sequence of amino acids in it.
In terms of compression there has to be a limit to compression. Think about it like this if you could compress every string by 10%, you'd have a problem because of the pidgeonhole principle, too many strings to map into too small a space of strings.
1
u/TartOk3387 Jun 30 '26
You might want to research Kolmogorov complexity
1
u/iOSCaleb Jun 30 '26
> My question is: hypothetically, theoretically, could we “fold” binary machine language instructions like nature does with proteins? Would it even be practical?
It’s not clear what that would mean or how it would be useful. Proteins fold in order to reach a stable state, and a protein’s function results directly from its folded shape. Folding isn’t a form of compression — a folded protein has exactly the same set of amino acids that it would if you could unfold it. Amino acids in a protein are more like Lego blocks than instructions: each one is important in creating the larger structure of the protein, but they don’t really function as individual instructions.
It’s easy to see a superficial resemblance between machine instructions and amino acids. They’re both relatively small sets of things that can be combined in endless ways to create complex structures. But we see that pattern a lot: atoms of different elements combine to form molecules; digits combine into numbers, which are then mixed with operations to form mathematical expressions; sequences of notes create complex melodies; letters combine to form words and then sentences. So don’t assume that this building block pattern that’s common to proteins and code means that there’s more similarity than that.