“Fork Ruby” Summary (RubyConf 2008)

Posted by jay on December 30, 2008

I like screencast and keynote, they are great ways of learning practically. But some people don’t have much time to watch or listen to all these. Or maybe you forgot some ideas were presented, but it’s difficult to select the part you want to find in the video – you end up with watching the video again sometimes. So here I typed in a short summary of the keynote. If you are still interested, it’s worth to watching the video. And thanks to David Thomas giving this talk.

Presenter: David Thomas
Background: Last RubyConf attended was in 2005, started working on Ruby back in 1999. He wrote books, talked at many events and went to a lot of conferences. HE recently went to many Rails conferences.

Why Fork Ruby

There are a lot of active project forking Ruby interpreter, e.g. JRuby, IronRuby, MacRuby, but they are not forking the Ruby language.

Problem with Release Time

1.0 -> 1.2 tookk 14 months -> 1.4 (8 months) -> 1.6 (13 months) -> 1.8 (48 months) -> 1.9 (54 months)

  • As you can see, bigger changes we make, the bigger challenges they are, more time required for next release.
  • The bigger changes make developer difficult to adopt to these new features.
  • Less people use the new release feature, release team will not be able to find problems.

Some (Potential) Projects Ideas

RubyLite

RubyLite is a light version of Ruby. The idea is that moving those listed less used features into Gem, developer install those gems only when they needed.

  • One of the things we can do with RubyLite is to lose some language features that we normally don’t use (e.g.):
    • %q delimiters
    • implicit string concatenation
    • alias
    • nested assignment
    • :: sign for method call
  • And other features we can get rid of: class variables, global variables, many combination of $ sign, unless/until, protected, proc
  • One encoding will make library much smaller, so how about support utf8.
  • Losing Built-in classes and modules: Complex, File::Stat, FileTest, Mutex, ObjectSpace, Process::Gid/Status/Sys/Uid, Rational, TreadGroup
  • Losing Built-in methods, a lot of methods are vibrations that produces the same result.

Parallel Ruby

Ruby already have the construction to produce parallelism: a, b = b, a

Ideally, Dave suggested that we could perform calculation using this parallel feature in separate threads or processes: a, b = calc1(x), calc2(y). He used some sample code of finding longest word in English, which demonstrated that a few lines code produced Map/Reduce.

Optionally-typed Ruby

Closure-based Ruby

This Is the Ruby with block, and it should be easy to create lambda. Suggestion is to remove {} sign for hash. Maybe we can express methods and classes in blocks.

Conclusion

There is nothing wrong with Ruby, “but that shouldn’t stop us from having fun”. The community should fork Ruby and experiment with it. If the result is positive, they will be put in main Ruby release. The Ruby release itself should not be part of the experiment.

IE6方程式: 提高开发效率

Posted by jay on December 28, 2008

Jeremy Keith在他的博客中写到关于如何选择对IE6支持的问题。对于不同的网站,他们有不同的用户群,如果很少部分的人用IE6,还要考虑对老版本的支持么?又如果在IE6中发现很小的错误,是否要修正,应该用多少工作时间?

Jeremy分析了不同层面极端的几个方案:

  • 将所有的 IE6 访问者踢出你的站点
  • 完全遵循标准开发,并且没有任何针对 IE6 的测试
  • 只使用 Dean Edwards 的脚本让 IE6 支持额外的 CSS
  • 编写针对 IE6 的样式解决大部分问题(比如布局等)
  • 让站点在 IE6 以及其他浏览器上看起来一摸一样

并和Cennydd Bowle一起推算出一个数学公式(使用 t 表示总的开发时间、t6 表示花在 IE6 上的时间;所有的访问者数目表示为 a、 a6 则表示正在使用 IE6 的访问者):

p = 50 [ log ( at6 / ta6 ) + 1 ]

运算出来的p概率可以判断是应该应用 Dean Edwards 的 IE 脚本:

当然在某些极端的情况下,比如公司的政策内部一定要运用IE6,作为内部网络软件开发人员,应当要保证IE6的100%正常运作。在浏览器支持的问题上,Yahoo YUI发布过一篇很好的文章”Graded Browser Support“, 作为好的开发人员,这篇文章应该是必读的。

当然这些都不能解决本质问题,为软需要加大力度让客户门升级自己的IE。在2008年低,我们的AJAX技术不能单单的存活在1997年的浏览器技术上。

Computer Science Research Conference at Cambridge

Posted by jay on December 15, 2008

Have been waiting this day for several weeks now since I received invitation to Computer Sicence 2008 conference hold at Cambridge Homerton college.

To get UK research fund for international student become rather difficult. Unfortunatly, I’m in this hassle right now together with this economic down time.

So finally I’m off there for three days. Hoping to get some answers, ideas and help.

The conference was mainly about giving insite view of computer science research. For those who are looking for a reaseach career, we were taught a few tips. Some conference seminas are absolutly fabulars!

Why comics is important in research?

The seminar I enjoyed most was “The Power of Procrastination” given by Jorge Cham. He earned PhD in mechanical engineering from Stanford University and turned out to be a comic producer. He’s the creator of Piled Higher & Deeper (PHD Comics). The comics is based on some stories/conversation between gradudate students and PhD students. It makes people laugh in the case that some scene are happening in student life. Go to the PhD comics website, check out those archived comics.

Microsoft Research

One of the MS research branch is located in Cambridge, of course they presented and demoed some latest high tech(facial detection). They have more information on their Research website.

Google Research

This was a fun part. Actually, Google doesn’t have a specialised research branch, so, why they presented and sponsored the conference? One of the presenter, a Google engineer manager, said that their engineers do both engineering and research work at the same time. For example, their production server disk format is developed by their engineer to handle large a mount to search requests and caching, even operating system is speciallised designed for super large amount of requests. There is a wide list of unresolved issues to research on. So actually, even in this layoffs season(see yahoo action), it’s pretty amazing Google still have spares to hire more people, of course they have to be top notch.

Configure Rails migration version type

Posted by jay on December 02, 2008

Rails use a UTC time stamp as migration version by default. Although most examples in books have simple number based system for managing migration versions, there isn’t much information about version type configuration. By default, a migration file(>=Rail 2.0) name look similar to:

20081202130543_create_group_categories.rb

We can turn this off and use numeric prefixes by adding this in config/environment.rb

config.active_record.timestamped_migrations = false

New generated file name will look like:

003_create_group_categories.rb

But bare in mind, if the Rails project is getting large and a few developers are working on same project, it’s likely that two developers generate same version of migration (e.g. 003). Using time stamp is introduced since Rail 2.0 to avoid such problem. So… better keep the default setting!