Compiler完结,切实感觉Level Up

当我放下演算所用的纸笔、筋疲力尽地点击submit的时候,那种大学考试时怎么检查也没有用不如直接交卷的无力感好像又回到了我身边。连续4个小时的期末考试,终于在脑汁绞尽之后结束了。因为都是在线做填空选择题,分数是即时给出的,7.91/10.0,不出意外的分数,我早知道凭我的能力上不了80,果真便是如此。不知道最后总评是多少,不过那都是无所谓的东西——Compiler这门课,我学会了很多。

大学里的编译原理,我从语义分析起就一塌糊涂,直到今天我才明白不是我学的不好,真的是当时的教学就不怎么样。无论词法分析和语法分析,都有大量抽象的符号去描述,去精确地刻画;而语义分析这里,没有,真的没有。全是一堆概念、扯过来扯过去,缩略得不成体统。甚至我都不明白语义分析的输出结果是为了生成一棵带有type信息的语法树。而且O,M,C这么重要的概念,更是丝毫不知道。面向对象程序的处理方法也是空空如也,this指针的type问题(selftype)更是一无所知。

Compiler的最后是代码生成与代码优化,这部分学到的东西最多,但是学不懂的地方也最多,因为之前对此的理解就是0。比较清楚的是垃圾回收(GC)的实现:有mark and sweep,stop and copy,与count reference三种。而C、C++因为存在指针,第二种GC是无法使用的。寄存器分配(RegisterAllocation)也是学得比较清楚的,大概和留日的时候学习寄存器绑定(RegisterBinding)有那么点点儿关系,当然算法是完全不同的,寄存器分配的染色算法让我想起了当年重修过的离散数学,记得当时看懂了五色定理的证明,当时真是牛逼。

ProgrammingAssignment方面,目前PA4的程序处于一片烂泥状态,PA3的程序结构有问题,多重定义的验证很难实现,要完善也挺难的,希望有时间可以建成一个独立的IDE调试环境,把这两个程序都写完。应该是以后读书读到《龙书》的时候吧,终究是要去读的,不过目前还不够等级……

10周时间,我在Coursera跟了三门课,到今天为止算是全部结束了:Compiler的部分上文已经详细记述了,之前的日志也说过不少。而Machine Learning在我的日志里没怎么细述,因为并不是很难,或者说Andrew Ng教的比较浅,没有像Compiler那样属于大规模杀伤武器,不过还是花了我很多时间,Logic就比较简单了,就是一轻松娱乐型课程,基本开到1.2倍速听完讲课,做做习题就好了。

最后的最后,摘录一下Machine Learning最后一课,Andrew Ng说的一段话:

Welcome to the final video of this Machine Learning class.

And before wrapping up, there’s just one last thing I wanted to say.
Which is that: It was maybe not so long ago, that I was a student myself.
And even today, you know, I still try to take different courses when I have time to try to learn new things.
And so I know how time-consuming it is to learn this stuff.
I know that you’re probably a busy person with many, many other things going on in your life.
And so the fact that you still found the time or took the time to watch these videos and, you know, many of these videos just went on for hours, right?
And the fact many of you took the time to go through the review questions and that many of you took the time to work through the programming exercises.
And these were long and complicate programming exercises.
I wanted to say thank you for that.
And I know that many of you have worked hard on this class and that many of you have put a lot of time into this class, that many of you have put a lot > of yourselves into this class.
So I hope that you also got a lot of out this class.
And I wanted to say:
Thank you very much for having been a student in this class.