Friday, November 11, 2005

Week Five

Thursday (3/11/05)

After the unexpected & shocking ILLU results it was a delight to have Wednesday as a day off. But today was Thursday and one had to attend class, given the fact that everyone was still tired and were feeling a bit nostalgic on Diwali. Prof NG being an kgpian himself couldn’t resist the temptation to talk abt ILLU.

Coming to the class we started from where we had left i.e. the conditions of the getreg() function, the an example demonstrating its use and also showing that how the removal of common sub-expressions could lead to optimized codes which is always a guiding force behind good programme. The final part of the discussion was about the global register allocation which was shown to be efficient by the method of cost saving.

Monday (7/11/05)

With the compiler test at our hands today, most of the lot seemed drowsy….. hmm…. may be the previous night out , the assignment submission…. Well this sem. is truly torturous…. And also IITans have this strange affinity towards the create on demand algorithm….. I mean the if the test is on Monday then most of us pick up the notes on Sunday…. The same is the case with the assignments…..

Today we started our discussion on the DAG(Directed Acyclic Graph) method of code generation. The inherent feature of this method is the identification of the common sub-expressions and thereby leading to a minimized code. Finally the discussion concluded with the algorithm to generate the DAG and people rushed as they didn’t want to loose any precious time to prepare for the test

The test in the evening was straight-forward but the only problem was that it was a bit lengthy….. hhmmmmm Sir why are all your question papers so time demanding? Please give us a manageable paper in the end sems…

Tuesday(8/11/05)

The 7:30 class has always been and will always be a difficult thing to fix…. But its still a better situation than last year…. Remember last year the classes were to begin at 7:00 am… uff impossible in these chilling mornings.

The Class began resuming the discussion on DAG, pertaining to the topic of re-construction of the graph backwards, leading to a compressed code. Just when Prof NG finished explaining the example of code optimization under the constrain of two registers, students pointed out that it would had been better if the example had consisted of a DAG and not a tree. Well pointed!!

Then there was a question which Joydeep answered, regarding the maximum registers required, if a node had two children requiring R1 and R2 registers, R1 and R2. Well u can find the answer in the class notes…. But I tell u what… I forced to mention this…. JD is my wingmate J. Finally the class ended in a bit of confusion as Prof NG. asked us to replace all the “R” in the traverse left algo. to label….

But for the first time Prof NG seemed a bit reluctant to take attendance… mayebe he had judged who attends the kectures regularly and who doesn’t… but still the students forced him into it as to some it’s the only incentive…..

Thrusday(10/11/05)

Today was the day when the effects of thin attendance in the previous class surfaced. Prof NG was continuing with his discussion on the GENCODE(n) algorithm and was asking questions…. He could have really shouted at the students who didn’t attend the previous class and were not able to answer but showed a calm attitude and kept on asking “did u attend the previous class?”… so nice

The algo being taught was really confusing and with more than half of the class sitting dumb the atmosphere was not so stimulating….. but still Prof NG kept on trying his best…. Finally the discussion was held up on the Tstack and Rstack and when Prof NG was trying to device a logic for having a single function for computing the push and pop. Finally when Sankalp pointed out that there was recursion in the functions the names of the functions were changed leading to further doubts….

Finally sir announced that today was the last day for the attendance to be taken and I heard a few voices saying then what abt the monday class

Today also saw Sourish in formals… indicating that he had gone for the ITC group discussion…. He along with Puspesh and Aneesh were selected for the GD and Aneesh was finally selected for the summer training….. Congrats Aneesh..



Week Four

Monday ( 24th October 2005 )
-----------------------------------
Well…again a compiler class …..again Prof. NG…….again the
same old ( but shorter now !!!!) attendance procedure … !!!!
Sir started with the large parse tree of previous class which had
Given scary thoughts to many of us already……Sir drew the parse
tree with precision and started doing the long (and tedious as many
of us thought !) work…..some students followed him on the path
but some backed straightaway (as usual)……
The first problem arose with the inverted epsilon (!)…..as nobody
was sure if that was a mistake or a deliberately taken symbol….as
the class progressed with time and the intermediate code , many
students started feeling nowhere class ended as usual……with all
students rushing for their next one hour boredom …HSS !!!!!!!


Tuesday ( 25th October )
-------------------------------
Oh….not again !!!!! Somebody please help the poor students…..again
a 7.30 class ….everybody running towards class …many of us including
me without breakfast…( .Class started at 7.40 and people kept coming
into the class much after that too….
Class resumed from where it was left yesterday … the intermediate
code Generation for the sample code segment using backpatching ……..
but the “tempo” was already down in students as they knew the long
period that lies ahead (the class that they were going to face yet again).
The lecture was going much above the heads of many guys…… but some
were showing their caliber by still fighting the complexity (?) of topic and
…. Sleep too!!! Well the intermediate code generation came to an end……
and many of us felt a breath of fresh air…but but….
Here starts…… Target Code generation ……and everybody sank even
deep into their chairs. Sir started with some definitions sort of things about
target code and their types . Jajoo came with a question that why do we
have Assembly Code after all. Sir replied his question pretty nicely and the
class moved on……
The second confusion and argument began when sir wrote some
Instructions for the code segment x = y + z . But, many of us said that
the code written by sir would lead to loss of data of y. Then sir rectified
the instructions and included one register.
Then the class proceeded smoothly with some students feeling hard
to keep themselves awake. Then started Block identification part which was
easily grasped by the students without much discussion….
Many of students were already looking towards their watches eagerly….
……and the time was coming near…..but that was not the time to relax…..
But to move forward for the next class (not for some ofcourse ( ) !!!!!!


Thursday ( 27th October )
---------------------------------
Everybody (excluding some!) rushing into the class …… nobody wants to
be late (really ??? Is it so? )……..
Well , Sir is not bothered about the missing guys anymore…….maybe they
will face some surprises at the examination time…… (
So , as everybody is in their chairs….Sir started with the proceedings
and we followed (better to say…..we tried to follow him) ! ….. sir said something
about the blocks that we can optimize the algorithm using directly the
block number instead of the usual line number in the intermediate code.
Well today the starting was a bit theoretical which led to confusion and
uneasiness among the students and there were not many doubts as most
of us didn’t get all the things that sir said …..loops….blocks…..graph-theoretic
….Sir although tried to push in some light element by using terms like drunkard
but nobody got anything……….
After that, Sir started talking about Backward Scan……….”live” and “next use”….
There were many doubts which were cleared one by one by Prof NG…..as almost
everybody had misunderstood the method…Sir explained it again and the
thing was swallowed without much murmuring !!!!
Class over ………… feeling hungry …………….Running for Lunch …………

Monday ( 31st October )


Well …….last class before ILLUMINATION & RANGOLI…………
Everybody looking very exhausted (including myself )……….night long works
On ‘chatais’ and ‘colors’ and then doing classes for long long hours…..
( almost everybody feeling very sleepy after the OS double lecture) !!!
Sir showed no mercy and started the class whre it was left ……..
Register Acquiring algorithm ……………..Getreg() function …….
Sir wrote three (or four) rules …..i was not able to concentrate in the class
……sorry guys ! Maybe that will affect the blog a bit……(
Attendance was less than usual classes which was clear indication of the Illumination
Workload …….After that sir wrote the getreg function but only some guys were
with him in all this ……….they started asking some doubts but as the thing was itself
not clear to most of us ..the doubts seemed doubtful too. ……………
Happy Diwali
!!!!!!.......announced Sir ………..and we wished him back !!!!
That ended the class …… people left the classroom for a sleep……as a nightout
Awaits them in the halls because………..tomorrow is IllU !!!!!!!!!!!!!!!!!

Wednesday, October 26, 2005

Week Three

Monday
________
The dP is over and we have landed again in KGP. The class started with the old routine and the same old attendance. Prof. NG has not forgotten a single name but some of us have forgotten what we were studying. Some students are absent in the class and Prof. NG asks whereabouts of them especially Pawan. General consensus says he is absent becz. he has not arrived to KGP.
Lecture continued and ended. Mukesh asked why the rule E->id is not present. Prof. explained some part now and postponed some part to the time of example. Students rushed for their next classes.

Tuesday
_______

This is 7:30 class. Students will come late. Prof. NG closed the door and I just managed to get in. Well seeing the gesture of my friends and Prof I have decided to wake up early next Tuesday. But Prof has not taken attendence and now he is going to open the door. Now sometime has passed after opening door again and Prof. NG takes attendance. Maybe it was a warning.
Absence of Pawan was noticed by Professor and he enquired various details about his hallmates. Lucky him, no wingmates in class. Prof. NG pondered why some seniors stay on ground floor making some guesses. But the concerned wing was mine and his guesses bugged me as I thought he somewhere believed in his mind what my friends were joking.
Prof. asked about Mukesh but couldn't find him as he was not present but replied to his question.
An hour has passed. This is 8:30 am. One of our friend Manoj pops in assuming it is OS class. Prof. NG refused to recognize him and he didn't even care to see Prof. NG. He was bothered about being late as class has already started. Well NG couldn't recog. him and he couldn't recog. Prof. NG. We got a chance to laugh. Someone explained him that he has come to class 3 hrs early landing in Compiler class. He left apologizing and babbling. However, point to be noticed is that Prof. NG offered him a seat.
Lecture has to end like all things & we all want it to end 5 to 10 minutes early how much late we may be. ;)

Thursday
________
Nothing much happened today. Backpatching was showing its mighty strength over the students and Parang asked a question. There was a giggle or laughter in class. Prof. NG however, asked Parang to continue. Students soon learned and some of them now don't laugh realizing their mistake, remaining laugh when he turns around.
Prof. NG has come from Germany and everyone knows that he knows German. But doesn't utter a single German word by mistake in class. This either shows his proficiency over language or he translates every german word in English before speaking. But students provoke the professor by carrying german books in open without bags. He has asked us german word for easy and see see see the null faces of my friends. Those who don't know are fixing some english words to get german word, those who know german are shouting not taught not taught out of course.

Lecture continued and there was no such major development thereafter besides the new emit codes. But what is this, Prof. NG has not left the class, its already 1 minuter over 12:30. Some students have already closed their pens, bags and are ready to leave but observing Prof. all are seated again for next 5 minutes.

Tuesday, October 25, 2005

Week Two

Again a 7.30 class…everybody (except some !!!) yawning into the classroom…

hoping to remain awake for the whole ~2hrs…..as usual attendance
gave everybody enough time to stretch their bodies….
the class started where it was left , array representation in
three address code. Jajoo came up with a doubt about why
are we writing the code for two-dimensional in the form t6 = t5[t4] ,
why not as t6 = t5+t4 .

In answer to this, sir explained that we are just representing the
multi-dimension array in single dimensional form here.

After a while, sir wrote an example grammar and made the
parse tree for this grammar, which gave a scary thought
to many of us as it looked pretty complex….and then
sir started asking the actions corresponding to each grammar
production rule….well it was a sort of puzzle which no-one
knew (except a few …) , how to solve. Sir started explaining
each line a bit and then many of us felt comfortable….
Now the stage was well set for some doubts to crop up….
and it came in Tathagata’s mind first (as usual) that why
are we writing emit(L.place = C(Elist.array)) where
Elist.array is initialized in the rules following , why can’t we
just assign Elist.array with the C(Elist.array) value…..the
doubt took a while to settle down as Sir said that
it is possible to write in that way too……..then Sir
announced a Break !......phew…..double lectures are really long !!!!

After the break … there was a discussion on the
line that sir wrote as …….. ….limit(m,Elist.array)…...
many guys didn’t get that including me…..then the
class came to END….but with an announcement about class at
8:30 pm………buzzing allover !!!!!

Well, Night class …… 8.30 in the night …..at least nobody feeling
sleepy (like the morning class) ….. Sir had to do a lot work as his
whole morning class effort was rubbed off the board by Goutam Sir
so, had to scribble all the rules and actions again on the board.
In this class sir started generation of intermediate code for
the _expression X[i , j] = Y[i+j , k] + Z

Shaunak and Digvijay making some corrections as Sir missed
some lines in the table …..Like assigning Elist.array….Elist.place…L.place..

Dani who was chatting to his friend on his side on some important
issue , I guess….got a bouncer from Sir as he asked what to write
on the next line…..Dani …stumped !!!! Other things were
passed without much discussion…..Then New Topic……BOOLEAN ALGEBRA
everybody answered questions quite easily and a discussion started over
replacing logical OR with if-else statements……sir was asking to replace
without repetition of the code sections…….

Sir proposed a way by using ‘goto’ statement but Shaunak said that
this was equivalent to function calling …Sir just nodded and the class moved on…..

Week One, post midsems

The Midsems were over but none of my batchmates seemed euphoric.
Maybe that humdrum feeling of returning to a monotonous schedule
loomed large on their minds. Long sequence of attendance was then
followed by making of SLR table covered in the lecture before MID-SEM.

Error recovery was covered for the SLR parse table . Prof NG emphasized
that Error Recovery is still not a developed field. The grammar
contained operators which were found to be symmetric and thus both
left and right associativity is valid for this grammar. Hence the error
rules were not general but confined to the type of grammar.

Various points about the error subroutines were discussed in the
lecture. The error sub-routine about the missing operator gathered
some hot debate. As per Shaunak, we never needed error sub-routine
for those rules which didn't contain any rule other than reducing on an
input alphabet. Prof. NG told disagreeing on the suggestion insistedon
an error routine which included pushing highest precedence operator
and then continuing to some state of the SLR table. This again raised
question about the change in handle when we faced same operator
during the last operator shift. The answer was this routine would work
specifically for this grammar and can't be made general. Prof. continously
insisted on his inability to fully satisfy a group of students.

We then went over to SYNTAX RELATED TRANSLATION, accepting the
string & output in postfix form ...blah..blah..blah... The class ended
and topic completion was postponed to next class...

Its Tuesday 7:30 class and none of our batchmates want to getup early.
Most of us are late and class starts at 7:35 followed by long sequence
of attendance. Prof. NG has got this great nack of remembering whoz in
the class and its quite possible that he skips ur name.But as usual
there is typical Bengali accent.....but that's acceptable!!!!!

Coming back to the lecture, it started with SYNTAX DIRECTED
TRANSLATION but very soon this discussion received SIGINT
from ICG(guess what!!!!).

ICG discussion started with emphasis on why we need the intermediate
code?????One of the logical answers came from students was concerning
the complexity of conversion from N source languages to M target
languages.The other point was m/c indebtedness portability.

One of the major hurdle in ICG is the optimization part.The high level
representaion can be handled by syntax directed tree which can be
converted to a DAG and optimizing it is yet another active research
feild.For the Low level representation a technique known as 3-Address
code is used.

Then came the long awaited break which is cherished by everyone :-).
The class resumed with the discussion of 3-Address Code structure and
its generation.Finally a bomb was dropped when sir announced a test
and with his intension of taking it on next Monday , panic creeped in.
But the only supporting factor was that the major portion of the course
included the portion before midsems but still it was a TEST.