Sunday, December 27, 2015

All we need is search

I should be habituated to get proven wrong I guess. This week's been crazy stupid in learning that I can be wrong in more than one way. Okay, may be being wrong is not so bad or may be it is bad. Anyway, what's completely wrong is my presumption of people looking and behaving so differently based on the context. I mean being a programmer, I can understand the diversity that exists in humans and that which doesn't in the machines. I am not talking about that. We all have certain presumptions about people and their inner nature but the art of secret keeping tells you something more vibrant.

Case in point, one of my ex-classmates. She was so brilliant in linguistics and verbal logic that I was mesmerized by her performance. You see art of speech is something different and art of persuasion using the speech is entirely different. The language is a means of communication, the part I agree and the art of vocabulary is a means for understanding, the part which befuddled me on more than one occasion. I was really utterly jealous of the attention span one could achieve just by speaking.
Then the truth dawns after like what 6 years now? Turns out, she used to write her essay assignments in layman terms and use a thesaurus app to sound fucking smart. Then after once understanding what she could to substitute instead of common terminology, she just did exactly that to throw everyone off the radar. No wonder she used to overuse same word-set again and again.

Enough talk about that bitch, let's get to the point. No... you know what example 2 is on the way. Just the other day, one of my batch-mates from 3 years ago, met me online. I used to be so amused to find a person who was really interested in science and coding. We often shared same thoughts and ideology. The two places of my absolute interest was all I needed to try wanna make friends with that guy. He, on the extreme opposite end, used to talk in sarcastic tone and what not. See, I respect the arrogance that comes with the knowledge. It's usually healthy because by showing people what they are not, we induce the curiosity to learn more. Only wise people know the difference between a healthy arrogance and you know, plain stupidity. I took that guy in good nature and even though he treated me like shit, I couldn't resist being around him because knowledge. You should listen people calling me faggot for being curious. I admit that I had overdone and taken some liberties but you don't find that many people talking about Richard Feynman's work now do you? Turns out, he was a fraud too. In this case, he was parroting whatever bullshit that came out of online lectures. Had he understood what he was doing/telling or at least had he attempted analyzing what he listened to, he would have been fucking great. Alas, he is jobless today.

Point is, there are many parrots around us. If you read my previous blog, you'd have seen that I consider them knowledge preservers. Mugging up/ heartening is good to some extent. Making it a mask for proving what one is not... that is disgusting. I don't know if I had mentioned earlier but don't take anybody's talent for granted. It's all a matter of eligibility and practice. Someone had proper resources at proper time and you didn't. It doesn't mean you are incapable. It just means, you never searched for the answers properly. It's not a sin, it's just a chance. Einstein wasn't the one who did all the work. he just asked the right question. A question that wanted to relate the speed of particle and speed of radiation. It's brilliant because of the segregation that caused the question. In conclusion, all we need to become something great is to start searching how we can do it.

Stay inquisitive
Horopter

Tuesday, December 22, 2015

Compiler design part 1 : Failure accepted buuuuut.... Esoteric programming language

Ok I am busted, 24x7 challenge didn't work.
Fine... I am like that and I am moving on.
I had this weird obsession with designing compilers. I even had a couple of blog entries, so to speak.
One of the most weird things about that I must say, is the journey. I wanted to start a series for tht sake alone but I couldn't succeed because I was going in the wrong path for me. See, everyone has their own path in reaching their destiny but for some reason some of them match and few of them stand. All we have to do is discover and compare notes. So, here I am presenting my notes.

First things first, opinion. In my opinion, compiler design is like integration. I am a fifth grade student by my knowledge in this context. So if I directly mug up integration formulae, I may very well solve the problem. Then again, use of integration is tricky now, isn't it? I mean application part and preparing for real world problems requires more than just skill, it's knowledge. Okay, what if I start from limits and gain the knowledge? It's fine and some theoretical preservation and sensitivity is needed but something else would be missing. Some call it practice, I say experience. The joy of solving a problem and solving multiple problems are different. The pain of losing and rediscovering and the loss of leaving 50 other questions is different. The first in both cases is experience and the second is practice. In short, my opinion is that designing a compiler requires more literature survey followed by immense practice.

Next, paths already followed. The best tool available online on the subject may be Compiler Design course by Stanford. It is fine and all but it is rushed. For a simple guy like me, starting off with a different LLVM based compiler is counter-intuitive and frankly, very complex. I must say that I am quite below the standards but in my defense, so are many. I mean, how many people in CSE or otherwise have thought of writing their own compiler and filtering out the passion, plagiarism and
needed-for-diploma categories, there are only a few hobbyists that actually think about this. Problem is that these people tend not be mathematicians and lack general perspective. They just give code and say voila, there you go. It's fine and all but I am still missing a piece... You didn't explain your language. There is this constant buzz about languages. Non-self-hosting ones are criticized for not being able to do so. Self hosting ones are criticized for doing just that and not being able to do anything else. This is a genuine concern for language developers. It's just not a hobby, it's an art. So the paths followed are different and not easy.

Next, grouping of ideas. Compiler designers differ in ideas and methodologies. Mostly because of their backgrounds. There is the lisp family and there is the C family. Lisp family has Scheme to create new languages and  itself is so huge and people daresay about creating a new one in it. Similar things can be said about Java and C# which actually provide reflections but hardly anyone knows it. Also, C has lex and yacc and Java has ANTLR. These are very good tools if you ask me but they are advanced for even beginners to fathom the knowledge that went behind in creating those things.
Also Ruby builders are creating new things but it goes against the whole idea of creating something useful. Creating qbasic from ruby is a huge back-step. Then we have esoteric programs which do not define themselves as self-hosting and are meant to be a hobby or a joke. These are languages like brainfuck or ArnoldC which are at first declared as Turing complete but lack a provision for actual programming. Python might be a better place to sit back and relax but you just can't make it possible because of python's nature of being utterly indecisive. Even the structure of python screams modern which implies, not for traditional approach.

The procedure of my approach might just be clear from now on and some might even contradict above initial assumptions but that's fine. You'll see that right away. Without further ado, I suggest to whomever reading this blog, write an interpreter for an esoteric language. The point here is not to learn compiler design. It's like teaching a fifth grade student about progressions. It is very much on that border of understanding things and also leads to limits concept. It's a joke in itself seeing from outside but nevertheless is a tool in itself for many great things. That bridge is necessary just to understand lexical analysis parsing mechanism. As a homework, if should you take this blog seriously... write an interpreter each for brainfuck, whitespace and ArnoldC. Create your own equivalent Turing complete language just by combining these ideas and interpreters should be easy.
This will teach two things for sure though. One, what in the world is a Turing complete language and two, how easy it is to make a list of commands look like a programming language.

The final step in the first course is to write a text editor. I know, this has nothing to do with the compiler but let me remind you of QBASIC and TurboC. These two programming languages came with an IDE of their own. Funny much? Yes, no body today is interested in terminals except for linux community which by the way is working on GUI wholesale. So, living by old PDP7 standards is useless. This also gives me an idea to suggest the one and only language you should use for language creation. It is again, Java. I know, I just wrote something quite against it earlier but hear me out. It gives an opportunity for packaging and GUI interface at low cost. C is a great language to implement interpreters with its simple syntax but is no where near creating a proper native GUI. I suggest polyglot programming wherever possible and I have heard that that's what professionals do.

Final notes here now. Write an interpreter before going forth on compilers and trust me, this will help in future.

Sunday, December 13, 2015

24x7 challenge

Hi guys,

I know that it's been a long time that I blogged and I have been bragging about how everything will be changed. Recently my crush said unto me to be honest for a week. Then I argued that one can not live an adult life without lying and my best defense was an awkward Jim Carrey movie and its Bollywood Ctrl+V from our favorite (?) Govinda. I politely asked her to be practical as decisions made in an instance die in an instance. Commitment comes out of necessity and not determination. At best I was using my word play to escape the inevitable truth that I can't stick to my commitments.

Then 10th Dec 2015 happened. I probably lost my exam in ECS which is arguably the nightmare of many people. Now, I had prepared expecting a fair question paper and being "honest", I didn't prepare that well either. I was knocked into my senses and as always I wanted to declare to the world that I will be back or I will change from now or some crap like that like I always say and do. But this time, my crush is monitoring me. Let me explain even though you practically understood like 95% of the story.

You see, I have lost all my friends to this menace of being supremacist. I had read Mein Kampf when I was in high school and that really influenced me, a mistake that I won't repeat with my child in future. Moving on, from that point, I used humor as my defense. I try to laugh more and as I guess I've told you in one previous blog, I kinda conquered my anger bursts. My crush apparently saw this too and she asked me if I could challenge that energy somewhere else. In this case something else. I was practically skeptical and I was genuinely thinking if she was directing me towards intercourse sessions to put as gently as possible. Well, living in a dirt bag of a college hostel, I got corrupted there for a while. In a train of thought, I just realized that the 40 year old virgin and the Batman Begins movie released in the same year. I am actually feeling the stark difference in the cinematography. Ok, coming back to the stream, apparently she was not asking about intercourse.

Fine, I said unto myself and I asked her what she wanted me to ask. I mean, I wanted to ask her out but she wanted me to want to ask her a different question. The question in point being that I could be productive for 24 hours and 7 days a week. It sounds exactly like what I am doing, I thought. She had her own thoughts. She wanted me to record the events in a little book so that I can feel accomplished. On other note, every day I meet her I feel accomplished but you know what she meant. I reacted, let's say, unconventionally and it was awkward. She just wanted me to try for like just one week and habituate if it felt good.

Now, you guys know me. I start well and take a dump on my own resolutions and stuff. Quite frankly, I know that this is going to fail in the same way. Then again, this is the first time, she asked me to do something. I feel obligated and that's why, I am going to be productive starting today 13th Dec 2015 2:18 AM IST. I swear to God that if I succeed in this, I am going to ask her out, for reals this time.

Yeah and also shout out to my dumb racket which is good but has a few threads in its head a bit messed up. Please feel free to tell it go fuck itself because even after knowing how I play, it refuses to understand. I am sick and tired of being the listening person. After all I am Santosh and its racket. I guess, I lost my value to a dumb racket.

See ya
Horopter