Andrew Grimm Universityof New South Wales ニューサウスウェールズ大学 (UNSW) RubyKaigi 2011 日本 Ruby 会議 2011 Finding Black Holes in Ruby with the Small Eigen Collider 小型特異衝突型加速器で Ruby 内のブラックホールの特異点を見つける方法
2.
tl;dr Too Long,Didn't Read( 長過ぎてよんでられない ) Creates random code. Metaprogramming magic! ランダムなコードを作成します。メタプログラミングマジック!
3.
Why? なんで? Whydid I create the Small Eigen Collider? なぜ私は小型特異衝突型加速器を作成した ?
Looking at mutations私は突然変異で探しています Start with viruses with identical DNA sequence 同一の DNA 配列を持つウイルスで始まります Allow to reproduce for one generation in laboratory 実験室内の 1 つの世代のために再現することができます Determine DNA sequence of new viruses 新しいウイルスの DNA 配列を決定する Differences are mutations 違いは突然変異です
6.
Big data ビッグデータLooking at approximately 500,000 sequences 約 50 万シーケンスを見て Approx. 150,000,000 DNA letters (A, C, G, T) 約。 1.5 億 DNA の文字( A 、 C 、 G 、 T ) For comparison, human genome is 3,000,000,000 letters 比較のために、ヒトゲノムは 30 億文字です
How slow ismy application? 私のアプリのスピード Currently using YARV Ruby 1.9.1 My application looks at 500,000 sequences 50万件のルックアップ An analysis takes 20 minutes 解析には20分かかる
JRuby Faster atsome tasks Real multithreading (no GIL) 特定の処理は高速で真のマルチスレッド
12.
Rubinius Faster atsome tasks Real multithreading Real Soon Now 特定の処理は高速で真のマルチスレッドも近日リリース
13.
Ruby Enterprise EditionMainly better at garbage collection GC が良い。 More relevant to Rails developers than me Rails 開発者向き
14.
How do Iknow it'll give the correct results? どのように私はそれが正しい結果を与えているか知ることができる? Should I switch to a faster Ruby? もっと早い Ruby 実装に乗り換えるべき?
15.
What kind oferrors worry me? どういうエラーが心配? Large, obvious bugs that cause an exception are fine エラーを生じる明らかなバグはあまり心配なし Small, subtle bugs that give an incorrect result are bad 些細でまちがった結果を生じるバグがやばめ
16.
Other implementations arewrong 他の実装が間違っている Ran my project against Rubinius – 1 unit test failed Rubinius で自分のプロジェクトを走らせてみた - テストが一つ失敗した
17.
Other implementations arewrongerer 他の実装では、さらに間違っている Ran BioRuby with Rubinius – 1 unit test failed Rubinius で BioRuby を走らせてみた - テストが一つが失敗した
18.
Even JRuby isnot immune JRuby も例に漏れず Made mistakes in the complicated task of splitting a file into lines ファイルを行に分割する複雑な作業でミス
19.
How many bugscause 0 failures? Fail しないバグはいくつ? 3 bugs caused 1 unit test failure each 3つのバグがそれぞれ一つの Fail テストを生じる How many bugs caused 0 unit test failures each? では Fail してない時のバグはいくつ?
20.
How can Ibe sure there weren't others? どのように他のエラーがないことを確認することができる? Rubinius and JRuby had failed me. RubySpec had failed me. Rubinius でも JRuby でも RubySpec でもうまくいかなかった
Bugs are simpleソフトウェアのバグは簡単 Isolate them to a single failure, not several failures 、複数のフェイルがでているコードを単一のフェイルがでているところまで分離
24.
Bugs are simpleto fix バグの修正は簡単 Rubinius folk fixed bugs promptly Rubinius 開発者で 1 日以内にバグを修正 String#split 1 day (1 日 ) StringIO#gets 1 day (1 日 ) String#casecmp 3 days (3 日 )
25.
Unexplored territory 未踏の領域Bugs are from trying something not done before バグというのは今まで行われていなかった領域に足を踏み込む前に現れる
26.
I'm happy toreport that this is the first ever "Rubinius doesn't support flipflop" bug. I've been waiting for this day. 「 Rubinius がほげほげをサポートしてない」的なバグリポートをする日をずっと待っていた I'll go ahead and implement it now, I was waiting for someone to report it. It only took 5 years. 今すぐ実装するよ。だれかがリポートしてくれるのを5年間待ってたし
Task creation –objects タスクの作成 - オブジェクト Receiver and parameters are objects chosen at random, with a random number of parameters レシーバとパラメータはランダムに作成されたオブジェクト
32.
Task creation –method タスクの作成 - メソッド Potential methods based on reflection リフレクションによるメソッド候補作成 "a".methods # => [:upcase, :zip, ..., :casecmp, …] Method chosen at random 最後はランダムに選ばれる
Inconsistencies in inspectinspect の結果が実装ごとに異なる inspect has different results between implementations Default: #<StringIO:0x10169cfd8> Rubinius: #<StringIO:0xf7c @string="" @lineno=0 @append=false @readable=true @writable=true @pos=0>
41.
False alarms 誤報Is giving nil rather than false a problem? "false" でなく "nil" を与える事は問題? "\n".is_binary_data? Rbx, MRI 1.8: false JRuby 1.8: nil
String#casecmp testing Testingeverything except “happy path”! エッジケースのみテスト describe "String#casecmp" do it "is a case-insensitive version of String#<=>" do "abcdef".casecmp("abcde").should == 1 "aBcDeF".casecmp("abcdef").should == 0 "abcdef".casecmp("abcdefg").should == -1 "abcdef".casecmp("ABCDEF").should == 0 end # Snipped I18N tests end
Other bugs independentof SEC SEC とは別に見つかったバグ "XabXcd".split("X", 2) # => ["ab"] but no "cd" StringIO.new("phone").gets("on") # => gives "pho" when it should give "phon"
49.
Thankyou! Domo arigato!どうもありがとう Translations: Makoto Inoue-san mame2-san Google Translate-san