2/28/2007

一個在 Rails 跟 Django 徘徊設計師的真情告白



AjaxWhoIs 這個網站的作者最近發表一篇文章 Why I moved from Ruby on Rails to Python/Django and back,講解他開發 AjaxWhoIs 2.0 的時候為何先用 Rails 開發,後來採用 Django 開發,最後還是轉回 Rails 的紀錄。

Any newcomer to Rails will quickly discover why it is so talked about. First of all, even though I don’t consider myself anywhere near a decent Rails programmer, I am now at least twice as productive with Ruby on Rails than with ASP.NET and C#. Thanks to the MVC (Model, View, Controller), DRY (Don’t Repeat Yourself) and Convention Over Configuration mindset of Rails.

他一開始是一個 ASP.NEt 跟 C# 的程式設計師,所以他是第一次使用 Rails ,但是當他使用 Rails 開發的時候,他發現 Rails 的三大法則 MVC ,DRY ,Convention Over Configuration 至少讓他生產力比原本很熟悉的 ASP.NET 快了兩倍以上。

I found out that Mongrel was known to not play well with 64 bit Ubuntu (I lost the links to this evidence, unfortunately). Mongrel was patched accordingly, but it didn’t solve my problem. It still crashed many times a day and I just couldn’t figure out what was wrong. I asked my good friends Rich Collins and Adam Thorsen (of Guruza.com) who are both experienced Rails developers and they had no idea either. I was stuck.

但是當他寫完AJAXWhoIs 2.0的時候,他發現到 Mongrel 跑 64bit Ubuntu 的時候有詭異的問題,導致 Mongrel 常常當機,屢試不爽。

I picked up a Python book and rewrote the whole site one more time, in Python using the Django framework this time. I had never programmed in Python before and much less used Django. However, the switch was easy enough since Ruby and Python are somewhat similar.

相當令人覺得很了不起,也相當令人覺得不可思議的事情發生了。他已經寫完了整個 Project ,只是遇到了這個 Hardware 問題,他居然跑去用 Django 重新寫了一次 AjaxWhoIs 2.0,而且這還是他第一次寫 Python。一般人應該都會換台機器跑就好了不是嗎 @@!

However, I soon missed Ruby and Rails. Ruby supports “real” private/public/protected methods (Python just fakes that with its naming convention) and it’s syntax is more forgiving (the need for () at the end of each method call in Python was killing me). Django is not as straightforward as Rails, and requires more code to get things done. There are also many little things that don’t “feel right” in Django, like the need to manually pass variables to a view. Data access is confusing at best while Rails’ ActiveRecord is god-sent. These little things really add up.

但是當他寫完的同時,他開始相當懷念 Rails 了,有許許多多小地方他認為 Rails 做的比 Django 來的好,Rails 作法也比 Django 來的更 straightforward 。要完成同樣一件事情,Django 也需要比 Rails 更多 code 。 Django 有太多東西讓他覺得 don't feel right了。

On the flip side, Python is faster than Ruby and less memory hungry. I was also surprised to actually love Python’s significant indentation (see example). But more importantly, Python and Django just worked! I never experienced weird crashes like I did with my Rails stack.

的確,Python 比 Ruby 快,需要 memory 也比較少。而且最重要的是,Django 可以動,Mongrel 在 64 bit CPU 不能動。

So, why am I back to Rails for my next project? 3 letters: FUN. I find Ruby and Rails to be pleasant to use. The community large, active and very helpful. The number of freely available Rails plugins and the fast evolution of the core code are also welcomed additions. Rails requires less code, less self.__awkward_method_calls(), has built-in AJAX and REST support, and has much more flexible data access and templating engines.

而為何他又要跑回 Rails 了呢?Just for FUN。他發現到 Ruby on Rails 會讓人非常愉快,社群很大,活動力強,而且都會互相幫忙。免費的 Rails Plugin 跟 code 快速的進展都很棒。Rails 需要較少的 code ,較少的可怕的 method call,而且還內建 AJAX 跟 REST。而且 Data Access 跟 template engine 都更有彈性。

But what about those crashes? What about the speed issue? Well, I don’t have the crashes anymore. Don’t ask me why, I don’t know, but it’s fine now, I swear! Something somewhere got fixed and it seems to have solved the problem. However, speed is still one of the low points of Rails. Using caching and proper code optimization should take you a long way, though. Matz, the author of Ruby, is working hard on a new virtual machine that should make Ruby just as fast, if not faster than Python.

最神奇的是,當他回去 Rails 時,Mongrel 不再 crash 了@@!不知道Mongrel 哪裡修正了,反正問題解決了。但是效率依舊是一個問題所在。

My recommendation is, try both for long enough to figure out what works and what doesn’t for you. If you are a long-time Python user, Django might be more compelling for you, but if you are coming from a Java, Perl or Smalltalk background, Ruby and Rails will most likely be what you’ll end up using. Either way, I don’t think you can go wrong.

他的建議是如果你是 Python 長期的使用者,用 Django 吧,如果你是 JAVA,Perl,Smalltalk背景的人,來用 Ruby on Rails 吧。

我的小結論:

從他的字裡行間可以看出幾件事情

  1. Rails 跟 Django 開發時間都很快速
  2. 他真的很不會利用時間,居然用 Rails 跟 Python 各開發了一次,只是因為 Mongrel 對 Hareware 有點 bug

DHH 寫了一個 OpenID 的 Rails Plugin

既然大家都覺得 OpenID 很有搞頭,那身為尖端科技的結晶的 Ruby on Rails 怎麼可以缺席呢?Rails 作者 DHH 馬上寫了一個 OpenID 的 Plugin 供大家使用。由於我目前並沒有 implement OpenID 的計畫,所以就不 test 了,大家好好玩 :p


Update:有人寫了act_as_authenticated 跟 open_id 的結合
Uptdae:這裡有八個 Openid 跟 Rails 的Resource

2/27/2007

我加入了 SocialPicks 團隊

SocialPicks 是美國的一個有關於股票的 Social Network Service,他們也是用 Ruby on Rails 撰寫的。我在朋友的引見下,我加入了 SocialPicks 的團隊,擔任他們有關 Ruby on Rails 的技術方面的顧問工作。

2/25/2007

修改 Ruby 預設的 Time 顯示格式

Rails 預設的 Datetime format 是類似這樣的形式 「Sun Feb 25 15:43:00 +0800 2007」,這個形式老實說根本不能用,因為就算是英文網站,也沒有人會喜歡類似 +800 這樣的形式,中文就不用說了。雖然我們可以使用 Strftime 的函示修改他呈現的 format,但是有沒有辦法直接修改預設值呢?

當然有。請在 config 裡面加入
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.update(:default => '%Y年%m月%d日 %H:%M')
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.update(:default => '%Y年%m月%d日')
時間的格式就請參照 strftome 的格式即可。

如果你想多加幾個時間表現方式,也可以這樣寫。
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.update(:my_format => '%Y-%m-%d %H:%M')
然後,就可以這樣使用了
a.time.to_s(:my_format)
本範例參照此網頁

Mongrel 在 Locomotive 最新版上面的問題

這篇是 lukhnos在 PowerPC Mac 上拉火車頭要注意的繁體中文翻譯(XD)希望沒有翻譯失真@@!

Ruby on Rails 開發者都很喜歡 Locomotive 這個套件。不過最近一版的Locomotive (Jan 2007 bundle),卻驚傳裡面附帶的 Mongrel在 PowerPC Mac 上不會 work 了,無論按多少次 CMD-R ,就是不會 Listen 指定的 port 。奇怪的是 Intel Mac 無此現象。

這問題剛出現時,一度傳出的解決方法是…… 「請 PowerPC 使用者改用 lighttpd」…… -_- 後來終於有人發現,原來是 Mongrel 的 gem package 爛掉了,請隨便在 Locomotive 上面的列表,按 CMD-T 進 Terminal 後,下達以下指令:
gem update mongrel
然後重新啟動 Locomotive,Mongrel 就會在 PowerPC 上回神了。

唔,雖然嚴格說來,Lighttpd的速度比較快說……

據作者說,應該不久後就會有新的 bundle 了。


Dell Idea Storm 也用 Ruby on Rails


RailsCN 來的消息。Dell 公司的其中一個 Project Idea Storm,也是用 Ruby on Rails 來撰寫的。Dell Idea Storm 是一個簡單的 Digg Like 網站,不過他的目標是讓大家投票有關於 Dell 電腦販售的 Idea。題外話,根據 NetCraft 的報表顯示,他們是用 Mongrel 來跑的。

M$ 也加入 Ruby 這個大戰場了嗎?

InfoWorld 上面有消息指出,M$ 對 Ruby 這個程式語言非常有興趣,並且對於支援 Ruby 有很多想法。Microsoft is "very interested" in the Ruby programming language

"We are very interested in Ruby and have lots of thinking going on," but nothing to announce at this time, Key said. He advised chatters to "stay tuned."
不過在這個階段是屬於一些想法的階段,其他的還無可奉告。放話歸放話, M$ 到底要以什麼樣的形式加入 Ruby on Rails 戰場呢?我的看法是
  1. 強力主導開發 RubyCLR
  2. 官方的 Visual Stdio .NET Ruby支援
  3. 幫忙加強Ruby on Rails 的 SQL Server 支援
如此 Ruby 在 Windows 上面的情況就不是那麼肉腳了。

以下是本報導跟 Ruby 有關的原文

During an Internet chat with InfoWorld, Forest Key, Microsoft director of Web and client user experience marketing for the company's developer division, acknowledged Ruby is on the company's radar screen. Asked if the company would accommodate the Ruby on Rails Web framework, which is based on Ruby, in Expression, Key said, "Ruby is currently more of a 'developer' concept for us."

"We are very interested in Ruby and have lots of thinking going on," but nothing to announce at this time, Key said. He advised chatters to "stay tuned."

Key added he was not the Microsoft person to comment in detail on this subject because he did not know the company’s plans. One chatter expressed wishes for an IDE for Ruby on Rails from Microsoft.


2/23/2007

Java 跟 Ruby 的關係

Robbin 在接受記者採訪時談到對於 Jave 跟 Ruby 之間的關係,提出一些他的見解。看完之後相當的發人省思呀。

最讓我喜歡的是這兩段

综上所述采访,我们不难看出Java和Ruby不是两个相互对立的开发语言,对于Ruby和Java谁更具有优势的讨论意义已经不大,首先从 Java本身来讲,,Java有其自己的优势,并且 Java将会继续处于顶峰,并在企业应用上保持良好的表现,这一点毋庸置疑,并且已经得到了市场的证明。

  另外, Ruby有极强的文本处理能力,与Perl不分伯仲,同时,Ruby的语法简单,还有异常处理以及迭代器等构造使编程变得简单明了,这也正是我们所期待的下一代编程语言。
他認為 JAVA 優勢依舊,但是 Ruby 的許多特質的確是 next big thing 的極佳候選人。

  如果单从某一种语言的角度来看,我们似乎并不能看出什么,但是如果站在更高的位置,从不同的角度全面的看待问题,我们不难发现,二者将会求同存异,各自发挥自己的特长,从而使我们能构建出更加强大的应用程序。

  Sun 收购JRuby的同时,Charles Nutter JRuby 的核心开发者之一, Thomas Enobo也加入了Sun。这似乎能够让我们把Ruby和Java联系在一起,Sun公司如果能够在JVM上做充足的投入,更好地支持动态语言, 拥抱新的事物,依托Sun公司的强大实力和其自身独特的优点,Ruby必将会有巨大的市场,同时,Ruby也需要一个过渡期,在市场中得到验证,让更多的人去使用它,但就目前来讲Ruby已经从暗流涌动,开始扬帆远行!
JAVA 在 Open Source 之後,並且也收購了 JRuby ,還聘請了 JRuby 核心開發者,讓 JAVA 或是 Ruby 的格局可以看的更遠。JAVA可以利用 Ruby 跟 Ruby on Rails 的優點來彌補 JAVA 缺陷,而可以在 JVM 上面跑 Ruby 讓 Ruby 的市場大增,並且可以使用 JAVA 的 Lib 更是彌補不少的缺點。

或許,爭論 JAVA Ruby 誰被誰取代都沒有太大意義,共同發展,發揮兩者相乘的效果才是大家的福氣。

2/22/2007

使用 GMail SMTP 來幫你寄信

ActionMailer 自從上次介紹了 sendmail 寄信後,好像一直沒介紹如何用 smtp 來寄信。不過由於這個部分聖經本以及 Rails Wiki都介紹的非常詳細,我就請大家多看看書好了。這裡直接介紹如何使用 Gmail 的 SMTP Server 幫你寄信。

Anatol Pomozov 感嘆 Ruby 的標準處理 SMTP的 Lib Net:SMTP 一直不支援 TLS,於是他決定自己來寫。他寫了一個 tls 的 lib 叫做 smtp_tls.rb 。讓我們可以直接使用支援 TLS 的 SMTP Server 來幫我們寄信。

code 內容因為 license 不明,請大家直接去原作者出處來看。使用方是就是將這段 code 放入任何一個 Rails 讀的到的地方。然後在 config/enviroment.rb 裡面加入
require ‘smtp_tls’

最後在 config/enviroments/xxxxx.rb 裡面寫相關 Gmail 設定
ActionMailer::Base.server_settings = {
:address => "smtp.gmail.com",
:port => "587",
:domain => "localhost.localdomain",
:authentication => :plain,
:user_name => "你的Gmail account",
:password => "你的Gmail Password"
}


如此即可。

各 Ruby VM Performance 比較

Antonio Cangiano 發表了一篇大作 Ruby Implementations Shootout: Ruby vs Yarv vs JRuby vs Gardens Point Ruby .NET vs Rubinius vs Cardinal。裡面比較了 Ruby on Linux,Ruby on Windows,Yarv,jRuby,Ruby.NET,Rubinius,Cardinal 上面的 Ruby Performance 表現。結果出爐

YARV 大獲全勝!!!

這是最後結果,左邊是完成的時間,所以越短代表 performance 越快


除了 YARV 以外,每個其他的 VM 都輸給 Ruby on Linux 的效能,而且 YARV 在所有測試都沒有 Error,可靠性似乎不錯。

最令我期待的 JRuby 輸給了 YARV ,不過 JRuby 作者 Charles Oliver Nutter 出來說話了,他說他們還有秘密武器
This is JRuby in interpreted mode, compared to YARV, Ruby.NET, and Rubinius running with compiled code. Our prototype compiler has shown we can improve speed many times.
也就是其他的 VM 都有 Compiler mode,JRuby 的測試卻是用 interpreted mode 去比,當然效果不佳。而他們裡面內部研發的 JRuby Compiler 目前只有雛形,不過已經可以加快 many times 的速度。不過我認為 JRuby 還是先將可靠性跟 Bug 修完吧,裡面有四個 Test 有 Error。

總之,這是一個很好的測試, Ruby 的 VM 似乎已經刪減到在 YARV 或是 JRuby 之中做選擇了。

2/17/2007

新年快樂

過年前,我的生活有幾件大事
  1. 照計畫離開了樂多
  2. 預官考試分數還不差,應該可以當預官
  3. 又出現國防役的機會,而且這次我跟這間公司的感覺很對
或許我不會如期去當兵,我也可能會去國防役。

總之,希望今年是個好年,也祝大家新年快樂。

2/15/2007

Log Monitor : 簡便的分散式 log 管理工具

JavaEye 的 CVU 版友最近發表了一篇 Log Monitor - 把分散在各台server上的log集中起来monitor 的程式,主要功能是可以將分散在各個機器的 Rails log 給集合起來。主要是使用 net-ssh 連到各個 server,然後將指定好的 log 給 tail -f 起來。經過試用後發現程式簡單方便修改,但是輸出目前為止又很堪用,實在感謝他。License 是 CC 2.5 姓名,相同方式


config 寫法
config出現在第六行裡面的 modules.conf ,Modules.conf 寫法如下

log 所在的 server ip or domain name:
__username:ssh 的使用者名稱
__password:ssh user 的 password
__logs:
____/log/所在/目錄/log檔名:
______name: [在 log monitor 顯示的名稱]
______greps:
________error.log:
__________- ERROR
________info.log:
__________- INFO

程式寫法
### license: http://creativecommons.org/licenses/by-sa/2.5/deed.zh
### by: caoweiyuan#gmail.com
require 'net/ssh'

require 'yaml'
modules = YAML.load(File.open('modules.conf'))
### sample config
# engine-1:
# username: admin
# password: ******
# logs:
# /opt/apps/production/tomcat/logs/app.log:
# name: [module-1]
# greps:
# error.log:
# - ERROR
# info.log:
# - INFO

def do_grep(name, line, greps)
log = "[#{name}] - #{line}"

# default output to screen
puts log

# grep patterns to sepecific files
for log_file, patterns in greps
pattern = (patterns.class == Array) ? patterns.join("|") : patterns
File.open('log/' + log_file, 'a') {|f| f.puts log} if line =~ /#{pattern}/
# TODO: auto mail for errors
# TODO: horizontal log for different products, and delete after each process over.
end
end

def do_tail( session, log_file, log_conf )
session.open_channel do |channel|
channel.on_data do |ch, data|
data.each_line do |line|
do_grep log_conf['name'], line, log_conf['greps']
end
end
channel.exec "tail -1f #{log_file}"
end
end

for key, value in modules
t = Thread.new(key, value) do |host, host_conf|
Net::SSH.start( host, host_conf['username'], host_conf['password'] ) do |session|
puts "#{host} logged in."
for log_file, log_conf in host_conf['logs']
puts "start watching #{log_file}"
# open channels for multiple log files
do_tail session, log_file, log_conf
end # log
session.loop # important: loop to keep reading channel outputs
end # session
end # thread
end # host

# TODO: implement a formal deamon
loop do
# deamonize
sleep 1
end

2/11/2007

Ruby.NET Beta 0.6 Release

Ruby.NET 是一個以 Compiler 形式存在的 .NET Porting,Ruby.NET的目標是讓 .NET 的程式可以很方便的使用 Ruby 的一些 Component。他的作法是將 Ruby Code compile 成一個 .NET exe file。目前還在 Beta 階段,看起來 Bug 還是很多,作法似乎也不比 VM 來的更好。不過或許不失為另外一種方向的 Ruby 實做方式。

值的注意的是最後一段 Acknowledge

We wish to thank:

  • Microsoft for their technical and financial support of this project.
ㄜ,M$ 到底在想什麼呢?我倒覺得 RubyCLR 弄好一點比較實際。




2/09/2007

In-plcae-editing by Rails


ㄜ,其實真的很難解釋什麼叫做 in-place-editing 這個 AJAX 效果,簡單講就是你可以直接編輯畫面上某些欄位,而不用進入專門編輯的頁面,上圖就是最典型的效果。

這個效果廣泛的使用在 Flickr 以及其他的 AJAX 網頁。由於太過方便,常用,所以 script.aculo.us 就有這個效果,Rails 也對這個效果寫了相當方便的 Javascript Helper,並且做出一個相當完善的整合。雖然這個功能在 Rails 2.0 裡面即將被取消內建,轉為 plugin 形式,但是由於日常生活使用到的機會也蠻多的,我還是第一個 AJAX 效果就介紹這個。Ruby on Rails 上面要使用 in-place-editing 是相當相當方便的。一共有三步,我們假設我們想 in-place-editing abc model 裡面的 name column。

第一步:加入相關 Lib
在 HTML head 裡面加入相關 Javascritp Lib
javascript_include_tag :defaults


第二步:View
在view 裡面,你需要 in-place-editing的位置,加入相關 in-place-editor 的 field
in_place_editor_field 'abc' , 'name'


第三步:Controller
在你的 controller 裡面,加入 in-place-editor 的宣告
class AbcController < ApplicationController
in_place_edit_for :abc , :name
end


沒錯,不多不少三步就好。沒有任何 Javascript 宣告,只有簡潔有力的 Rails Style Coding,很棒吧。

中文化

如果你想將裡面內建的 ok , cancel 改成中文的話,請在 view 裡面使用
in_place_editor_field 'abc' , 'name' , {} , :save_text => '儲存' , :cancel_text => '取消' , :loading_text => '儲存中'
即可變成中文字。

多個 column in-place-editing

如果你想要一個 controller 有多個 in-place-editing 的 column,這裡就有點不方便了,可能必須要這樣寫
class AbcController < ApplicationController
in_place_edit_for :abc , :name
in_place_edit_for :abc , :nickname
end

延伸閱讀

2/07/2007

Another Ruby IDE:InterlliJ Idea for Ruby Plugin launch

這年頭是怎樣,由於Java IDE 戰場已經趨於平穩,所以全世界的 Java IDE 廠商開始爭奪 Ruby on Rails 市場了嗎?

自從 SapphireSteel Software 出了 Ruby in Steel 幾天後,Java IDE 公司之一的 JetBrains對於他們旗艦產品 IntelliJ Idea 發表了一個官方的 Ruby Plugin,目標當然是目前最熱的 Ruby on Rails 開發,這裡有一些 ScreenShot

DHH 也很識相的發表他感覺這對 Ruby 是一件好事,不過話語中似乎對 Java 帶了比酸黃瓜還要酸的酸味 XD

David Heinemeier Hansson, the creator of Ruby on Rails, greeted with enthusiasm Ruby's backing in IntelliJ.

"I think that's great news," Hansson said in an e-mail. "While I was doing Java, IntelliJ was the only thing that kept me from killing myself in frustration over the language. It still wasn't exactly happy programming, but IntelliJ helped mitigate some of the worst deficiencies of working in Java."


現在也有使用者發表使用心得了,看起來是不錯。

不对即使这样,我决定还是使用idea开发rails了,因为:

1.我平时工作中要用到java,我的IDE就是IDEA,使用习惯上一致了,不用再起个Eclipse了^^

2.IDEA的Ruby插件很完美的支持Code Reformat,这是别的编辑器做不到的

3.IDEA的Ruby插件语法检查比较出色.

4.对IDEA一贯的品质有信心,已经把java和jsp的ide做到那么出色,当然也可以把ruby的做好了,所以debug和auto complete功能的实现只是早晚的事




我本身是不用 IDE 啦,anyway,不管怎麼說,越多 IDE 加入代表這個市場會越來越壯大,絕對是一件好事。

Lightyror 備份站上線


居安要思危,狡兔要有三窟,對於 BSP 要信任,但是也要有防範於未然的心。感謝 WordPress.com 的優秀 import 機制,讓我在彈指之間架設好 LightyRoR 備份站台。雖然我知道 Blogger 很好,但是我還是會定時備份的,大家不需要害怕本 Blog 文章會因為哪天 Blogger 爆炸而不見。

DB Cluster / Replication in Active Record

突然看到了這篇文章,差點沒興奮的大叫出來!!!


I have done some extensive work on active record to allow for databases to be defined in terms of "connection pools" rather than simply one database. Most of the work was completed in connection_specification.rb and is done at this level to be compatible with any backend you choose. Also this patch maintains full compatibiltity with the current paradigm so no changes are necessary to current applications/documentation.

這是一個讓 Active Record 支援 Connection Pool 的技術,使用者可以在 config 裡面這樣寫

development_read_pool: db1, db2, db3
development_write_pool: db4, db5, db6

而這樣使用者就可以使用不同的 read write connection pool了。使用方式跟操作方式,我想等到我已經確定要怎麼玩了再講吧,Anyway,this is a very good starting point。

參考連結
  1. RFourm:Support for DB Clusters/Replication in ActiveRecord

2/05/2007

Rails 的負載度議題 XD

今天早上 Ruby on Rails Blog 上面有一篇非常聳動的文章 Joyent makes Rails app go to 4,000 req/sec,在我看到內文之後就笑了。這不是在吹噓 Ruby on Rails 有多厲害,而是在幫 F5 Big-IP 打廣告。F5 Big-IP 是一個 HA 的 load balancing System,他會將 request redirect 到 backend server。


這個例子只能證明一件事,只要根據之前講過的 Ruby on Rails 伺服器架設原理,參照類似這樣的架構

這個架構在高負載之下會遇到的問題,在於前端的 HA Server 以及後端的 DB Server,而Ruby on Rails 效率方面是可以很簡單的用增加 Mongrel Server Farm 的數量來解決的。

也就是說,只要後端 DB 夠強夠快,前端的 HA 夠棒,是沒啥大問題的。而這個聳動的例子,因為沒有使用到 DB 的 Operation ,所以 Bottleneck 就只會出現在 HA 這端,只要前端 HA 夠力,別說 4000 req / sec,40000 req / sec 也是沒啥大問題的。

2/04/2007

TIOBE 2月排行:進入盤整期



在一整年的衝刺之後,終於 Ruby 的動能終於進入了盤整的階段。這次僅僅小幅上漲,並且還是居於第十名。與其說 Ruby 退燒,倒不如講 Ruby 處於他現在應該在的位置,3P加Javascript 之後,Dynamic Language 的老五。

再來 Ruby 上面的對手真的每個都不是好惹的,未來的走勢應該會處於平穩上升的階段,排名跟佔有率的上漲幅度應該有限。不過,恐怕 Ruby 社群開始持續高度動力,才會繼續成長。加油吧,Ruby and Ruby on Rails。

附帶一題,我看好 Ruby 跟 Javascript 會有繼續維持成長的動力,Python 保持平盤,Perl 跟 PHP 會保持緩慢下滑的態勢。不過這幾者之間的排行應該短期內不會有大幅度的變動。




Position
Feb 2007
Programming
Language
Ratings
Feb 2007
Delta
Feb 2006
1 Java 18.978% -3.45%
2 C 16.104% -2.23%
3 C++ 10.768% -0.53%
4 PHP 8.847% -0.07%
5 (Visual) Basic 8.369% -1.03%
6 Perl 6.073% -0.63%
7 Python 3.566% +0.90%
8 C# 3.189% -0.78%
9 JavaScript 2.982% +1.47%
10 Ruby 2.528% +2.12%

2/03/2007

Ruby in Steel Release



Ruby in Steel 是 SapphireSteel Software 為了 Ruby 還有 Rails 社群所開發的 Visual Stdio 2005 Add-on,也就是說這是一個擁有 Visual Stdio 2005 強大 IDE 能力的 Ruby and Ruby on Rails 開發工具。我想,隨著這個東西的出現,整個 Ruby on Rails IDE 拼圖已經差不多拼完了,「Ruby on Rails 欠缺良好 IDE」這個論點也已經沒有任何的強度了。

這裡有一連串 ScreenShot 可以看看他是長什麼樣子。價錢方面他有一個 limit time offer 大概是 199 美金,但是當然也有 免費的Personal Edition,只是功能上當然有所限制。這個東西的出現,就是要鎖定企業級 IDE 使用。

只要一個 Framework 有很多人用,什麼速度,效率,IDE,第三方 Lib 的問題,全部都是小問題,都會其他人幫忙被解決掉。

jRuby on Rails almost Ready



我從來不是 SUN 的擁護者,但是 SUN 自從全職聘請 jRuby 作者開發 jRuby 之後,開發進度實在是驚人的快呀。JRuby 作者Charles Oliver Nutter 最近廣招測試者來測試 jRuby ,並且告訴大家,距離 jRuby 支援 Ruby on Rails 只有一步之遙。

  • ActionPack is now "practically" 100% working, minus a test or two we can't support and a few tests that are broken or that run fine in isolation (it would be nice to know *why* those fail)
  • ActiveSupport is well above 95% passing
  • ActiveRecord is in the 90% range passing with MySQL and in the 80% range with Derby
這篇講解了一些如何在 Mac OS X Tiger 上面使用 jRuby 的方式。


Ruby on PSP?


DSCN0841
Originally uploaded by eason.
果然學長說的好「有人的地方就有江湖」,所以有 OS 的地方就有 Hacking XD JavaEyE 上面有一位 raimundox 將 Ruby Porting 到 PSP 上面,並且也放到 RubyForge 上面了,真是太有趣了。

所以以後我們可以邊打電動邊寫 Ruby CodeXD 還是我們可以寫一些 Ruby Shell Script 將我們遊戲記錄檔定時備份到遠端機器上XD

BTW,我真的希望有人可以把 Ruby 放到 iPhone 上面,畢竟一個跑 High End OS 的 Smart Phone 不好好 Hacking 真的太可惜了。

PS. iPhone 是 MAC OS X Based。

Rails Conf 2007 開放註冊,要搶要快


Rails 社群一年一度的大拜拜開放註冊了,時間是五月17 ~20,地點是 Portland Oregon。 價錢就別說了....好貴呀。不過要搶要快,開放註冊幾個小時之後, 1/3 的位子已經不見了

本次 Rails Conf Tutorial 大致上是
  • Intro to Test-Driven Development for Rails
  • Scaling a Rails Application from the Bottom Up
  • Is JavaScript Overrated? Or: How I Stopped Worrying and Put Prototype and script.aculo.us to Full Use
  • Your First Day with JRuby on Rails
  • Streamlined
  • Harnessing Capistrano
  • Rails Routing Roundup
  • When V is for Vexing; Patterns to DRY up Your Views
基本上所有 Ruby 界有頭有臉的人物都會出席。主講人陣容堅強,David 三兄弟,Jim Weirich(Gem開發者),Jamis Buck(Capistrano開發者),Chad Fowler(Ruby Central, Inc 創辦人之一),Thomas Fuchs( script.aculo.us 開發者)....等等。

結論是好想去呀..................