Monday, December 19, 2005

OldPosts: Me and compilers

I was always fond of compilers, one of the reasons i joined Faculty of computers and information was to be be able to construct a compiler.
Compilers to me means symbolic power of the ability of understading the user input. And how to be able to utilize the computing power of the machine to do extremely large things that needs tedious work of a human; by changing a few lines, you can do a big difference - imagine doing it with no computers at all - like moving a mountain along a path which follows a car! It's a strange idea but it somehow reflects my idea of the power of computers.
I always was trying to learn more about compiler since the moment - or even before - i joined the college. So i was able to gather a lot of knowledge about them before we study the Compilers course. Though it was not enough to understand them well enough to be able to actually construct a compiler, I gained enough knowledge about what we should study in that course exactly. Disappointingly, what we actually studied was only 30% of what we should, and what all other courses, outside Egypt, did study.
We have studied Regular Expressions, DFA, and Context free grammars, and LL parsing. Regular Expressions and DFA was supposed to be studied in another course ( named - as in other colleges outside Egypt : Automata theory and Formal languages), leaving more time to focus on compiling related topics - Supposedly, parsing only is a Parsing theory, so we did study Parsing theory, Not compilers. We even didn't study the full parsing theory; we should have studied LR parsing, as LL is history, and nothing compared to LR. We should also have studied Context sensetive grammars, and attribute grammars, which is essential for semantic analysis. Outside parsing theory, we should have studied Run-time environments, the link between Architecture and Compiler, and a way to enlighten us of how to produce executable files, and also of how our code we compile everyday does actually run.
Another thing that really made me mad, is the project. In graphics course we did use DirectX as a tool to implement something big. But if we did implement the low-level graphics ourselves, it would have lead us nowhere and we would have produced something that is useless and so little. The same for compilers, we should have used a Parser, and Lexer generator tools, so we can produce something big, and actually employ our - supposed - knowledge of semantic analysis and run time analysis so that we can actually produce a full working compiler for a big language and also outputs an executable file. But what happened was the opposite; we spent time and effort implementing a lexer and a parser, hardcoded, which no one in the world do anymore; even the Java CUP parser generator last version was 1999.
Finally, I would really feel sorry for being so held back, that other people did these stuff 20 years ago, and we are still doing the same. The compiler industry are way looking so much far, on the loosely typed languages, and Aspect-Oriented Programming, and Zero-code data-binding, we didn't even hear about Object-Oriented Programming in the compilers course. Hopefully, in 20 or 30 years, I will be able to feel Hope again .

Monday, December 5, 2005

OldPosts: Fermat's last theorm

Fermat's last theorem

The theorem says :
x^n + y^n = z^n has no non-zero solution for n > 2. About year 1500 C.E. it was not proven yet. It was proven about 1990's. I have seen the proof, about 100 pages, not a line I did understood :S. Anyway the theorm implies that you can't divide a cube into two cubes, and so, for higher diemnsions. It is not true for n=2 because of Pythagorean theoerm of the right triangle, which proved that you can divide a square into two squares x^2 + y^2 = z^2.
I am trying to read more about mathematics to be able to understand this theorem, and how it was proved, so i can be able to prove stuff like this. Nontheless, it wouldn't hurt if I just read more about math, but not enought to understand it.

Sources :
* Definition : http://en.wikipedia.org/wiki/Fermat's_last_theorem
* Proof : http://math.stanford.edu/~lekheng/flt/wiles.pdf