Tuesday, December 22, 2015

Pichai Sundararajan makes me sad.

Living in India one can hardly live a day without hearing about some or the other personality making it big in the world and being of Indian origin.

My first response to such articles and news items was joy at knowing that Indians are doing something substantial. Sundar Pichai gave hope to thousands of programmers in India.

After a while though the term began to bother me. Indian origin. The words mean that the person was not from India but his/her roots could be traced back to us. I felt like an ape rejoicing that humans went to the moon, because of ape-origin.

What I realized is that all these things had motivated us for the wrong reasons. They had never lived in the conditions we live in. They did not know India like we do. All they had were distant roots in this country that we live in and survive everyday.

It means at some level that those people or their ancestors chose to leave this country due to some reasons. It might be that they found the other more lucrative or that they were frustrated with this one. What the essence of my rant is that this country was not good enough.

If indeed we want to celebrate the Indian origin success story we should keep in mind that what we are celebrating is not the success of the country in that field, rather the success of the country in producing a child who could do amazing things but had to leave the country in order to do so.

Sundar might have grown up here but in order to do great things, he had to leave India.

Friday, December 11, 2015

Book Review: Bhima- Vikas Singh

When I first saw the title and illustration I was delighted to be reading about another character of Indian origin.

The cover grips you completely. The charismatic title of 'The Man in the Shadows' lends the thought to the reader that there might me some things they might not know about this character they think they know.

The name itself invokes images of legend and might. When these two things hit you with the wonderfully illustrated images, it fills you with a sense of curiosity. Men in shadows are usually associated with having done enormous tasks or played immense roles in tasks not usually associated with them. What is it that Bhim did which we did not know of?

If Bhim did it then it must me something immense, something of superhuman scale.

The book promises to show you facets of Bhim that you did not previously acknowledge. You expect these to evolve under the sections of the Mahabharat which were briefly touched or under disagreement. You expect to be shown a portrait of Bhim so good that you cannot help yourself but bow to the man.

None of that happen. The reader's perspective of Bhim remains almost unchanged. The only new addition is that perhaps Bhim was a man who had exceptional sex drive to have slept with women of other species and one of great need for acceptance.

All other attempts fail at one point or another. Depiction of combat attempt to lure you in with mentions of muscle names and fail on mentioning that air supply to the brain is blocked. The author fails to realize that the only thing reaching the brain is blood.

An attempt to show Bhim as a philosophical man fails throughout the book as most of his efforts are illustrated to be the work of a simpleton who just happens to hit on deep things. Bhim himself is not capable of deep thought.

There are attempts to reconcile the mystical nature of the Mahabharat though mentions of aliens and evolution being the cause of the deva and rakshas races. It fails when one realizes that evolution always moves to one point. For such stark evolutionary differences to arise, there have to exist impossible conditions on this earth.

Then there is the eternal display of Krishna as a deceitful man, though I have no problem with that. Attempts to show that good and evil are not clearly defined are half hearted and echo of the works of Amish and Arvind Adiga.

Overall the book leaves an unsatisfied taste in the mouth of a reader who was expecting a deep character study. It is mostly a description of the key events of the Mahabharat which involve Bhim peppered with gruesome battle and a desire for sex.

The author in my humble opinion, needs to do a deeper study of characters and techniques before immortalizing them in ink and thus producing a book with potential but no fulfilment.

Thursday, December 3, 2015

Why is Python a high level language?

High level languages are usually defined as languages in which one instruction translates to more than one machine level instructions. Though I find this definition simple and precise, I also find that a lot of students find it difficult to understand this definition.

A simple demonstration can be done in Python. First one must understand that any hardware comes with it's own instruction set. The hardware allows others to instruct it using an instruction set which is created by the manufacturer of the hardware. This is the basic instruction set and consists of things like ADD, SUB, LOAD, BIND etc.

In Python we may consider a hypothetical hardware which needs instructions called byte code to run. Now we see how a simple python program converts to multiple byte code instructions per statement.

First let us create a simple function in Python.
def my_function():
    x = 1
    y = 2
    z = x + y
What this does is create a function that creates two variables x and y and adds them together before storing them in another variable called z.

To see the machine level instructions which must be carried out to complete this function we will add the following to the python file (possibly myfn.py)

import diss
diss.diss(my_function)

What we get as output is:

  2           0 LOAD_CONST               1 (1)
              3 STORE_FAST               0 (x)

  3           6 LOAD_CONST               2 (2)
              9 STORE_FAST               1 (y)

  4          12 LOAD_FAST                0 (x)
             15 LOAD_FAST                1 (y)
             18 BINARY_ADD
             19 STORE_FAST               2 (z)
             22 LOAD_CONST               0 (None)
             25 RETURN_VALUE


The initial numbers in the first column are line numbers in myfn.py

Hence we can see the expected machine instructions to compute this function. Note that line 2 and 3 in our file expanded to 2 statements while line 4 to 6.

Hence we conclude that Python is a high level language.
For more details refer to the Python docs.