I've been reading some papers on lambda lifting. At its core, lambda lifting is the process of elevating (i.e. lifting) anonymous and inner lambda to the global scope, renaming and revising the program along the way. The end result is that the output will be functionally equivalent to the input, but that it will be more or less scopeless. It's interesting stuff for
someone who has never been inside the bowels of a compiler for a functional language before.
It does, however, bring a couple of things to mind. First, how hard it can be to find out on your own what is often considered basic in the field you are studying and secondly, how much more insight it can give you into the topic at hand.
The real reason that it can be so hard is that when you have a question, you don't know the answer and so you do not know in what form or direction it will come.
Take the example above. I understand the concept of lambda lifting and now I am trying to extract a
specific enough algorithm to code it in stage 1 of Ocean's compiler, but I didn't start out looking for lambda lifting material. I was reading Guy Steele's paper on Rabbit and the section that reviews the compilation strategy. I figured that, although compiler technology for functional programming had come a long way since then, that
it would be an excellent starting place. In that section, Steele casually says that the input Scheme function is alpha renamed. Alpha renaming is simple enough to understand (it is the rule in the lambda calculus that states that changing variable names does not change the fundamental program), but I could find nothing that really aided me in figuring out how to actually implement it as an algorithm. I sat down to code it up myself and
realized the daunting complexity.A great deal of wandering finally revealed that lambda lifting was the cure. No doubt, if I had been doing Ocean as a master's thesis I could have asked the advisor or if I had taken a related class I might have already known the answer, but I wasn't. So, it was harder to come by the knowledge. Yet, I am fully convinced that knowledge that was painful to gain is harder to lose. It has a distinct tendency to ingrain itself more fully into the psyche. Besides which is the benefit that a bit of wandering, within the field of study mind you, gave me a great deal more insight or exposure than I would otherwise have had. I love to learn for the sake of learning, but I have a harder time doing that if I cannot focus the energy on something in particular. Long and short, I do go to school--it is the Do It Yourself School, which has a very close working relationship with the School of Hard Knocks.
I am certainly not advocating making learning harder than it should be, but I do think that the value of having to, in some fashion, reblaze the path that was cut is often undervalued.