MacRuby on RailsAbstractMacRuby is an implementation of Ruby 1.9 that is built directly ontop of Mac OS X core technologie...
Kouji Takao
Work• Network Applied Communication Laboratory Ltd.• System design, programming, planning and meeting
Spare Time• MacRuby committer  ➡Core• cRuby committer  ➡Readline module
Contact         Information• kouji.takao@gmail.com• @takaokouji_en• http://facebook.com/takaokouji (mainly in Japanese)
My Company
My Company• Network Applied Communication  Laboratory Ltd.
My Company• Network Applied Communication  Laboratory Ltd.• a.k.a NaCl
My Company• Network Applied Communication  Laboratory Ltd.• a.k.a NaCl  ➡ means salt
My Company
My Company• http://www.netlab.jp/
My Company• http://www.netlab.jp/• Shimane, Japan
My Company• http://www.netlab.jp/• Shimane, Japan• Since 2001
My Company• http://www.netlab.jp/• Shimane, Japan• Since 2001  ➡ 10th Anniversary!
My Company• http://www.netlab.jp/• Shimane, Japan• Since 2001  ➡ 10th Anniversary!• 57 people
My Company• http://www.netlab.jp/• Shimane, Japan• Since 2001  ➡ 10th Anniversary!• 57 people  ➡ 6 people are cRuby commit...
My Company• http://www.netlab.jp/• Shimane, Japan• Since 2001  ➡ 10th Anniversary!• 57 people  ➡ 6 people are cRuby commit...
The NaCl Way
The NaCl Way  NaCls President
The NaCl Way
The NaCl Way First, I want You to be happy.
The NaCl Way First, I want You to be happy. Next, I want you to make Your Family happy.
The NaCl Way First, I want You to be happy. Next, I want you to make Your Family happy. Finally, if you have more happines...
The NaCl Way   (as I see it)
The NaCl Way               (as I see it)Employee• First: Employee
The NaCl Way               (as I see it)                EmployeesEmployee                  Family• First: Employee• Next: ...
The NaCl Way               (as I see it)                EmployeesEmployee                       Company                  F...
The NaCl Way              (as I see it)                EmployeesEmployee                      Company                  Fam...
The NaCl Way              (as I see it)                           y                          m !                      e y!...
MacRuby on Rails
MacRuby on Rails
MacRuby on Rails
MacRuby on RailsIn my presentation,I will explain how I modified MacRuby tomake it a suitable foundation for running Rails....
MacRuby on Rails
MacRubyRuby customized for Mac OS X
MacRuby
MacRuby• MacRuby is a unique blend of Ruby 1.9 and Objective-C.
MacRuby• MacRuby is a unique blend of Ruby  1.9 and Objective-C.• The goal of the MacRuby project is  to be 100% compatibl...
Ruby 1.9          Application             Ruby 1.9                        Built-in  Ruby VM                          GC  B...
Ruby 1.9          Application             Ruby 1.9                        Built-in  Ruby VM                          GC  B...
Ruby 1.9          Application             Ruby 1.9                        Built-in  Ruby VM                          GC  B...
Ruby 1.9          Application             Ruby 1.9                        Built-in  Ruby VM                          GC  B...
Ruby 1.9          Application             Ruby 1.9                        Built-in  Ruby VM                          GC  B...
Ruby 1.9          Application             Ruby 1.9                        Built-in  Ruby VM                          GC  B...
Ruby 1.9          Application             Ruby 1.9                        Built-in  Ruby VM                          GC  B...
Ruby 1.9          Application             Ruby 1.9                        Built-in  Ruby VM                          GC  B...
Ruby 1.9          Application             Ruby 1.9                        Built-in  Ruby VM                          GC  B...
Ruby 1.9          Application             Ruby 1.9                        Built-in  Ruby VM                          GC  B...
MacRuby       Application           MacRuby                      Built-inRuby VM                        GCBuilt-in        ...
MacRuby       Application           MacRuby                      Built-inRuby VM                        GCBuilt-in        ...
MacRuby       Application           MacRuby                      Built-inRuby VM                        GCBuilt-in        ...
MacRuby       Application           MacRuby                      Built-inRuby VM                        GCBuilt-in        ...
MacRuby       Application           MacRubyRuby VM           AutoZone                      Built-in                       ...
MacRuby             Application                 MacRuby      Ruby VM           AutoZone                            Built-i...
MacRuby                   Application                       MacRuby           Ruby VM            AutoZone                 ...
MacRuby             Application                 MacRuby      Ruby VM           AutoZone                            Built-i...
MacRuby             Application                 MacRuby      Ruby VM           AutoZone                            Built-i...
MacRuby             Application                 MacRuby      Ruby VM           AutoZone                            Built-i...
MacRuby             Application                 MacRuby      Ruby VM           AutoZone                            Built-i...
MacRuby               Application                  MacRuby                                AutoZone                        ...
MacRuby on RailsMaking Ruby on Rails work on MacRuby
Current Status
Current Status$ rails new demo
Current Status$ rails new demo      $ rails generate scaffold ...
Current Status$ rails new demo      $ rails generate scaffold ...             $ rails server
Current Status$ rails new demo      $ rails generate scaffold ...             $ rails server
7 months ago...
7 months ago...March 2011 in Japan
7 months ago...March 2011 in Japan• I thought, "Does Rails work on MacRuby?".
7 months ago...March 2011 in Japan• I thought, "Does Rails work on MacRuby?".• I managed to install Rails.$ sudo macgem in...
Perhaps...
Perhaps...• I thought, "OK, its installed, but surely  the Rails generators wont work...".
Perhaps...  • I thought, "OK, its installed, but surely     the Rails generators wont work...".  • However, I managed to c...
Are you kidding me?
Are you kidding me?• I tried to generate a scaffold...
Are you kidding me?• I tried to generate a scaffold...• It failed. After all Rails didnt work on   MacRuby.$ macruby -S ra...
Are you kidding me?• I tried to generate a scaffold...• It failed. After all Rails didnt work on   MacRuby.$ macruby -S ra...
My approach  Run RailsSEGV or abort  Research   CodingRun RubySpec  Run Rails
My approach  Run RailsSEGV or abort  Research   CodingRun RubySpec  Run Rails
My approach  Run RailsSEGV or abort  Research   CodingRun RubySpec  Run Rails
My approach  Run RailsSEGV or abort  Research   CodingRun RubySpec  Run Rails
My approach  Run RailsSEGV or abort  Research   CodingRun RubySpec  Run Rails
My approach  Run RailsSEGV or abort  Research   CodingRun RubySpec  Run Rails
Coding      My approachRun RubySpec  Run RailsSEGV or abort  Research   CodingRun RubySpec
Coding      My approachRun RubySpec  Run Rails                Required knowledgeSEGV or abort   and technology            ...
A couple of examples ofwhat I have fixed so far
#860 catch/throw                 (in "old" MacRuby)➡ MacRuby aborts if you use catch and throw inside  a rescue clause.
#860 catch/throw                 (in "old" MacRuby)➡ MacRuby aborts if you use catch and throw inside  a rescue clause.01:...
#860 catch/throw                    (in "old" MacRuby)  ➡ MacRuby aborts if you use catch and throw inside     a rescue cl...
Exception Handling      (in MacRuby)
Exception Handling            (in MacRuby)01: begin02:   raise "A"03: rescue04:   begin05:     raise "B"06:   rescue07:   ...
Exception Handling            (in MacRuby)01: begin02:   raise "A"03: rescue04:   begin05:     raise "B"06:   rescue07:   ...
Exception Handling            (in MacRuby)01: begin02:   raise "A"03: rescue04:   begin05:     raise "B"06:   rescue07:   ...
Exception Handling             (in MacRuby)01: begin02:   raise "A" push03: rescue04:   begin05:     raise "B"06:   rescue...
Exception Handling             (in MacRuby)01: begin02:   raise "A" push03: rescue04:   begin05:     raise "B"06:   rescue...
Exception Handling             (in MacRuby)01: begin02:   raise "A" push03: rescue04:   begin05:     raise "B" push06:   r...
Exception Handling             (in MacRuby)01: begin02:   raise "A" push03: rescue04:   begin05:     raise "B" push06:   r...
Exception Handling             (in MacRuby)01: begin02:   raise "A" push03: rescue04:   begin05:     raise "B" push06:   r...
Exception Handling             (in MacRuby)01: begin02:   raise "A" push03: rescue04:   begin05:     raise "B" push06:   r...
Exception Handling and catch / throw             (in MacRuby)                            Exception Stack
Exception Handling and catch / throw             (in MacRuby)01: catch(:foo) {02:   begin03:     raise "A"04:   rescue05: ...
Exception Handling and catch / throw             (in MacRuby)01: catch(:foo) {02:   begin03:     raise "A"04:   rescue05: ...
Exception Handling and catch / throw             (in MacRuby)01: catch(:foo) {02:   begin03:     raise "A" push04:   rescu...
Exception Handling and catch / throw             (in MacRuby)01: catch(:foo) {02:   begin03:     raise "A" push04:   rescu...
Exception Handling and catch / throw             (in MacRuby)01: catch(:foo) {02:   begin03:     raise "A" push04:   rescu...
Exception Handling and catch / throw             (in MacRuby)01: catch(:foo) {02:   begin03:     raise "A" push04:   rescu...
throw               (in "old " MacRuby)Before being fixed(60723bf~), throw alwayspopped the current Exception.vm.cpp:4321:V...
throw               (in "old " MacRuby)Before being fixed(60723bf~), throw alwayspopped the current Exception.vm.cpp:4321:V...
throw               (in "old " MacRuby)Before being fixed(60723bf~), throw alwayspopped the current Exception.vm.cpp:4321:V...
#860 catch/throw          (in "old" MacRuby)01: begin02:   raise "A"03: rescue04:   catch(:foo) { throw :foo }05: end     ...
#860 catch/throw          (in "old" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { throw :foo }05: end...
#860 catch/throw          (in "old" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { throw :foo }05: end...
#860 catch/throw          (in "old" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { throw :foo }       ...
#860 catch/throw          (in "old" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { throw :foo }       ...
#860 catch/throw          (in "old" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { throw :foo }       ...
How to fix          (in "new" MacRuby)01: begin02:   raise "A"03: rescue04:   catch(:foo) { throw :foo }05: end            ...
How to fix          (in "new" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { throw :foo }05: end       ...
How to fix          (in "new" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { throw :foo }              ...
How to fix          (in "new" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { throw :foo }              ...
How to fix          (in "new" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { throw :foo }              ...
How to fix                (in "new" MacRuby)In the new implementation, MacRuby only popsexceptions when necessary (60723bf)...
How to fix                (in "new" MacRuby)In the new implementation, MacRuby only popsexceptions when necessary (60723bf)...
How to fix                (in "new" MacRuby)In the new implementation, MacRuby only popsexceptions when necessary (60723bf)...
#860 Fixed            (in "new" MacRuby)01: begin02:   raise "A"03: rescue04:   catch(:foo) {05:     begin06:        raise...
#860 Fixed            (in "new" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { store05:     begin06:  ...
#860 Fixed            (in "new" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { store05:     begin06:  ...
#860 Fixed            (in "new" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { store05:     begin06:  ...
#860 Fixed            (in "new" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { store05:     begin06:  ...
#860 Fixed            (in "new" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { store05:     begin06:  ...
#860 Fixed            (in "new" MacRuby)01: begin02:   raise "A" push03: rescue04:   catch(:foo) { store05:     begin06:  ...
#1192 Constant Lookup➡ MacRuby failed to correctly look up  constants in a number of situations when  you used module_eval...
#1192 Constant Lookup➡ MacRuby failed to correctly look up  constants in a number of situations when  you used module_eval...
#1192 Constant Lookup   ➡ MacRuby failed to correctly look up     constants in a number of situations when     you used mo...
#1192 Constant Lookup   ➡ MacRuby failed to correctly look up     constants in a number of situations when     you used mo...
#1192 Constant Lookup   ➡ MacRuby failed to correctly look up     constants in a number of situations when     you used mo...
Constant Lookup     (in cRuby)
Constant Lookup             (in cRuby)1: module A2:   module B3:     CONST = "B’s Const"4:     module ::A5:       p CONST6...
Constant Lookup             (in cRuby)1: module A2:   module B3:     CONST = "B’s Const"4:     module ::A5:       p CONST6...
Constant Lookup             (in cRuby)1: module A2:   module B3:     CONST = "B’s Const"4:     module ::A5:       p CONST6...
Constant Lookup             (in cRuby)1: module A2:   module B3:     CONST = "B’s Const"4:     module ::A5:       p CONST6...
Constant Lookup             (in cRuby)1: module A2:   module B3:     CONST = "B’s Const"4:     module ::A5:       p CONST6...
Constant Lookup             (in cRuby)1: module A2:   module B3:     CONST = "B’s Const"4:     module ::A5:       p CONST6...
Constant Lookup               (in cRuby)1: module A       Lexical Scope2:   module B3:     CONST = "B’s Const"4:     modul...
Constant Lookup                  (in cRuby)1: module A         Lexical Scope2:   module B3:     CONST = "B’s Const"4:     ...
Constant Lookup           (in "old" MacRuby)MacRuby had not implemented LexicalConstant Lookup.1: module A2:   module B3: ...
Constant Lookup           (in "old" MacRuby)MacRuby had not implemented LexicalConstant Lookup.1: module A2:   module B3: ...
Constant Lookup                     (in "old" MacRuby)      MacRuby had not implemented Lexical      Constant Lookup.     ...
Constant Lookup is complex          (in cRuby)
Constant Lookup is complex                            (in cRuby)       class_eval(&Block)                 class_eval(Strin...
class_eval(&Block)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval {05:         p CONST06:     ...
class_eval(&Block)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval {05:         p CONST06:     ...
class_eval(&Block)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval {05:         p CONST06:     ...
class_eval(&Block)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval {05:         p CONST06:     ...
class_eval(&Block)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval {05:         p CONST06:     ...
class_eval(&Block)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval {05:         p CONST06:     ...
class_eval(&Block)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval {05:         p CONST06:     ...
class_eval(&Block)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval {05:         p CONST06:     ...
class_eval(&Block)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval {05:         p CONST06:     ...
class_eval(&Block)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval {05:         p CONST06:     ...
class_eval(&Block)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval {05:         p CONST06:     ...
class_eval(&Block)01:   module A      Lexical Scope02:     CONST = "As CONST"03:     def f()04:       class_eval {05:     ...
class_eval(&Block)01:   module A       Lexical Scope02:     CONST = "As CONST"03:     def f()04:       class_eval {05:    ...
class_eval(String)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval <<-EOS05:         p CONST06:...
class_eval(String)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval <<-EOS05:         p CONST06:...
class_eval(String)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval <<-EOS05:         p CONST06:...
class_eval(String)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval <<-EOS05:         p CONST06:...
class_eval(String)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval <<-EOS05:         p CONST06:...
class_eval(String)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval <<-EOS05:         p CONST06:...
class_eval(String)01:   module A02:     CONST = "As CONST"03:     def f()04:       class_eval <<-EOS05:         p CONST06:...
Constant Lookup is complex                            (in cRuby)       class_eval(&Block)                 class_eval(Strin...
I somehow managed to fix this          (in MacRuby)
I somehow managed to fix this                      (in MacRuby)• Three attempts to get it right.
I somehow managed to fix this                    (in MacRuby)• Three attempts to get it right.• More than 3000 lines of cod...
I somehow managed to fix this                     (in MacRuby)• Three attempts to get it right.• More than 3000 lines of co...
A very complex bug     (in "new" MacRuby)
A very complex bug            (in "new" MacRuby)01:   module A02:     B = 4203:   end04:05:   A.class_eval do06:     def s...
A very complex bug            (in "new" MacRuby)01:   module A02:     B = 4203:   end04:05:   A.class_eval do06:     def s...
A very complex bug            (in "new" MacRuby)01:   module A02:     B = 4203:   end04:05:   A.class_eval do06:     def s...
A very complex bug            (in "new" MacRuby)01:   module A02:     B = 4203:   end04:05:   A.class_eval do06:     def s...
A very complex bug            (in "new" MacRuby)01:   module A02:     B = 4203:   end04:05:   A.class_eval do06:     def s...
A very complex bug            (in "new" MacRuby)01:   module A02:     B = 4203:   end04:05:   A.class_eval do06:     def s...
A very complex bug            (in "new" MacRuby)01:   module A02:     B = 4203:   end04:05:   A.class_eval do06:     def s...
A very complex bug            (in "new" MacRuby)01:   module A02:     B = 4203:   end04:                       Lexical05: ...
A very complex bug               (in "new" MacRuby)CAUTIONclass_eval does not add its own receiver    01: module A(A) 02: ...
A very complex bug                 (in cRuby)01:   module A02:     B = 4203:   end04:05:   A.class_eval do06:     def self...
A very complex bug               (in cRuby)01:   module A02:     B = 42      end uby 1.903:     R04:      ➡4205:   A.class...
A very complex bug                 (in cRuby)   01: module A   02:      B = 42   03: end uby   1.9            R   04:     ...
A very complex bug                 (in cRuby)   01: module A   02:      B = 42   03: end uby   1.9            R   04:     ...
Demo$ rails new demo      $ rails generate scaffold ...             $ rails server
#1390 rb_vm_prepare_block➡ Abort if the "About your application’s    environment" is link is clicked.                     ...
The MacRuby train trip     continues...
The MacRuby train trip     continues...http://ww            w.macrub                    y.org/
The MacRuby train trip     continues...    u by                         m acrhttp://ww             @          w.macrub    ...
The MacRuby train trip     continues...    u by                         m acrhttp://ww             @          w.macrub    ...
The MacRuby train trip       continues...    u by                           m acr  http://ww             @            w.ma...
Conclusion
Conclusion• MacRuby ➡MacRuby is a unique blend of Ruby 1.9 and     Objective-C.  ➡The goal is to be 100% compatible with R...
Conclusion• MacRuby ➡MacRuby is a unique blend of Ruby 1.9 and     Objective-C.  ➡The goal is to be 100% compatible with R...
Acknowledgment
Acknowledgment• The RubyConf hosts and organizers
Acknowledgment• The RubyConf hosts and organizers• Tor Yamamoto-Sorensen (@shakaijin)
Acknowledgment• The RubyConf hosts and organizers• Tor Yamamoto-Sorensen (@shakaijin)• Everyone present today
Thank you
Q &A• If you have a question, please ask me, but if  possible please speak slowly.• or contact @takaokouji_en by Twitter• ...
Upcoming SlideShare
Loading in …5
×

MacRuby on Rails

8,773 views

Published on

This is my presentation in RubyConf 2011, 30th Octobar 2011,New Orleans in the U.S.

Abstract:
MacRuby is an implementation of Ruby 1.9 that is built directly on top of Mac OS X core technologies. Recently, MacRuby has become viable as a tool for developing useful desktop applications for Mac OS X. However, as of March 2011, MacRuby is still missing some functionality that is present in cRuby. Therefore, MacRuby is not able to run Ruby on Rails. In my presentation, I will explain how I modified MacRuby to make it a suitable foundation for running Rails. I would also like to explain some of the technical intricacies that I discovered along the way.

RubyConf 2011:
http://rubyconf.org/

Published in: Technology
  • Be the first to comment

MacRuby on Rails

  1. MacRuby on RailsAbstractMacRuby is an implementation of Ruby 1.9 that is built directly ontop of Mac OS X core technologies. Recently, MacRuby hasbecome viable as a tool for developing useful desktop applicationsfor Mac OS X. However, as of March 2011, MacRuby is stillmissing some functionality that is present in cRuby. Therefore,MacRuby is not able to run Ruby on Rails. In my presentation, Iwill explain how I modified MacRuby to make it a suitablefoundation for running Rails. I would also like to explain some ofthe technical intricacies that I discovered along the way. This presentation was made possible by
  2. Kouji Takao
  3. Work• Network Applied Communication Laboratory Ltd.• System design, programming, planning and meeting
  4. Spare Time• MacRuby committer ➡Core• cRuby committer ➡Readline module
  5. Contact Information• kouji.takao@gmail.com• @takaokouji_en• http://facebook.com/takaokouji (mainly in Japanese)
  6. My Company
  7. My Company• Network Applied Communication Laboratory Ltd.
  8. My Company• Network Applied Communication Laboratory Ltd.• a.k.a NaCl
  9. My Company• Network Applied Communication Laboratory Ltd.• a.k.a NaCl ➡ means salt
  10. My Company
  11. My Company• http://www.netlab.jp/
  12. My Company• http://www.netlab.jp/• Shimane, Japan
  13. My Company• http://www.netlab.jp/• Shimane, Japan• Since 2001
  14. My Company• http://www.netlab.jp/• Shimane, Japan• Since 2001 ➡ 10th Anniversary!
  15. My Company• http://www.netlab.jp/• Shimane, Japan• Since 2001 ➡ 10th Anniversary!• 57 people
  16. My Company• http://www.netlab.jp/• Shimane, Japan• Since 2001 ➡ 10th Anniversary!• 57 people ➡ 6 people are cRuby committers
  17. My Company• http://www.netlab.jp/• Shimane, Japan• Since 2001 ➡ 10th Anniversary!• 57 people ➡ 6 people are cRuby committers• SI, Training, etc...
  18. The NaCl Way
  19. The NaCl Way NaCls President
  20. The NaCl Way
  21. The NaCl Way First, I want You to be happy.
  22. The NaCl Way First, I want You to be happy. Next, I want you to make Your Family happy.
  23. The NaCl Way First, I want You to be happy. Next, I want you to make Your Family happy. Finally, if you have more happiness left, then please share it with Our Company :)
  24. The NaCl Way (as I see it)
  25. The NaCl Way (as I see it)Employee• First: Employee
  26. The NaCl Way (as I see it) EmployeesEmployee Family• First: Employee• Next: Employees Family
  27. The NaCl Way (as I see it) EmployeesEmployee Company Family• First: Employee• Next: Employees Family• Finally: Company
  28. The NaCl Way (as I see it) EmployeesEmployee Company Family• First: Employee• Next: Employee Family• Finally: Company
  29. The NaCl Way (as I see it) y m ! e y! v n Employees lo aEmployee Company Family I p•• First: Employee c o m Next: Employee Family• Finally: Company
  30. MacRuby on Rails
  31. MacRuby on Rails
  32. MacRuby on Rails
  33. MacRuby on RailsIn my presentation,I will explain how I modified MacRuby tomake it a suitable foundation for running Rails.I would also like to explain some of the MacRuby on Railstechnical internals that I discovered along theway.
  34. MacRuby on Rails
  35. MacRubyRuby customized for Mac OS X
  36. MacRuby
  37. MacRuby• MacRuby is a unique blend of Ruby 1.9 and Objective-C.
  38. MacRuby• MacRuby is a unique blend of Ruby 1.9 and Objective-C.• The goal of the MacRuby project is to be 100% compatible syntactically and behaviorally with Ruby 1.9.
  39. Ruby 1.9 Application Ruby 1.9 Built-in Ruby VM GC Built-in Standard Library Library System libraries OS(Linux,Windows,Mac OS X,etc...)
  40. Ruby 1.9 Application Ruby 1.9 Built-in Ruby VM GC Built-in Standard Library Library System libraries OS(Linux,Windows,Mac OS X,etc...)
  41. Ruby 1.9 Application Ruby 1.9 Built-in Ruby VM GC Built-in Standard Library Library System libraries OS(Linux,Windows,Mac OS X,etc...)
  42. Ruby 1.9 Application Ruby 1.9 Built-in Ruby VM GC Built-in Standard Library Library System libraries OS(Linux,Windows,Mac OS X,etc...)
  43. Ruby 1.9 Application Ruby 1.9 Built-in Ruby VM GC Built-in Standard Library Library System libraries OS(Linux,Windows,Mac OS X,etc...)
  44. Ruby 1.9 Application Ruby 1.9 Built-in Ruby VM GC Built-in Standard Library Library System libraries OS(Linux,Windows,Mac OS X,etc...)
  45. Ruby 1.9 Application Ruby 1.9 Built-in Ruby VM GC Built-in Standard Library Library System libraries OS(Linux,Windows,Mac OS X,etc...)
  46. Ruby 1.9 Application Ruby 1.9 Built-in Ruby VM GC Built-in Standard Library Library System libraries OS(Linux,Windows,Mac OS X,etc...)
  47. Ruby 1.9 Application Ruby 1.9 Built-in Ruby VM GC Built-in Standard Library Library System libraries OS(Linux,Windows,Mac OS X,etc...)
  48. Ruby 1.9 Application Ruby 1.9 Built-in Ruby VM GC Built-in Standard Library Library System libraries OS(Linux,Windows,Mac OS X,etc...)
  49. MacRuby Application MacRuby Built-inRuby VM GCBuilt-in StandardLibrary Library System libraries Mac OS X
  50. MacRuby Application MacRuby Built-inRuby VM GCBuilt-in StandardLibrary Library System libraries Mac OS X
  51. MacRuby Application MacRuby Built-inRuby VM GCBuilt-in StandardLibrary Library System libraries Mac OS X
  52. MacRuby Application MacRuby Built-inRuby VM GCBuilt-in StandardLibrary Library System libraries Mac OS X
  53. MacRuby Application MacRubyRuby VM AutoZone Built-in GCBuilt-in StandardLibrary Library System libraries Mac OS X
  54. MacRuby Application MacRuby Ruby VM AutoZone Built-in GCFoundation Built-in Standard Library Library System libraries Mac OS X
  55. MacRuby Application MacRuby Ruby VM AutoZone Built-in GCFoundation Built-in Standard Library Library"kouji".transform("latin-hiragana") System libraries#=> Mac OS X
  56. MacRuby Application MacRuby Ruby VM AutoZone Built-in GCFoundation Built-in Standard Library Library System libraries Mac OS X
  57. MacRuby Application MacRuby Ruby VM AutoZone Built-in GCFoundation Built-in Standard Library Library System libraries Mac OS X
  58. MacRuby Application MacRuby Ruby VM AutoZone Built-in GCFoundation Built-in Standard Library Library System libraries Mac OS X
  59. MacRuby Application MacRuby Ruby VM AutoZone Built-in GCFoundation Built-in Standard Library Library System libraries Mac OS X
  60. MacRuby Application MacRuby AutoZone Generational LLVM Threaded GC Built-in Standard Library LibraryFoundation System libraries Mac OS X
  61. MacRuby on RailsMaking Ruby on Rails work on MacRuby
  62. Current Status
  63. Current Status$ rails new demo
  64. Current Status$ rails new demo $ rails generate scaffold ...
  65. Current Status$ rails new demo $ rails generate scaffold ... $ rails server
  66. Current Status$ rails new demo $ rails generate scaffold ... $ rails server
  67. 7 months ago...
  68. 7 months ago...March 2011 in Japan
  69. 7 months ago...March 2011 in Japan• I thought, "Does Rails work on MacRuby?".
  70. 7 months ago...March 2011 in Japan• I thought, "Does Rails work on MacRuby?".• I managed to install Rails.$ sudo macgem install rails7 gems installed$ sudo macgem install sqlite3-ruby2 gems installed
  71. Perhaps...
  72. Perhaps...• I thought, "OK, its installed, but surely the Rails generators wont work...".
  73. Perhaps... • I thought, "OK, its installed, but surely the Rails generators wont work...". • However, I managed to create a Rails project!?$ macruby -S rails new demo create create README ... create vendor/plugins create vendor/plugins/.gitkeep
  74. Are you kidding me?
  75. Are you kidding me?• I tried to generate a scaffold...
  76. Are you kidding me?• I tried to generate a scaffold...• It failed. After all Rails didnt work on MacRuby.$ macruby -S rails generate scaffold Bookmarktitle:string description:text url:string...Assertion failed: ((size_t)pos <current_exceptions.size()), functionpop_current_exception, file vm.cpp, line 3434.zsh: abort macruby -S rails generate scaffoldBookmark title:string description:text
  77. Are you kidding me?• I tried to generate a scaffold...• It failed. After all Rails didnt work on MacRuby.$ macruby -S rails generate scaffold Bookmarktitle:string description:text url:string $ macruby -S rails server... ...Assertion failed: ((size_t)pos < < Assertion failed: ((size_t)poscurrent_exceptions.size()), function current_exceptions.size()), functionpop_current_exception, file file vm.cpp, line 3434. pop_current_exception, vm.cpp, line 3434.zsh:zsh: abort macruby -S rails generate scaffold abort macruby -S rails serverBookmark title:string description:text
  78. My approach Run RailsSEGV or abort Research CodingRun RubySpec Run Rails
  79. My approach Run RailsSEGV or abort Research CodingRun RubySpec Run Rails
  80. My approach Run RailsSEGV or abort Research CodingRun RubySpec Run Rails
  81. My approach Run RailsSEGV or abort Research CodingRun RubySpec Run Rails
  82. My approach Run RailsSEGV or abort Research CodingRun RubySpec Run Rails
  83. My approach Run RailsSEGV or abort Research CodingRun RubySpec Run Rails
  84. Coding My approachRun RubySpec Run RailsSEGV or abort Research CodingRun RubySpec
  85. Coding My approachRun RubySpec Run Rails Required knowledgeSEGV or abort and technology • cRuby Research • Objective-C Coding • C++Run RubySpec • LLVM
  86. A couple of examples ofwhat I have fixed so far
  87. #860 catch/throw (in "old" MacRuby)➡ MacRuby aborts if you use catch and throw inside a rescue clause.
  88. #860 catch/throw (in "old" MacRuby)➡ MacRuby aborts if you use catch and throw inside a rescue clause.01: begin02: raise "A"03: rescue04: catch(:foo) { throw :foo }05: end
  89. #860 catch/throw (in "old" MacRuby) ➡ MacRuby aborts if you use catch and throw inside a rescue clause. 01: begin 02: raise "A" 03: rescue 04: catch(:foo) { throw :foo } 05: end:okAssertion failed: ((size_t)pos < current_exceptions.size()),function pop_current_exception, file vm.cpp, line 3448.
  90. Exception Handling (in MacRuby)
  91. Exception Handling (in MacRuby)01: begin02: raise "A"03: rescue04: begin05: raise "B"06: rescue07: end08: end
  92. Exception Handling (in MacRuby)01: begin02: raise "A"03: rescue04: begin05: raise "B"06: rescue07: end08: end
  93. Exception Handling (in MacRuby)01: begin02: raise "A"03: rescue04: begin05: raise "B"06: rescue07: end08: end Exception Stack
  94. Exception Handling (in MacRuby)01: begin02: raise "A" push03: rescue04: begin05: raise "B"06: rescue07: end08: end "A" Exception Stack
  95. Exception Handling (in MacRuby)01: begin02: raise "A" push03: rescue04: begin05: raise "B"06: rescue07: end08: end "A" Exception Stack
  96. Exception Handling (in MacRuby)01: begin02: raise "A" push03: rescue04: begin05: raise "B" push06: rescue "B"07: end08: end "A" Exception Stack
  97. Exception Handling (in MacRuby)01: begin02: raise "A" push03: rescue04: begin05: raise "B" push06: rescue "B"07: end08: end "A" Exception Stack
  98. Exception Handling (in MacRuby)01: begin02: raise "A" push03: rescue04: begin05: raise "B" push06: rescue07: end pop08: end "A" Exception Stack
  99. Exception Handling (in MacRuby)01: begin02: raise "A" push03: rescue04: begin05: raise "B" push06: rescue07: end pop08: end pop Exception Stack
  100. Exception Handling and catch / throw (in MacRuby) Exception Stack
  101. Exception Handling and catch / throw (in MacRuby)01: catch(:foo) {02: begin03: raise "A"04: rescue05: throw :foo06: end07: } Exception Stack
  102. Exception Handling and catch / throw (in MacRuby)01: catch(:foo) {02: begin03: raise "A"04: rescue05: throw :foo06: end07: } Exception Stack
  103. Exception Handling and catch / throw (in MacRuby)01: catch(:foo) {02: begin03: raise "A" push04: rescue05: throw :foo06: end07: } "A" Exception Stack
  104. Exception Handling and catch / throw (in MacRuby)01: catch(:foo) {02: begin03: raise "A" push04: rescue05: throw :foo06: end07: } "A" Exception Stack
  105. Exception Handling and catch / throw (in MacRuby)01: catch(:foo) {02: begin03: raise "A" push04: rescue05: throw :foo06: end07: } "A" Exception Stack
  106. Exception Handling and catch / throw (in MacRuby)01: catch(:foo) {02: begin03: raise "A" push04: rescue05: throw :foo pop06: end07: } Exception Stack
  107. throw (in "old " MacRuby)Before being fixed(60723bf~), throw alwayspopped the current Exception.vm.cpp:4321:VALUERoxorVM::ruby_throw(VALUE tag, VALUE value){... if (current_exception() != Qnil) { pop_current_exception(); }...
  108. throw (in "old " MacRuby)Before being fixed(60723bf~), throw alwayspopped the current Exception.vm.cpp:4321:VALUERoxorVM::ruby_throw(VALUE tag, VALUE value){... if (current_exception() != Qnil) { pop_current_exception(); }...
  109. throw (in "old " MacRuby)Before being fixed(60723bf~), throw alwayspopped the current Exception.vm.cpp:4321:VALUERoxorVM::ruby_throw(VALUE tag, VALUE value){... if (current_exception() != Qnil) { pop_current_exception(); }...
  110. #860 catch/throw (in "old" MacRuby)01: begin02: raise "A"03: rescue04: catch(:foo) { throw :foo }05: end Exception Stack
  111. #860 catch/throw (in "old" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { throw :foo }05: end "A" Exception Stack
  112. #860 catch/throw (in "old" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { throw :foo }05: end "A" Exception Stack
  113. #860 catch/throw (in "old" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { throw :foo } pop05: end Exception Stack
  114. #860 catch/throw (in "old" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { throw :foo } pop05: end pop Exception Stack
  115. #860 catch/throw (in "old" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { throw :foo } pop05: end pop t ! ! o r A b Exception Stack
  116. How to fix (in "new" MacRuby)01: begin02: raise "A"03: rescue04: catch(:foo) { throw :foo }05: end Exception Stack
  117. How to fix (in "new" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { throw :foo }05: end "A" Exception Stack
  118. How to fix (in "new" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { throw :foo } store05: end "A" Exception Stack
  119. How to fix (in "new" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { throw :foo } store05: end "A" Exception Stack
  120. How to fix (in "new" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { throw :foo } store05: end pop Exception Stack
  121. How to fix (in "new" MacRuby)In the new implementation, MacRuby only popsexceptions when necessary (60723bf)vm.cpp:4318:VALUERoxorVM::ruby_throw(VALUE tag, VALUE value){... while (catch_ptr->current_exception != current_exception()) { pop_current_exception(); }...
  122. How to fix (in "new" MacRuby)In the new implementation, MacRuby only popsexceptions when necessary (60723bf)vm.cpp:4318:VALUERoxorVM::ruby_throw(VALUE tag, VALUE value){... while (catch_ptr->current_exception != current_exception()) { pop_current_exception(); }...
  123. How to fix (in "new" MacRuby)In the new implementation, MacRuby only popsexceptions when necessary (60723bf)vm.cpp:4318:VALUERoxorVM::ruby_throw(VALUE tag, VALUE value){... while (catch_ptr->current_exception != current_exception()) { pop_current_exception(); }...
  124. #860 Fixed (in "new" MacRuby)01: begin02: raise "A"03: rescue04: catch(:foo) {05: begin06: raise "B"07: rescue08: throw :foo09: end10: }11: end Exception Stack
  125. #860 Fixed (in "new" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { store05: begin06: raise "B"07: rescue08: throw :foo09: end "A"10: }11: end Exception Stack
  126. #860 Fixed (in "new" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { store05: begin06: raise "B" push07: rescue "B"08: throw :foo09: end "A"10: }11: end Exception Stack
  127. #860 Fixed (in "new" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { store05: begin06: raise "B" push07: rescue "B"08: throw :foo09: end "A"10: }11: end Exception Stack
  128. #860 Fixed (in "new" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { store05: begin06: raise "B" push07: rescue08: throw :foo pop09: end "A"10: }11: end Exception Stack
  129. #860 Fixed (in "new" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { store05: begin06: raise "B" push07: rescue08: throw :foo pop09: end "A"10: }11: end Exception Stack
  130. #860 Fixed (in "new" MacRuby)01: begin02: raise "A" push03: rescue04: catch(:foo) { store05: begin06: raise "B" push07: rescue08: throw :foo pop09: end10: }11: end pop Exception Stack
  131. #1192 Constant Lookup➡ MacRuby failed to correctly look up constants in a number of situations when you used module_eval and class_eval.
  132. #1192 Constant Lookup➡ MacRuby failed to correctly look up constants in a number of situations when you used module_eval and class_eval. module A B = 10 Object.class_eval { B } end
  133. #1192 Constant Lookup ➡ MacRuby failed to correctly look up constants in a number of situations when you used module_eval and class_eval. module A B = 10 Object.class_eval { B } endreduction.rb:3:in `block: uninitialized constantB (NameError)
  134. #1192 Constant Lookup ➡ MacRuby failed to correctly look up constants in a number of situations when you used module_eval and class_eval. module A cRuby B = 10 Object.class_eval { B } endreduction.rb:3:in `block: uninitialized constantB (NameError)
  135. #1192 Constant Lookup ➡ MacRuby failed to correctly look up constants in a number of situations when you used module_eval and class_eval. module A BMacRuby = 10 Object.class_eval { B } endreduction.rb:3:in `block: uninitialized constantB (NameError)
  136. Constant Lookup (in cRuby)
  137. Constant Lookup (in cRuby)1: module A2: module B3: CONST = "B’s Const"4: module ::A5: p CONST6: end7: end8: end
  138. Constant Lookup (in cRuby)1: module A2: module B3: CONST = "B’s Const"4: module ::A5: p CONST6: end7: end8: end
  139. Constant Lookup (in cRuby)1: module A2: module B3: CONST = "B’s Const"4: module ::A5: p CONST6: end7: end8: end
  140. Constant Lookup (in cRuby)1: module A2: module B3: CONST = "B’s Const"4: module ::A5: p CONST6: end7: end8: end
  141. Constant Lookup (in cRuby)1: module A2: module B3: CONST = "B’s Const"4: module ::A5: p CONST6: end7: end8: end
  142. Constant Lookup (in cRuby)1: module A2: module B3: CONST = "B’s Const"4: module ::A5: p CONST6: end7: end8: end
  143. Constant Lookup (in cRuby)1: module A Lexical Scope2: module B3: CONST = "B’s Const"4: module ::A5: p CONST6: end7: end8: end
  144. Constant Lookup (in cRuby)1: module A Lexical Scope2: module B3: CONST = "B’s Const"4: module ::A5: p CONST6: end Lookup7: end ons tant8: end exi L cal C
  145. Constant Lookup (in "old" MacRuby)MacRuby had not implemented LexicalConstant Lookup.1: module A2: module B3: CONST = "B’s Const"4: module ::A5: p CONST6: end7: end8: end
  146. Constant Lookup (in "old" MacRuby)MacRuby had not implemented LexicalConstant Lookup.1: module A2: module B3: MacRuby CONST = "B’s Const"4: module ::A5: p CONST6: end7: end8: end
  147. Constant Lookup (in "old" MacRuby) MacRuby had not implemented Lexical Constant Lookup. 1: module A 2: module B 3: MacRuby CONST = "B’s Const" 4: module ::A 5: p CONST 6: end 7: end 8: end-e:5:in `block: uninitialized constant A::CONST (NameError)
  148. Constant Lookup is complex (in cRuby)
  149. Constant Lookup is complex (in cRuby) class_eval(&Block) class_eval(String)01: module A 01: module A02: CONST = "As CONST" 02: CONST = "As CONST"03: def f() 03: def f()04: class_eval { 04: class_eval <<-EOS05: p CONST 05: p CONST06: } 06: EOS07: end 07: end08: end 08: end09: 09:10: class K 10: class K11: CONST = "Ks CONST" 11: CONST = "Ks CONST"12: extend A 12: extend A13: f() 13: f()14: end 14: end
  150. class_eval(&Block)01: module A02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  151. class_eval(&Block)01: module A02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  152. class_eval(&Block)01: module A02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  153. class_eval(&Block)01: module A02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  154. class_eval(&Block)01: module A02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  155. class_eval(&Block)01: module A02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  156. class_eval(&Block)01: module A02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  157. class_eval(&Block)01: module A02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  158. class_eval(&Block)01: module A02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  159. class_eval(&Block)01: module A02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  160. class_eval(&Block)01: module A02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  161. class_eval(&Block)01: module A Lexical Scope02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: }07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  162. class_eval(&Block)01: module A Lexical Scope02: CONST = "As CONST"03: def f()04: class_eval {05: p CONST06: } ON ST"07: end "As C08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  163. class_eval(String)01: module A02: CONST = "As CONST"03: def f()04: class_eval <<-EOS05: p CONST06: EOS07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  164. class_eval(String)01: module A02: CONST = "As CONST"03: def f()04: class_eval <<-EOS05: p CONST06: EOS07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  165. class_eval(String)01: module A02: CONST = "As CONST"03: def f()04: class_eval <<-EOS05: p CONST06: EOS07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  166. class_eval(String)01: module A02: CONST = "As CONST"03: def f()04: class_eval <<-EOS05: p CONST06: EOS07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  167. class_eval(String)01: module A02: CONST = "As CONST"03: def f()04: class_eval <<-EOS05: p CONST06: EOS07: end08: end09:10: class K11: CONST = "Ks CONST"12: extend A13: f()14: end
  168. class_eval(String)01: module A02: CONST = "As CONST"03: def f()04: class_eval <<-EOS05: p CONST06: EOS07: end08: end09:10: class K Dynamic Scope11: CONST = "Ks CONST"12: extend A13: f()14: end
  169. class_eval(String)01: module A02: CONST = "As CONST"03: def f()04: class_eval <<-EOS05: p CONST06: EOS07: end08: end09:10: class K Dynamic Scope11: CONST = "Ks CONST"12: extend A13: f() ON ST"14: end "Ks C
  170. Constant Lookup is complex (in cRuby) class_eval(&Block) class_eval(String)01: module A Lexical Scope 01: module A02: CONST = "As CONST" 02: CONST = "As CONST"03: def f() 03: def f()04: class_eval { 04: class_eval <<-EOS05: p CONST 05: p CONST06: } ST" 06: EOS07: end "As CON 07: end08: end 08: end09: 09:10: class K 10: class K Dynamic Scope11: CONST = "Ks CONST" 11: CONST = "Ks CONST"12: extend A 12: extend A13: f() 13: f() ON ST"14: end 14: end " Ks C
  171. I somehow managed to fix this (in MacRuby)
  172. I somehow managed to fix this (in MacRuby)• Three attempts to get it right.
  173. I somehow managed to fix this (in MacRuby)• Three attempts to get it right.• More than 3000 lines of code changed.
  174. I somehow managed to fix this (in MacRuby)• Three attempts to get it right.• More than 3000 lines of code changed. 21 Apr 2011 15:24 Laurent S. its official, kouji is the hero of th e day/week/month/...? his patch seem s to fix remaining lexical const lookup bugs :)
  175. A very complex bug (in "new" MacRuby)
  176. A very complex bug (in "new" MacRuby)01: module A02: B = 4203: end04:05: A.class_eval do06: def self.f07: p B08: end09: end10:11: A.f
  177. A very complex bug (in "new" MacRuby)01: module A02: B = 4203: end04:05: A.class_eval do06: def self.f07: p B08: end09: end10:11: A.f
  178. A very complex bug (in "new" MacRuby)01: module A02: B = 4203: end04:05: A.class_eval do06: def self.f07: p B08: end09: end10:11: A.f
  179. A very complex bug (in "new" MacRuby)01: module A02: B = 4203: end04:05: A.class_eval do06: def self.f07: p B08: end09: end10:11: A.f
  180. A very complex bug (in "new" MacRuby)01: module A02: B = 4203: end04:05: A.class_eval do06: def self.f07: p B08: end09: end10:11: A.f
  181. A very complex bug (in "new" MacRuby)01: module A02: B = 4203: end04:05: A.class_eval do06: def self.f07: p B08: end09: end10:11: A.f
  182. A very complex bug (in "new" MacRuby)01: module A02: B = 4203: end04:05: A.class_eval do06: def self.f07: p B08: end09: end10:11: A.f
  183. A very complex bug (in "new" MacRuby)01: module A02: B = 4203: end04: Lexical05: A.class_eval do06: def self.f07: p B08: end09: end10:11: A.f
  184. A very complex bug (in "new" MacRuby)CAUTIONclass_eval does not add its own receiver 01: module A(A) 02: theBconstant lookup scope. to = 42 03: end 04: Lexical 05: A.class_eval do 06: def self.f 07: p B 08: end 09: end 10: 11: A.f
  185. A very complex bug (in cRuby)01: module A02: B = 4203: end04:05: A.class_eval do06: def self.f07: p B08: end09: end10:11: A.f
  186. A very complex bug (in cRuby)01: module A02: B = 42 end uby 1.903: R04: ➡4205: A.class_eval do06: def self.f07: p B08: end09: end10:11: A.f
  187. A very complex bug (in cRuby) 01: module A 02: B = 42 03: end uby 1.9 R 04: ➡ 42 05: A.class_eval do 06: def self.f 07: p B eError) tB(Nam nstan 08: end 09: .8.7 1 end ialized coR u10: `f: uninit by -e :8:in➡11: A.f
  188. A very complex bug (in cRuby) 01: module A 02: B = 42 03: end uby 1.9 R 04: A cR ➡ 42 ubys 05: A.class_eval do 06: def self.f ror) 07: 08: 09: .8.7 end Bug p B d constantB(NameErR 1 end u10: `f: uninit by ialize -e :8:in➡11: A.f
  189. Demo$ rails new demo $ rails generate scaffold ... $ rails server
  190. #1390 rb_vm_prepare_block➡ Abort if the "About your application’s environment" is link is clicked. CLICK! Assertion failed: ((b->flags & flags) == flags), function rb_vm_prepare_block, file dispatcher.cpp, line 1406. zsh: abort env VM_DISABLE_RBO=1 macruby -S rails server
  191. The MacRuby train trip continues...
  192. The MacRuby train trip continues...http://ww w.macrub y.org/
  193. The MacRuby train trip continues... u by m acrhttp://ww @ w.macrub y.org/
  194. The MacRuby train trip continues... u by m acrhttp://ww @ w.macrub y.org/ GitHub:MacRuby/MacRuby
  195. The MacRuby train trip continues... u by m acr http://ww @ w.macrub y.org/ GitHub:MacRuby/MacRubymac ruby-devel@lists.macosforge.org
  196. Conclusion
  197. Conclusion• MacRuby ➡MacRuby is a unique blend of Ruby 1.9 and Objective-C. ➡The goal is to be 100% compatible with Ruby 1.9.
  198. Conclusion• MacRuby ➡MacRuby is a unique blend of Ruby 1.9 and Objective-C. ➡The goal is to be 100% compatible with Ruby 1.9.• MacRuby on Rails ➡Were now able to show the default Rails welcome page. ➡But there is still a lot to do.
  199. Acknowledgment
  200. Acknowledgment• The RubyConf hosts and organizers
  201. Acknowledgment• The RubyConf hosts and organizers• Tor Yamamoto-Sorensen (@shakaijin)
  202. Acknowledgment• The RubyConf hosts and organizers• Tor Yamamoto-Sorensen (@shakaijin)• Everyone present today
  203. Thank you
  204. Q &A• If you have a question, please ask me, but if possible please speak slowly.• or contact @takaokouji_en by Twitter• or send e-mail to MacRuby ML

×