Self Generating code does not just make life possible. It makes the periodic table of elements reality . It makes the electro-magnetic spectrum possible. It originates because of simple universal probability only because there are a large number of variables. That means that if you want or need a mathematic formula to prove it is relatively simple to do. We humans think we are especially blessed having consciousness and intelligence and think that the rest of the universe is unlucky in that regard even when we observe plants being able to react to stimuli and many animal species having built in instincts that result in predictable behaviors that help them succeed in living. We also see the same structure for galaxies near and far meaning that entropy is not the only force working. The universe has a sort of intelligence and possibly even 'consciousness' at least where we see activity.
How to start self generating code? string some atoms together using electromagnetic forces in chemistry. That is the start. That string is essentially not necessarily a molecule but just something like a motif. It can't necessarily reproduce it self but it can repeat the motif or make variations that theme. That's is a start for basic coding. The atoms come together as they can and do because of electromagnetic properties at the sub atomic level. which means there is a coding effect and that entire new chain of atoms can react with atoms and molecules outside of it in probabilistic ways depending on what can happen because of local proximity probabilities. So atoms are in communication with each other to make these "decisions" or events happen. We humans think we are the only ones who can write code for computers but nature can do it all on its own spontaneously self generating itself. All that code could be perfectly worthless but it really is an important start to a much larger process. Gravity itself is coded and that is the connection with electro magnetism. The radiometer proof shows how that is....where probability allows electrons to migrate away from nuclei creating higher and higher density. There is good reason the exterior of planets and the sun have a net "negative " charge. Basic code of atomic proximity leads to more complex code and then to code that can self replicate. It has to because of variability.