6th week of Schemepy: mzscheme-3m, guile-1.6 and others

As I said in the last status report, although I finished the mzscheme backend, I found the currently commonly used version is in fact of another memory model. My original code was written against the CGC memory model, so I need to re-implement part of the backend to adopt the new 3m model. At [...]

差点把自己的主目录删掉了

我一直很讨厌 rm 命令的 -i 选项,一般删除目录都是直接 rm -rf 的,所谓“常在河边走,哪能不湿鞋”,今天差点把自己的主目录给删掉了。 本来是在试用 blueprint ,它的配置文件里面可以指定路径,谁知道它并不展开 ~ 为主目录,运行几次都没有反应,后来我改为绝对路径,才正常了。偶然发现它在当前目录生成了一个叫做 ~ 的目录,真是有些哭笑不得,立马 rm ~ 删除,结果出错了,我根本没有仔细看错误信息,心想:哦!对,这是一个目录,不能这样删。于是我又习惯性地键入 rm -rf ~ …… 过了大约 1 [...]

Rubyforge support git now

不知道是不是我火星了,今天去 Rubyforge 注册 rmmseg-cpp 项目的时候发现在 SCM 那里可以选 git 了。不知道是什么时候加上的支持,这下应该会方便许多了。不过刚注册的项目还没有通过审核,到时候立即试用一下,这样在 github 和 Rubyforge 同时有一个 repo 应该也是能很方便地同步的了! :)

[Schemepy] More about the mzscheme backend

I finally finished the mzscheme backend. As I said before, I should have finished it before writing the last week's status report. However, I'm still pleased to see the result though a little late than scheduled. So I'll write a follow up of the last status report. With the experience of [...]

儿童节快乐

又是一年儿童节!Today's kids' day! :D 虽然一如既往过得很平常,但是始终还是很特殊的日子。不过这不是问题,不过生日我依旧还是我;不过 kids' day 我依旧还是 kid 。 :p 不过这几天似乎是太累了,下午的时候决定休息一下,竟然梦到了已经死去多年的爷爷了。 也祝所有还留有童心的人和其他人六一儿童节快乐吧!

5th week of Schemepy: the mzscheme backend

I was all doing the mzscheme backend the last week. I had complained much about the interface before. However, after that, (at least I think) I have figured out how to do various things to finish the backend by reading the document, reading the source code and guessing. For example, the namespace [...]

Blog 一周年

看了一下,在这个 Blog 发的第一篇文章是 2007 年 5 月 21 日,一晃就已经过去一年了。我决定浏览一下自己这一年来发的 Blog ,做一个整理。一方面我是一个比较喜欢怀旧的人,另一方面也算从一个侧面看看这一年来我都干了些什么吧。 按照 Wordpress 的统计,到目前为止,我一共发了 151 篇 Blog ,并有 556 个评论。我还是按照时间顺序来浏览吧。

4th week of Schemepy: the not-so-friendly API of mzscheme

There's not too much done in this week for Schemepy. At first I was trying to port libtpclient-py from pyscheme to Schemepy. However, the code base of libtpclient-py is not too big, and I only found little code that used pyscheme. I thought I should learn the basic behavior of the lib and the [...]

Play with GC: mark your treasure

Garbage collecting is amazingly useful. It is a must-have of any modern language. You never need to concern about when to free the allocated memory again. Just allocate, those objects not used will be collected automatically at a some time. Yes, it's true. But, wait, it's not true! I still remember [...]

rmmseg-cpp: rmmseg in C++

RMMSeg is an implementation of MMSEG Chinese word segmentation algorithm. It features full integration with Ferret. The original version is written in pure-Ruby, which includes two algorithms: Complex Algorithm: Maximum matching with three-word chunk filtering. The accuracy is good. But the [...]

Multiton again, in Python

I have introduced Multiton in one of my previous blog post. Multiton is just like Singleton, except that there will be multiple instance when the init parameters are different. One example is the Lisp symbol: Different symbol object for different symbol name. Identical symbol object for identical [...]

Inside the {C++, Java, Lisp, Python, Ruby} Object Model

We just held a technical salon today named "template<language L> Inside the L Object Model". When I was looking at some code of Ruby, I found the object model is very different to a static language like C++. So I suggested the idea of discussing various object model of different [...]

Big surprises of the day: gift from Google, Rubinius, etc.

We were having massive earthquake the last several days in China. Though Hangzhou is almost not affected, there were many people died in Sichuan province and the number of death is still growing. I'm very sorry about that. But I can't do more besides denoting some money and blessing. My hometown, [...]

This week in Schemepy: Test suites and benchmarks

I'm really borrowing the title of the popular series This week in Ruby from Zen and the Art of Programming. But in fact, there are really some interesting progress related to Schemepy this week. Test suites I just switched from py.test to nose for doing unit test. I arranged the tests directory so [...]

Trampolined-style Programming

今天在 pyscheme 的代码里看到许多诸如 pogo.pogo 、pogo.land 、pogo.bounce 之类的调用,感觉特别奇怪,不过它的注释写得很详细,做这样的东西是为了解决 Python 没有尾递归优化的问题。 在有尾递归优化的语言里(Scheme 是最典型的一个例子,因为它甚至把尾递归作为语言的一个重要特性放在语言规范中了),如果一个函数的最后一个动作(除了 return)是调用另一个函数的话,就直接用那个函数的栈帧替换当前的栈帧,省去了 call and return 的麻烦,还避免了栈溢出,时间空间都有优势。 [...]