SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Sunday, August 29, 2010
Mirah/Dubious


                           John Woodell
                           Takeru Sasaki

                          RejectKaigi 2010

              2



Sunday, August 29, 2010
Thank you for using
                           "AppEngine/JRuby”
                            "AppEngine/JRuby"




              3



Sunday, August 29, 2010
Spin-up?
            Yes, this is a problem...



              4



Sunday, August 29, 2010
...but now you can use
                 Mirah and Dubious

                          "Mirah/Dubious"


              5



Sunday, August 29, 2010
Mirah is a
                  staticly typed language,
                  that uses type-inference


       Mirah              Ruby       JVM


              6



Sunday, August 29, 2010
Now, how does it work?
                          (minus a few boring details)




              7



Sunday, August 29, 2010
First, JRuby’s Parcer creates AST
                  JRuby                 AST

                  mirahp -e "puts 'RubyKaigi'+(167*12+6)"
                  Script
                   Body
                    Call(println)
                     Call(out)
                      Constant(System)
                     Call(+)
                      String("RubyKaigi")
                      Call(+)
                       Call(*)
                        Fixnum(167)
                        Fixnum(12)
                       Fixnum(6)
              8



Sunday, August 29, 2010
Then, the AST becomes JVM bytecode
                  AST   bytecode

                  mirah -e "puts 'RubyKaigi'+(167*12+6)"; javap -c DashE
                  RubyKaigi2010
                  Compiled from DashE
                  public class DashE extends java.lang.Object{
                  public static void main(java.lang.String[]);
                    Code:
                     0:   getstatic       #12; //Field java/lang/System.out:Ljava/io/PrintStream;
                     3:   ldc     #14; //String RubyKaigi
                     5:   sipush 167
                     8:   bipush 12
                     10: imul
                     11: bipush 6
                     13: iadd
                     14: invokestatic     #20; //Method java/lang/String.valueOf:(I)Ljava/lang/
                  String;
                     17: invokevirtual    #24; //Method java/lang/String.concat:(Ljava/lang/
                  String;)Ljava/lang/String;
                     20: invokevirtual    #30; //Method java/io/PrintStream.println:(Ljava/lang/
                  String;)V
                     23: return

                  public DashE();
                    Code:
                     0:   aload_0
                     1:   invokespecial   #36; //Method java/lang/Object."<init>":()V
                     4:   return
              9   }


Sunday, August 29, 2010
"Pure JVM bytecode"
               We don't need a Runtime.
               This is very, very fast!

                          bytecode
                  JRuby     Runtime

             10



Sunday, August 29, 2010
Dubious is Web framework for Mirah
                          Dubious   Mirah    Web



                     *du      bi    ous[ djbis | dj- ] [     ]
                  [1] ((            ))          …
                                         ((of, about, as to ...)).
                    [2]


                             >
             11



Sunday, August 29, 2010
Write Rails-style code,
          it runs on Google App Engine



                                  GoogleAppEngine
                          Rails

             12



Sunday, August 29, 2010
Here’s code from Dubious,
             this is not Rails!

                                Rails
                          Dubious

             13



Sunday, August 29, 2010
Dubious controllers will be familiar




Sunday, August 29, 2010
Mirah can use ERb templates




Sunday, August 29, 2010
The models are simple (no schema)




Sunday, August 29, 2010
It really works,
                    and spins-up in ~1sec



                                Spinup.

             17



Sunday, August 29, 2010
It isn’t "Dubious"



                              Thank you!

                           http://mirah.org
                  http://dubious-demo.appspot.com
                     @johnwoodell & @urekat
             18



Sunday, August 29, 2010
Sunday, August 29, 2010

Weitere ähnliche Inhalte

Andere mochten auch

Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahNick Plante
 
RubyConf Brazil 2010 - Mirah
RubyConf Brazil 2010 - MirahRubyConf Brazil 2010 - Mirah
RubyConf Brazil 2010 - MirahCharles Nutter
 
JavaとRubyのすてきな関係
JavaとRubyのすてきな関係JavaとRubyのすてきな関係
JavaとRubyのすてきな関係garden_tree
 
Opal - Ruby Style!! Ruby in the browser
Opal - Ruby Style!!  Ruby in the browserOpal - Ruby Style!!  Ruby in the browser
Opal - Ruby Style!! Ruby in the browserForrest Chang
 
Rubyの拡張をCrystalで書いてみる
Rubyの拡張をCrystalで書いてみるRubyの拡張をCrystalで書いてみる
Rubyの拡張をCrystalで書いてみる5t111111
 
LSTM (Long short-term memory) 概要
LSTM (Long short-term memory) 概要LSTM (Long short-term memory) 概要
LSTM (Long short-term memory) 概要Kenji Urai
 
Opal chapter 4_a_new_hope
Opal chapter 4_a_new_hopeOpal chapter 4_a_new_hope
Opal chapter 4_a_new_hopeForrest Chang
 
Learning to forget continual prediction with lstm
Learning to forget continual prediction with lstmLearning to forget continual prediction with lstm
Learning to forget continual prediction with lstmFujimoto Keisuke
 
Ruby 風シンタックスな静的言語 Crystal の紹介
Ruby 風シンタックスな静的言語 Crystal の紹介Ruby 風シンタックスな静的言語 Crystal の紹介
Ruby 風シンタックスな静的言語 Crystal の紹介Kazuki Matsushita
 
超絶技巧プログラミングと Ruby 3.0 (大江戸 Ruby 会議 05 コミッタ LT)
超絶技巧プログラミングと Ruby 3.0 (大江戸 Ruby 会議 05 コミッタ LT)超絶技巧プログラミングと Ruby 3.0 (大江戸 Ruby 会議 05 コミッタ LT)
超絶技巧プログラミングと Ruby 3.0 (大江戸 Ruby 会議 05 コミッタ LT)mametter
 
ユーザーストーリー駆動開発で行こう。
ユーザーストーリー駆動開発で行こう。ユーザーストーリー駆動開発で行こう。
ユーザーストーリー駆動開発で行こう。toshihiro ichitani
 
JSON Schema と API テスト YAPC::Asia Tokyo 2014
JSON Schema と API テスト YAPC::Asia Tokyo 2014JSON Schema と API テスト YAPC::Asia Tokyo 2014
JSON Schema と API テスト YAPC::Asia Tokyo 2014Naoki Shimizu
 

Andere mochten auch (12)

Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and Pindah
 
RubyConf Brazil 2010 - Mirah
RubyConf Brazil 2010 - MirahRubyConf Brazil 2010 - Mirah
RubyConf Brazil 2010 - Mirah
 
JavaとRubyのすてきな関係
JavaとRubyのすてきな関係JavaとRubyのすてきな関係
JavaとRubyのすてきな関係
 
Opal - Ruby Style!! Ruby in the browser
Opal - Ruby Style!!  Ruby in the browserOpal - Ruby Style!!  Ruby in the browser
Opal - Ruby Style!! Ruby in the browser
 
Rubyの拡張をCrystalで書いてみる
Rubyの拡張をCrystalで書いてみるRubyの拡張をCrystalで書いてみる
Rubyの拡張をCrystalで書いてみる
 
LSTM (Long short-term memory) 概要
LSTM (Long short-term memory) 概要LSTM (Long short-term memory) 概要
LSTM (Long short-term memory) 概要
 
Opal chapter 4_a_new_hope
Opal chapter 4_a_new_hopeOpal chapter 4_a_new_hope
Opal chapter 4_a_new_hope
 
Learning to forget continual prediction with lstm
Learning to forget continual prediction with lstmLearning to forget continual prediction with lstm
Learning to forget continual prediction with lstm
 
Ruby 風シンタックスな静的言語 Crystal の紹介
Ruby 風シンタックスな静的言語 Crystal の紹介Ruby 風シンタックスな静的言語 Crystal の紹介
Ruby 風シンタックスな静的言語 Crystal の紹介
 
超絶技巧プログラミングと Ruby 3.0 (大江戸 Ruby 会議 05 コミッタ LT)
超絶技巧プログラミングと Ruby 3.0 (大江戸 Ruby 会議 05 コミッタ LT)超絶技巧プログラミングと Ruby 3.0 (大江戸 Ruby 会議 05 コミッタ LT)
超絶技巧プログラミングと Ruby 3.0 (大江戸 Ruby 会議 05 コミッタ LT)
 
ユーザーストーリー駆動開発で行こう。
ユーザーストーリー駆動開発で行こう。ユーザーストーリー駆動開発で行こう。
ユーザーストーリー駆動開発で行こう。
 
JSON Schema と API テスト YAPC::Asia Tokyo 2014
JSON Schema と API テスト YAPC::Asia Tokyo 2014JSON Schema と API テスト YAPC::Asia Tokyo 2014
JSON Schema と API テスト YAPC::Asia Tokyo 2014
 

Ähnlich wie Introduction to Mirah and Dubious - Static Ruby for the JVM and Google App Engine

Japanese Rubyists you have not met yet
Japanese Rubyists you have not met yetJapanese Rubyists you have not met yet
Japanese Rubyists you have not met yetmasayoshi takahashi
 
Ruby on Windows (RubyConf.tw 2011)
Ruby on Windows (RubyConf.tw 2011)Ruby on Windows (RubyConf.tw 2011)
Ruby on Windows (RubyConf.tw 2011)Ming-hsuan Chang
 
Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Matt Aimonetti
 
Fabric-让部署变得简单
Fabric-让部署变得简单Fabric-让部署变得简单
Fabric-让部署变得简单Eric Lo
 
Groovy, Transforming Language
Groovy, Transforming LanguageGroovy, Transforming Language
Groovy, Transforming LanguageUehara Junji
 
Concurrency
ConcurrencyConcurrency
Concurrencyehuard
 
dojo is bizarro jQuery
dojo is bizarro jQuerydojo is bizarro jQuery
dojo is bizarro jQueryJohn Hann
 
Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Martijn Verburg
 
Rhouse - Home automation is ruby ?
Rhouse - Home automation is ruby ?Rhouse - Home automation is ruby ?
Rhouse - Home automation is ruby ?Fernand Galiana
 
Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume Laforge
Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume LaforgeGroovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume Laforge
Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume LaforgeGuillaume Laforge
 
Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby ConferenceJohn Woodell
 
Kon nichi wa_ruby
Kon nichi wa_rubyKon nichi wa_ruby
Kon nichi wa_rubyScott Motte
 
Presentation to wdim_students
Presentation to wdim_studentsPresentation to wdim_students
Presentation to wdim_studentsScott Motte
 
Building a compiler in JRuby
Building a compiler in JRubyBuilding a compiler in JRuby
Building a compiler in JRubyakinsgre
 
Everything Rubinius
Everything RubiniusEverything Rubinius
Everything RubiniusEngine Yard
 
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil BartlettCook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlettmfrancis
 
Javascript Stacktrace Ignite
Javascript Stacktrace IgniteJavascript Stacktrace Ignite
Javascript Stacktrace IgniteEric Wendelin
 
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...Jan Wedekind
 
Puppet 3: Present and Future Tense
Puppet 3: Present and Future TensePuppet 3: Present and Future Tense
Puppet 3: Present and Future TenseEric Sorenson
 

Ähnlich wie Introduction to Mirah and Dubious - Static Ruby for the JVM and Google App Engine (20)

Japanese Rubyists you have not met yet
Japanese Rubyists you have not met yetJapanese Rubyists you have not met yet
Japanese Rubyists you have not met yet
 
Railsconf 2010
Railsconf 2010Railsconf 2010
Railsconf 2010
 
Ruby on Windows (RubyConf.tw 2011)
Ruby on Windows (RubyConf.tw 2011)Ruby on Windows (RubyConf.tw 2011)
Ruby on Windows (RubyConf.tw 2011)
 
Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010
 
Fabric-让部署变得简单
Fabric-让部署变得简单Fabric-让部署变得简单
Fabric-让部署变得简单
 
Groovy, Transforming Language
Groovy, Transforming LanguageGroovy, Transforming Language
Groovy, Transforming Language
 
Concurrency
ConcurrencyConcurrency
Concurrency
 
dojo is bizarro jQuery
dojo is bizarro jQuerydojo is bizarro jQuery
dojo is bizarro jQuery
 
Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)
 
Rhouse - Home automation is ruby ?
Rhouse - Home automation is ruby ?Rhouse - Home automation is ruby ?
Rhouse - Home automation is ruby ?
 
Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume Laforge
Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume LaforgeGroovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume Laforge
Groovy to infinity and beyond - GR8Conf Europe 2010 - Guillaume Laforge
 
Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby Conference
 
Kon nichi wa_ruby
Kon nichi wa_rubyKon nichi wa_ruby
Kon nichi wa_ruby
 
Presentation to wdim_students
Presentation to wdim_studentsPresentation to wdim_students
Presentation to wdim_students
 
Building a compiler in JRuby
Building a compiler in JRubyBuilding a compiler in JRuby
Building a compiler in JRuby
 
Everything Rubinius
Everything RubiniusEverything Rubinius
Everything Rubinius
 
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil BartlettCook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
 
Javascript Stacktrace Ignite
Javascript Stacktrace IgniteJavascript Stacktrace Ignite
Javascript Stacktrace Ignite
 
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...
 
Puppet 3: Present and Future Tense
Puppet 3: Present and Future TensePuppet 3: Present and Future Tense
Puppet 3: Present and Future Tense
 

Mehr von John Woodell

Deploying and Maintaining an Enterprise OpenLDAP Directory
Deploying and Maintaining an Enterprise OpenLDAP DirectoryDeploying and Maintaining an Enterprise OpenLDAP Directory
Deploying and Maintaining an Enterprise OpenLDAP DirectoryJohn Woodell
 
Enterprise Mail and Calendaring with Open Software
Enterprise Mail and Calendaring with Open SoftwareEnterprise Mail and Calendaring with Open Software
Enterprise Mail and Calendaring with Open SoftwareJohn Woodell
 
Aloha on-rails-2009
Aloha on-rails-2009Aloha on-rails-2009
Aloha on-rails-2009John Woodell
 

Mehr von John Woodell (8)

Deploying and Maintaining an Enterprise OpenLDAP Directory
Deploying and Maintaining an Enterprise OpenLDAP DirectoryDeploying and Maintaining an Enterprise OpenLDAP Directory
Deploying and Maintaining an Enterprise OpenLDAP Directory
 
Enterprise Mail and Calendaring with Open Software
Enterprise Mail and Calendaring with Open SoftwareEnterprise Mail and Calendaring with Open Software
Enterprise Mail and Calendaring with Open Software
 
Jrubykaigi 2010
Jrubykaigi 2010Jrubykaigi 2010
Jrubykaigi 2010
 
Rubypalooza 2009
Rubypalooza 2009Rubypalooza 2009
Rubypalooza 2009
 
Aloha on-rails-2009
Aloha on-rails-2009Aloha on-rails-2009
Aloha on-rails-2009
 
RubyConf 2009
RubyConf 2009RubyConf 2009
RubyConf 2009
 
JRubyConf 2009
JRubyConf 2009JRubyConf 2009
JRubyConf 2009
 
App Engine Meetup
App Engine MeetupApp Engine Meetup
App Engine Meetup
 

Introduction to Mirah and Dubious - Static Ruby for the JVM and Google App Engine

  • 2. Mirah/Dubious John Woodell Takeru Sasaki RejectKaigi 2010 2 Sunday, August 29, 2010
  • 3. Thank you for using "AppEngine/JRuby” "AppEngine/JRuby" 3 Sunday, August 29, 2010
  • 4. Spin-up? Yes, this is a problem... 4 Sunday, August 29, 2010
  • 5. ...but now you can use Mirah and Dubious "Mirah/Dubious" 5 Sunday, August 29, 2010
  • 6. Mirah is a staticly typed language, that uses type-inference Mirah Ruby JVM 6 Sunday, August 29, 2010
  • 7. Now, how does it work? (minus a few boring details) 7 Sunday, August 29, 2010
  • 8. First, JRuby’s Parcer creates AST JRuby AST mirahp -e "puts 'RubyKaigi'+(167*12+6)" Script Body Call(println) Call(out) Constant(System) Call(+) String("RubyKaigi") Call(+) Call(*) Fixnum(167) Fixnum(12) Fixnum(6) 8 Sunday, August 29, 2010
  • 9. Then, the AST becomes JVM bytecode AST bytecode mirah -e "puts 'RubyKaigi'+(167*12+6)"; javap -c DashE RubyKaigi2010 Compiled from DashE public class DashE extends java.lang.Object{ public static void main(java.lang.String[]); Code: 0: getstatic #12; //Field java/lang/System.out:Ljava/io/PrintStream; 3: ldc #14; //String RubyKaigi 5: sipush 167 8: bipush 12 10: imul 11: bipush 6 13: iadd 14: invokestatic #20; //Method java/lang/String.valueOf:(I)Ljava/lang/ String; 17: invokevirtual #24; //Method java/lang/String.concat:(Ljava/lang/ String;)Ljava/lang/String; 20: invokevirtual #30; //Method java/io/PrintStream.println:(Ljava/lang/ String;)V 23: return public DashE(); Code: 0: aload_0 1: invokespecial #36; //Method java/lang/Object."<init>":()V 4: return 9 } Sunday, August 29, 2010
  • 10. "Pure JVM bytecode" We don't need a Runtime. This is very, very fast! bytecode JRuby Runtime 10 Sunday, August 29, 2010
  • 11. Dubious is Web framework for Mirah Dubious Mirah Web *du bi ous[ djbis | dj- ] [ ] [1] (( )) … ((of, about, as to ...)). [2] > 11 Sunday, August 29, 2010
  • 12. Write Rails-style code, it runs on Google App Engine GoogleAppEngine Rails 12 Sunday, August 29, 2010
  • 13. Here’s code from Dubious, this is not Rails! Rails Dubious 13 Sunday, August 29, 2010
  • 14. Dubious controllers will be familiar Sunday, August 29, 2010
  • 15. Mirah can use ERb templates Sunday, August 29, 2010
  • 16. The models are simple (no schema) Sunday, August 29, 2010
  • 17. It really works, and spins-up in ~1sec Spinup. 17 Sunday, August 29, 2010
  • 18. It isn’t "Dubious" Thank you! http://mirah.org http://dubious-demo.appspot.com @johnwoodell & @urekat 18 Sunday, August 29, 2010