False == 0 in Python!?

I came across a very strange error when tweaking the skime compiler. I decided to use the more specific push_0 and push_1 instruction instead of the general push_literal when the literal is 0 and 1 respectively. However, after added this code, several test cases was broken immediately. After [...]

再见,紫金港!

再过几天就要搬家了,离开紫金港,去玉泉。两个室友已经整理好行李回家了,寝室也略显的有些空空荡荡。虽然从小就经常搬家,但是搬家的时候我一般都在外面读书,只是回家以后发现目的地变成了另外一个地方了,自己却没有多少体会过搬家的过程,而且对于我来说,也只是位置变了一下,因为即使搬家,父母也不会轻易丢掉我的任何东西。我是一个倔强的人,你如果想通过某种强制的方式把你的观点加到我身上,必定会造成不愉快,但是父母一直都很尊重我自己的观点,这让我一直觉得是很幸福的。 我觉得,除非大脑损坏了,否则记忆这种东西是不会自己消失的。就是说,如果大脑要分配空间来存放“记忆”的话,这是一个 “new 了以后不 [...]

Schemepy weekly status report

I was away for several weeks during my final exams. But now I'm in my summer holiday. It seems not having classes is making the everyday life a little boring -- you do the same thing every day, you even forget the day of the week. Yes, I don't know what's the N in N-th week in Schemepy now, so I [...]

为人机交互作业画的几幅图

人机交互这门课实在是有些出乎我的意料,本想能在课上听到许多有意思的东西,结果似乎让我有些失望,大概是因为我没有认真听课吧。虽然美哟考试,但是作业布置却也非常混乱,本来是要花不少时间才能做出来的东西,拖到很晚才布置,而且几个老师之间几乎没有沟通,可苦了我们学生,到现在期末考试都结束好久了,却还在做人机交互的作业。 其中一个作业是设计一个 3D 交互系统,由于整个作业实在是太大了,所以实现部分可以忽略,但是最好做一个 demo 出来。我们几个 CS 的学生,要做 3D 建模,还要做演示之类的似乎很困难,不过作业要求也有些奇怪,这个阶段的 prototype 要求用手绘图来做,这个似乎是比 3D [...]

the compiler for skime — from bottom up

最近有空的时候也都在折腾 skime 的 VM ,虽然主要集中在 VM 上,但是写测试代码十分麻烦,每次添加一些辅助功能,最后猛然发现一个编译器的原型已经完成了。我仍然在尝试这种编程方式——并非一开始就把所有的东西都设计好,而是对一些简单的 case ,采用最简单的方法构建出一个可以运行的原型,再通过原型进行扩充。到目前为止似乎都感觉挺好的,因为许多东西都是万事开头难,有了一个大致框架之后剩下的事情就要简单多了,而且原型作为一个快速的可行性尝试也是很不错的。 在刚做出一个 VM 样子的时候,要测试必须手工写字节码,全是数字,写起来非常麻烦,而且一开始指令集也时常有改动,指令的 opcode [...]

Schemepy Logo

The mid-term evaluation of GSoC 2008 is approaching. We students are requested to write a summary of our work. In the Thousand Parsec project, Mithro said: This report should be written as if the person who is reading it has no understanding of what Thousand Parsec is or how to play it. I think I [...]

Back from exams, and skime

终于结束了一段痛苦的考试时间。考试确实非常痛苦,但是另一方面大学里的考试也是很重要吧,至少在计算机专业,普遍存在的现象就是很多课程大部分学到的知识其实是在考试前一周恶补出来的,至少如果整体现状不改变的话,应该是没有可能丢掉考试的吧。 [...]

MSTC Staff 的睡眠趋势

大约是从去年寒假的时候开始,我就经常在 cc98 的 MSTC 版上发“晚安帖”,就是每天晚上睡觉的时候发一个帖子说一声晚安,后来版面上时常出现一大堆晚安帖的情况,遭到大家的抗议。 :p 后来只好集中到了一个帖子里面,养成了习惯大家也都时常来说晚安。 不管是早有预谋还是心血来潮,我对这个晚安贴的内容分析了一下,得到了类似于下面的结果: 其中横坐标是日期,纵坐标是睡觉时间,由于大家都睡得比较晚,所以把第二天凌晨的时间也记作当天晚上(如 25:00 就是第二天凌晨 1:00 [...]

The 8th week of Schemepy

Mithro is just collecting the first-month-status of various Thousand Parsec related GSoC projects. However, since I started early, this is already the end of my 8th week working on Schemepy for me. But as I mentioned before, I spent most of time preparing my final exams. I'll take my first exam the [...]

On the Rubinius FFI

.rbx-doc-hdr { text-align: right; font-family: monospace; color: black; margin: 7px 20px -13px 5px; padding-right: 8px; border-right: #BAC8D4 7px solid; background-color: #ECF4FB; border-bottom: 1px dotted #C0C0C0; } Contents: The need for glue code The Rubinius FFI The FFI document Rubinius FFI [...]

7th week of Schemepy

There's not too much done in this week. Basically, I looked a bit at the tpserver-py and tried to run it in my local box. If I can successfully run it and test the features, then I can go ahead to port it from pyscheme to Schemepy. In the best case, there should be some regression test cases so [...]

Introduction to direct threading, or computed goto

现在许多语言都是先把源代码编译成跨平台的字节码,然后通过解释字节码(或是对字节码进行 JIT)的方式执行程序。这比直接遍历 AST 的方式要高效许多。而现在许多虚拟机的字节码其实已经不是以字节 (byte) 为单位,而是以机器字 (word) 为单位(比如 Rubinius 和 Ruby 1.9 的虚拟机 YARV 都是如此),只是仍然沿用“字节码”这一称呼而已,这个原因我稍后会讲。 除此之外,虚拟机一般会分为两种:基于栈和基于寄存器的。虽然在现实的 CPU 上基于寄存器是理所当然的,但是在实现虚拟机的时候却不一样,基于栈的指令集能够让字节码跟紧凑,这样也可以提高 Cache [...]

sdcv-mode.el update: now keeps a sdcv process running

sdcv-mode.el is an extension that allows you to look up word in Emacs. It is a front end to the console version of StarDict(sdcv). It has rarely been updated since I wrote it in Dec 2006. Of course sdcv-mode.el isn't perfect, but I think it just served well at its position. It is very handy to be [...]

用 Graphviz 来做图的 Visualization

“编译系统设计”课有一个作业是做一个某语言的 parser ,生成一棵语法树,并用合适的方法把这棵语法树显示出来。我用 Graphviz 来做了 visualization 的部分。这是一个用来做图的 visualization 的很方便的工具,语法树作为一棵树,其实是一个有向无环图了,所以用这个来做其实也是很方便的。 其实作业主要分为两个部分:分析和 visualization 。“某语言”可以是自己定义的,我一开始想做 Scheme 的语法分析,不过后来想想还是算了,那个实在是太简单了,恐怕到时候助教不让过。题目要求用 YACC 或者递归下降的方式进行分析。YACC [...]

[ANN] rmmseg-cpp 0.2.5 released

I developed rmmseg-cpp about half a month ago. After running in JavaEye, it is said the performance is good and the memory usage is stable. I'm very glad to see rmmseg-cpp be used in production.