5.15.2011

It's all the same set

Out of a sudden I started to program some random, memory-iterating things for "fun" (yes, I'm that nerdy) and remembered a TV show about dimensionality, theory of everthing, space curvatures etc. It was really interesting and began to start into a "what's when we turn back the time to pre-big bang?" sort of thinkage (which was even more interesting). Physiciasts are interesting persons. They try to put reality into models, want to prove it and go back if it didn't work. They follow a simple philosophy and don't dare to repeat experiments over and over again. With that in mind I wondered whether it's possible to apply the idea of dimensions and set as subsets of other sets to programming and code generation. It begins with simple things: a number of states and thing that is one of these states, a variable. So we have set and one of it's elements which we don't know. So there's set and element. Interestingly, a multidimensional vector is a multiple of elements from a single set whereas multidimensional arrays is a set of vectors from a set of all vectors. You probably know that stuff from mathematics: matrices and other relatived things. But that's just all based on states and fix-sized sets. What about alghorithms? Commands? Executions? What if we can also classify sets of alghorithms as vectors and matrices and matrices made of matrices? Let's take a string as an example: if you want find the exact end of a string, you usually iterate til \0 and know the address or offset. That's dimension 1 - n characters terminated by \0. Let's abbreviate this with a regex-like notation, "?*0". So if that's dim 1, then dim 0 must be "0". We have dim 1 and dim 2 - the rest is induction with a different ending character. So if dim 0 is "0", dim 1 "?*0", then dim 2 could be "?*0?*0" or even with completely different set of ending characters: "?*g?*4" and so on. I already tried to get a system done using C++ that works this way, building dimension-oriented setups of structure verifiers, arrays iterators etc. But I would need to specifiy all single cases at one, which's only limited the upper levels of infity due to random combinations of alghorithms etc. If one wants to write all combinations of twodimensional vectors in non-variable notation, he'll never end. So when I want to create fixed alghorithms for all possible situations, I'd end with a never-ending task made of alghorithms I'd probably never use! So what we need is a system that eases us the creation of code during compile-time we can abstract a special n-dimensional set of actions. An alghorithm ist just a set of values, like code. I know, that may sounds super-silly, but it's actually a quite useful thing. All the time someone writes a nongeneric program, it's functionality is the same and can only be seen as a single instance of a somehow defined, completely set of instructions. If you give your computer language the ability to not only describe those instances but their rule of creation... you'll effectively have the seed of all possibly alghorithms resulting from your generalized description. You can find limited implementations of this in C++, Java, etc... Templates, Generics - they all give you the possibility to do all this, but it's unintuitive and not efficient enough to complete solve problems based on seeds. This is an import realization for me, as it draws a line between mathematics, physics and programs. I see a strong relation between them on this level - everything is a description or alghorithm or both. Those connections are everywhere, not only inside a fool man's head. Instance and Definition, abstracte and concrete. Two opposites relying on each other, beeing impossible to exist if the other is non-present. These two elements can be found in anything spritiual and scientific. Genetic is defined my genes and their resulting animals, religion praises it's god's plans before and spread the stories about what happened after, theoretical physiciast analyse the present and try to find the rules it is made of. Even we, as humans, depend on how we were made and become what we are now. Begin and End. Alpha and Omega. It's noticed by so many peoples in the world - and then most programmers don't even TRY to think about incorporating it. That's the problem with this world. Everything is so focussed on now and then... nobody's looking back far enough to tackle the root of everything except some brave, revolutionary phyisiciast and deeply spiritual people. I (almost) feel like I need to play my part this time. The world of programming needs to ascend and realize it's place in our reality and not only in business problems. I'll dedicate my life to advancing the perception of those connections in a programmer's world. No matter the cost, time or nerves spend. This is the shit I live for.

No comments: