Ruby Loves Dot Net

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Notes on slide 1

    IMHO Best IDE on the marketShared dynamic subsystemStandard hosting environmentBased on passing messages to objectsFull access to the CLREnable fast generation of dynamic codeOne true objectExplain how Jython was implemented and how it relates to the DLR

    Here’s a list of the different implementations of ruby right now. • MRI stands for ‘Matz’s Ruby Interpreter’ - Matz is yukihiromatsumoto, a japanese guy who first created the ruby language back in 1993. It’s written in straight C. This what you get when you go to the official ruby website. • JRuby is an implementation of Ruby running on the JVM - it interops natively with java. Commercially backed by sun. • MacRuby is Ruby running on Apple’s Objective C runtime. It interops natively with ObjectiveC, which makes it ideal for writing OSX GUI applications. It’s in it’s early stages, commercially backed by apple. • IronRuby is microsoft’s version. Commercially backed by microsoft who employ full time staff working on it. This is what our presentation is about • Rubinius is a an implementation of Ruby running using a C++ Virtual machine. Commercially backed by engineyard, one of the biggest ruby on rails web hosting companies.• Maglev is by GemStone, who are a smalltalk company. They’ve been around for years and years writing big enterprise systems using smalltalk. Maglev is their project to run ruby on their smalltalk VM • Hotruby is a small open source thing which compiles ruby into javascript. Sounds ridiculous but people have run this using the V8 engine in Google Chrome and it actually works out to be faster than the other ruby implementations for whatever set of benchmarks they were running All these companies are putting some serious resources behind getting ruby to run on the systems they want. This is evidence that there must be SOMETHING to it.

    Here’s a list of the different implementations of ruby right now. • MRI stands for ‘Matz’s Ruby Interpreter’ - Matz is yukihiromatsumoto, a japanese guy who first created the ruby language back in 1993. It’s written in straight C. This what you get when you go to the official ruby website. • JRuby is an implementation of Ruby running on the JVM - it interops natively with java. Commercially backed by sun. • MacRuby is Ruby running on Apple’s Objective C runtime. It interops natively with ObjectiveC, which makes it ideal for writing OSX GUI applications. It’s in it’s early stages, commercially backed by apple. • IronRuby is microsoft’s version. Commercially backed by microsoft who employ full time staff working on it. This is what our presentation is about • Rubinius is a an implementation of Ruby running using a C++ Virtual machine. Commercially backed by engineyard, one of the biggest ruby on rails web hosting companies.• Maglev is by GemStone, who are a smalltalk company. They’ve been around for years and years writing big enterprise systems using smalltalk. Maglev is their project to run ruby on their smalltalk VM • Hotruby is a small open source thing which compiles ruby into javascript. Sounds ridiculous but people have run this using the V8 engine in Google Chrome and it actually works out to be faster than the other ruby implementations for whatever set of benchmarks they were running All these companies are putting some serious resources behind getting ruby to run on the systems they want. This is evidence that there must be SOMETHING to it.

    Many people that come to Ruby do so through the Rails framework.And then often you can hear these people say:I came for Rails but I stayed for Ruby

    Ruby is a pleasant language to work with, partly because its well-chosen keywords, but mostly because it represents a kind of best breed implementation of a programming language. One of the goals ruby tries to achieve is to make the language you use ,when you’re writing your algorithms, a lot like a natural language. For example ruby has both the keywords if and unless, and you can apply those in 2 different ways. Best of breed Duck typing Everything is an object Classes are open / monkey patching Flexible Functional Procedural meta programming

    Show some of the nicer ruby syntax

    Regular expression literals [PERL] Strong text processing support [PERL] Blocks [SMALLTALK]Iterators [SMALLTALK]

    Introduce blocksExplain about message receivers and message passingNote the string interpolation

    Get into dynamic typing before duck typingRuby cares about typesIt cares about hierarchy + mixins when doing method lookupOnly safe operations against an object (no magic)Conversions explicit stepYou can override operators to allow for implicit conversion => explicit step + you’re in controlExplain how static typing resembles aristocracy with their bloodlines and how heritage is more important than capabilitiesExplain how duck typing focusses on the abilities of objects instead of their type. If the method is there it’s all good

    Variables can change type =>sacreligion!We care about the size method on the receiver in get_count=> 1 reason type checking defferred to last responsible moment

    metaprogramming == program to modify itself at runtime. metaprogramming == defining methods on instances and classes at runtime. You could very well generate most of a program at runtimeMostly used when DATA DRIVES THE CODE

    Responding to unknown methods: method_missing Define methods programmatically String evaluation

    See demos/metaprogramming.rbShow txt file content firstShow result of scriptOpen script start at bottomWalk through implementation

    You can run ‘irb’ and just type some ruby code, and it runs as you go. This is a killer feature for when you’re testing, or when you’re learning a new API. I used to have to miss that when I was in .NET but that is a thing from the past now.

    Require ‘mscorlib’Include System (equivalent of using in C#)Puts System.constantsPuts System.constants.grep(/^[A-C]/)

    A class is a an object => class itself Nil => objectConstants => object

    >>> 0.zero?=> true>>> 5.zero?=> false>>> 120/6=> 20>>> 873.class=> Fixnum>>> (1000 ** 1000).class=> Bignum >>> a = nil=> nil>>> a.nil?=> true>>> a.class=> NilClass

    With great power comes great responsibility.You can extend classes at runtime and make api’s more wrist or read friendly

    Favorites, Groups & Events

    Ruby Loves Dot Net - Presentation Transcript

    1. Ruby <3 .NET
      Ivan Porto Carrero
      http://flanders.co.nz
      http://twitter.com/casualjim
      www.visug.be
    2. Upcoming sessions
      June 18 : Domain Driven Design (Yves Goeleven)
      June 30 : IronRuby (Ivan Porto Carrero)
      September 10 : ORMs, NHibernate – Entity Framework
      (Davy Brion, Kurt Claeys)
      Week of October 5 (TBD) : Dino Esposito
      November 18 : Modeling with VSTS2010 (Marcel De Vries)
      November 26 : RIA Services (Miguel De Lathouwer
      & Steven Van Den Eynde)
    3. The plan
      CLR, DLR, WTF??
      All ur Rubyz are now belongs to us
      Ruby why should I care?
      Gotcha’s
      BDD with Bacon and Caricature
      Sinatra has not left the building
      IronRuby MVC
      Ruby + Silverlight == Teh cake
    4. CLR as we knew it
      VB.NET

      C#
      Base Class Libraries
      Common Type system
      Security
      Class Loader, GC, JIT, Execution Support
    5. CLR but mo betterer
      VB.NET
      IronPython
      C#
      Base Class Libraries
      DLR Runtime
      Common Type system
      Security
      Class Loader, GC, JIT, Execution Support
    6. All urRubyz are now…
      MRI ‐ “The Normal” Ruby
      JRuby ‐ Sun
      MacRuby ‐ Apple
      IronRuby ‐ Microsoft
      Rubinius ‐ EngineYard
      MagLev ‐ Gemstone
      HotRuby
    7. All urRubyz are now…
      MRI ‐ “The Normal” Ruby
      JRuby ‐ Sun
      MacRuby ‐ Apple
      IronRuby ‐ Microsoft
      Rubinius ‐ EngineYard
      MagLev ‐ Gemstone
      HotRuby
    8. Why should I care?
      For me the purpose of life is partly to have joy.
      Programmers often feel joy when they can concentrate
      on the creative side of programming,
      so Ruby is designed to make programmers happy.
      - Yukihiro “Matz” Matsumoto
    9. Why should I care?
      Actually, I'm trying to make Ruby natural, not simple.
      - Yukihiro “Matz” Matsumoto
    10. Best of breed
      If Python was the result of Lisp and C++ having a baby,Ruby is the result of Perl and Smalltalk having a baby.
      - MeowMeow Jones, 11/8/2001 on slashdot.
    11. Duck typing
      if it looks like a duck
      and acts like a duck
      it might as well be a duck
    12. Metaprogramming
      The computer should be doing the hard work.
      That’s what it’s paid to do, after all.
      - Larry Wall
    13. Metaprogramming
      I don’t think the idea here is to save memory or speed.
      The idea behind metaprogramming is
      to teach Ruby your conventions
      And let it do some guessing
      In order to save you some code
      - Why, author of why’s poignant guide to Ruby
    14. STOP!!!! Demo time
    15. REPL
      ReadEvalPrintLoop
      ReadEvalPrintLoop
      ReadEvalPrintLoop
      ReadEvalPrint
    16. STOP!!!! Demo time
    17. Everything is an object
      I invented the term Object-Oriented,
      and I can tell you I did not have C++ in mind
      - Alan Kay
    18. STOP!!!! Demo time
    19. Classes are open
    20. STOP!!!! Demo time
    21. CLR classes open for business
    22. STOP!!!! Demo time
    23. Adding Iron to Ruby
      I have always imagined that paradise will be a kind of library
      - Jorge Luis Borges
    24. Gotcha’s
    25. BDD Ruby/CLR interop
    26. IronRuby MVC
    27. Sinatra
    28. Silverlight
    29. Kweshiunz?
    30. “A language that doesn't affect the way you think
      about programming is not worth knowing.”
      - Alan Perlis
    31. References
      http://flanders.co.nz
      http://ironruby.net
      http://ironruby.info
      http://iunknown.com
      http://manning.com/carrero
      http://rubydoes.net
      http://blog.prokrams.com/
      http://nightlybuilds.cloudapp.net/Project.aspx?project=dlr
      http://blog.jimmy.schementi.com/
    32. go_to(http://ironruby.net).play.create.have_fun

    + casualjimcasualjim, 4 months ago

    custom

    314 views, 0 favs, 0 embeds more stats

    Presentation for the belgian VISUG about IronRuby

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 314
      • 314 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 2
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags