Dreaming my life away.
"People say I'm Crazy, dreaming my life away.." John Lennon.
I woke up with a couple of strange dreams the last two mornings. Yesterday I dreamed that Jesus touched me, and I felt a surge of peaceful relief.
Today I dreamed that I presented my thesis topic before a commitee at Tech. It didn't go as well. I got shot down. Definitely less enjoyable than the Jesus dream. With Rich leaving Tech I wonder if I will ever even get to a thesis defense. I think that's what this dream was about.
Last couple of weeks I've been playing with software. I like it. I enjoy writing software for a living, so when I get a taste of development, I starting thinking all about building up my consulting software company, and not worrying about gettting a Ph.D. On the other hand, I don't want to leave CycleFree work, and I can see no viable way of advancing it without joining academia. To join academia I need a Ph.D., and I have to get a topic.
My biggest problem is that I never have been very disciplined at tackling a small problem and seeing it through to the end. I keep thinking about software in the large, and spread my thought a million miles wide and only a few inches deep. Software has become so specialized. I still believe in a better generalized approach, but to solve specific problems you have to use the existing tools and embrace the philosopical methodology on which these tools were built.
So, if I am to complete a thessis, what would be the topic? I will list some of the areas that I think about.
1) Formalize CycleFree model.
This is probably what my thesis should be. This would involve learning the pi calculus, and all of the other theoretical ways of reasoning about software. Consuming the Pierce and Van Roy books, becoming proficient at UML speak, and becoming a general purpose programming language theory guy. I could probably do this, but I'm not real enthusiastic about it. I like building things, not so much theorizing about things. Perhaps I'm not intellectually deep enough to really make a big difference as a theory guy. My greatest assest is my honesty, and my admission that software is too complex to handle in its current form, I'm constantly searching for simplicity, and the programming theory guys can get real impressed with being able to express complexity mathematically. Maybe I'm full of crap about this. I tend to deride the importance of things, until I understand them. Maybe if I just did this stuff, it would all work out okay in the end.
I think CycleFree is a big thing that fixes the major problem in software today, but there is a lot more work to be done in this area. I am more enthusiastic about doing something that would advance CycleFree, but this might not be the direct path to getting a Ph.D. So maybe I get the Ph.D. first, get set up in an Academic position, and then work on the stuff that interests me. However, maybe one of these ideas that interest me would make a thesis topic itself.
Here are some of these other ideas.
2) Memeory management. CycleFree gets rid of the thread abstraction, but to really clean things up we need to tackle memory visibility. Abstractly, it is real simple to do. Don't allow data access to items that have the potential fo concurrency problems. Start with encapsultating all data in objects, and initially only the member methods of the object are allowed to access the variables. If there are no event routines defined for the object (no sources of potential concurrent) access, then the user of one of these objects would be able to access public atrribute members directly. If there are event routines, perhaps it is necessary to examine what data is potentially exposed to concurrent access, and then this data is limited to access by member methods only.
The biggest problem with enforcing strict memory visibility shielded against concurrent access is the overhead that would result from having to copy memory to get data to flow from one context to another. I think there is a way to fix this problem. The solution is to have a return type that allows the object to be "exchanged" with the caller's object. We could express this explicitly at the langauge level, but I like these sorts of things to be done by the complier/environment. It really is only needed on the "return." Something like
Class Example()
{
BigObject x;
method1()
{
return x;
}
method2()
{
return x.attribute;
}
}
If BigObject is a couple of K big, wouldn't it be nice to simple exchange memory pointers rather than copy the data? The compiler should be able to figure out what size object it would make sense to exchange pointers rather than copy data.
At the language level we would have to change the meaning of the return statement, to say that a returned obejct becomes "undefined." So, for instance, method 2 might need a check to see if Big Object were defined before it could test an attribute.
Being able to exchange objects provides a way to maintain encapsulation and still support efficient memory passing from one context to another. I think this could be expanded into a topic on its own merits.
3) Build time optimizations
Another area I have been thinking about for a while is a three step compile/build/link process to support efficient memory utilization in small memory processors. Something like the MSP 430 or the 8051. People still write in C instead of C++ because theyt don't want the extra overhead that comes from making data access releative to the object pointer instead of direct. For instance, the logical OO way to support a COM driver is to write an class to do this function. If you use two COM ports, then you have two instances of this class. However, many small memory model devices may only use one instance of the COM driver. With only one instance, more efficient direct memory addressing could be used. There should be no need for less memory efficient addressing just because the code was written as a class in C++. I think there are a number of "build time" optimizations that could be deployed. Theory people may tend to view this as Master's level work, but I'm interested in it, and think there could be a thesis in this stuff alone.
4) Killing Exceptions
The CycleFree model provides an "event" mechanism that allows lower level contexts to signal higher level contexts when an event occurs. This mechanism is similar in form to exceptions, and the traditional exception mechanism could be eliminated. I think it could be much improved, in fact. The current exceptiuon mechanism allows "termination semantics" with handlers defined on the call stack. There is no reason that the event mechinism couldn't double up for this exact same purpose. An "until" statement could indicate the higher level object desire to use termination semantics to handle an event. One immediate benefit of this approach is its flexibility as compared with traditional exception handling. Traditional exceptions FORCE the higher level to use termination semantics to handle exceptions, while the CycleFree approach allows the higher level context to determine how to handle the event. Events could be handled by contexts OUTSIDE of the current call chain.
There is something intuitively pleasing about changing exception semantics. Low level code should not dictate how higher level code should handle things. Higher level code knows more; it should be in control.
5) Killing contexts.
Killing objects off is often a big problem. In a traditional program, Destructors or Finalizers must be run to clean up things before obejcts are deleted. And programs must release resources, and junk before they are terminated. In my CycleFree view of the world, the distinction between an "object" and a "program," would disappear, and when you kill something, you kill everything it "encompasses." This "encompassing relationship" is a little fuzzy, even in my own mind, but then again I haven't had a second cup of coffee yet this morning. I think there is a thesis in just managing the killing of things.
I would like to put all of these ideas together, (along with CycleFree) and define a new language, and build process targeted for small memory model processors. Why small memory model? Because we can maybe get some adopters in this market. The CycleFree stuff has its best benefits in large component oriented projects, but there is no way we can get a foothold in this market. The whole chicken before the egg infrastructure thing that Szyperski alluded to in his Software Ecosystems book that depressed me for a couple of months.
Should I get a Ph.D. to do this stuff? I'm still on the fence about this one, but taking baby steps down this path. I'm going to have to start running soon if I ever expect to finish before I'm sixty.
I would still prefer to work for Mirosoft and be paid a living wage to work on the things that interest me, but unless Jim Allchin comes down from the mountain and rescues me from the hellish pit I have dug, this will be unlikely.
Maybe I can get a reality T.V. show like Paris Hilton...