SlideShare a Scribd company logo
IronRuby – A brave new world for .Net@Ben_Hall, Developer\tester, 7digital.comBen@BenHall.me.uk Blog.BenHall.me.uk                 CodeBetter.com/blogs/BenHall
London (UK) based C# MVPWeb Developer @ 7digital.com Working on a number of Open Source ProjectsCo-Author of Testing ASP.net Web Applicationshttp://www.testingaspnet.com
AgendaRubyIronRubyDLRMerging IronRuby and C#
What is Ruby?
Why?
Right language for the right job
Everything is an object“Hello World”.upcase[5,3,4,1,6].sort10.times { |i| puts “Loop count: #{i}” }
Blocks10.times do |i|   puts “Loop count: #{i}”endLoop count: 0Loop count: 1Loop count: 2Loop count: 3Loop count: 4Loop count: 5Loop count: 6Loop count: 7Loop count: 8Loop count: 9
Blockssearch_engines =   %W[Google Yahoo Bing].map do |engine|    "http://www.#{engine.downcase}.com"  endsearch_engines = [    ‘http://www.google.com’,      ‘http://www.yahoo.com’,      ‘http://www.bing.com’]
Natural Programmingx = [1,2,3]y = [4,5,6]>>> x + y => [1,2,3,4,5,6]
Duck Typing# Message sends itself via some transport protocolclass Message  def publish(transport)    puts transport.send(self)  endendhttp://www.flickr.com/photos/normis/337183421/
Duck Typingclass Queue   def send(message)       @server.open       @server.issue(message)       @server.close   endend
Duck Typingclass SmtpService   def send(message)      @service.post(message)    endend
Duck Typingm = Message.newm.subject = “Hello TechDays!”q = Queue.news = SmtpService.newm.publish(q)m.publish(s)
Duck Typingclass Postman   def send(message)phone_number = 012398622@john.call(phone_number)   endendm.publish(Postman.new)
Mixinsclass ProductPage < CMS::BasePageinclude Editable    includeThemeableincludeDroppableCustomisationsend
Extendableclass Fixnum   def odd?()       !even?   end   def even?()      self % 2 == 0   endend>>> 1.odd?=> true>>> 1.even?=> false>>> 2.odd?=> false>>> 2.even?=> true
Blended of multiple languages
“Ruby is simple in appearance, but is very complex inside, just like our human body”Yukihiro “matz” Matsumoto – Creator of Ruby
“trying to make Ruby natural, not simple”Yukihiro “matz” Matsumoto – Creator of Ruby
FrameworksRails   (Web)ActiveRecord  (ORM)Sinatra  (Web)RSpec  (BDD \ Unit Testing)Cucumber  (Acceptance Testing)
If that’s RubyWhat’s IronRuby?http://www.flickr.com/photos/bflv/3328427869/
DEMOs
Static language => Dynamic languagehttp://github.com/BenHall/IronRuby_CSharp_Type_Interop
Ruby Frameworks     - Exposing NHibernate domain model in a ‘RESTful’ wayhttp://github.com/BenHall/IronRestfulRails
@post = r.GetPost("PostID", params[:id].to_i)class PostRepository  def method_missing(m, *args)columnName = m.id2name.sub(/find_by_/, "")get_postcolumnName, *args  endend@post = r.find_by_PostID 1@post = r.find_by_Title “Post 1"http://github.com/BenHall/IronRestfulRails
Ruby Frameworks - erbhttp://github.com/BenHall/IronRuby_Erb_Templating
C# Frameworks - WPF
C# Frameworks - MeerPushhttp://github.com/BenHall/MeerPush
What is the DLR?http://www.flickr.com/photos/lastrounds/3199561205/sizes/o/
IronPython?
Combing the two worldshttp://www.flickr.com/photos/mendhak/2117622450/sizes/o/
Embedding IronRuby into C#http://github.com/BenHall/EmbeddedIronRuby
Extending C# applications using Ruby and MEFhttp://github.com/BenHall/ExtendViaMEF
Data Gen Screenshot
Reflector Screenshot
Resolver Systems
C# 4.0 - dynamic        static void Main(string[] args)        {Console.WriteLine("Executing from C#");ScriptRuntime runtime = IronRuby.Ruby.CreateRuntime();ScriptScope scope = runtime.ExecuteFile("person.rb");            dynamic person = scope.Engine.Execute("Person.new");person.say_hello();Console.ReadLine();        }Program.csperson.rbclass Person   def say_hello      puts "Hello world from IronRuby!"   endendhttp://github.com/BenHall/IronRuby_CSharp_4
Testing C# applicationshttp://github.com/BenHall/wipflash_cucumber_driven_example
Ruby Everywhere!
How will the DLR changeyour world?
@Ben_HallBen@BenHall.me.ukBlog.BenHall.me.ukhttp://lolcatgenerator.com/lolcat/120/

More Related Content

What's hot (20)

PDF
Happy Programming with CoffeeScript
Eddie Kao
 
PDF
Ember.js Meetup Brussels 31/10/2013
Hstry
 
KEY
CoffeeScript presentation
John Lynch
 
PDF
Developing cross platform desktop application with Ruby
Anis Ahmad
 
KEY
J Ruby Meetup Engine Yard Feb2011
baqhaidri
 
PDF
Ruby on Rails for beginners
Vysakh Sreenivasan
 
PPT
CoffeeScript: A beginner's presentation for beginners copy
Patrick Devins
 
PPT
Ruby application based on http
Richard Huang
 
PDF
Ruby on Rails Presentation
Michael MacDonald
 
KEY
Behavior Driven Infrastructure 2011-01
Jeffrey Hulten
 
ODP
Ruby on Rails
Aizat Faiz
 
PDF
When To Use Ruby On Rails
dosire
 
PDF
Jan Čurn: Meteor: the full-stack JavaScript framework
Develcz
 
PDF
Text expansion in vim
mattboehm
 
PDF
Ruby on Rails Presentation
adamcookeuk
 
PPT
Ruby Basics
SHC
 
PDF
AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...
AWS Chicago
 
PDF
Артем Маркушев - JavaScript
DataArt
 
PPTX
WappZapp & Appcelerator Titanium
Wienke Giezeman
 
PDF
Plumbin Pipelines - A Gulp.js workshop
Stefan Baumgartner
 
Happy Programming with CoffeeScript
Eddie Kao
 
Ember.js Meetup Brussels 31/10/2013
Hstry
 
CoffeeScript presentation
John Lynch
 
Developing cross platform desktop application with Ruby
Anis Ahmad
 
J Ruby Meetup Engine Yard Feb2011
baqhaidri
 
Ruby on Rails for beginners
Vysakh Sreenivasan
 
CoffeeScript: A beginner's presentation for beginners copy
Patrick Devins
 
Ruby application based on http
Richard Huang
 
Ruby on Rails Presentation
Michael MacDonald
 
Behavior Driven Infrastructure 2011-01
Jeffrey Hulten
 
Ruby on Rails
Aizat Faiz
 
When To Use Ruby On Rails
dosire
 
Jan Čurn: Meteor: the full-stack JavaScript framework
Develcz
 
Text expansion in vim
mattboehm
 
Ruby on Rails Presentation
adamcookeuk
 
Ruby Basics
SHC
 
AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...
AWS Chicago
 
Артем Маркушев - JavaScript
DataArt
 
WappZapp & Appcelerator Titanium
Wienke Giezeman
 
Plumbin Pipelines - A Gulp.js workshop
Stefan Baumgartner
 

Viewers also liked (7)

PPT
Group Colloquium Assignment
melissa_jm89
 
PPTX
Testing ASP.net Web Applications
Ben Hall
 
PPTX
Testing ASP.net Web Applications using Ruby
Ben Hall
 
PPTX
Taking advantage of the Amazon Web Services (AWS) Family
Ben Hall
 
PPTX
Creating extensible application using MEF
Ben Hall
 
PPT
Valentine's Day Weekend
Pixistikgoodness
 
PPTX
Embracing Startup Life and learning to think The Startup Way
Ben Hall
 
Group Colloquium Assignment
melissa_jm89
 
Testing ASP.net Web Applications
Ben Hall
 
Testing ASP.net Web Applications using Ruby
Ben Hall
 
Taking advantage of the Amazon Web Services (AWS) Family
Ben Hall
 
Creating extensible application using MEF
Ben Hall
 
Valentine's Day Weekend
Pixistikgoodness
 
Embracing Startup Life and learning to think The Startup Way
Ben Hall
 
Ad

Similar to TechDays - IronRuby (20)

PDF
IronRuby for the Rubyist
Will Green
 
PPT
Java, Ruby & Rails
Peter Lind
 
KEY
Introduction to Ruby
Mark Menard
 
PPTX
Why Ruby?
IT Weekend
 
PPT
Workin ontherailsroad
Jim Jones
 
PPT
WorkinOnTheRailsRoad
webuploader
 
KEY
Ruby on Rails Training - Module 1
Mark Menard
 
PPTX
Ruby for .NET developers
Max Titov
 
PDF
Ruby Metaprogramming - OSCON 2008
Brian Sam-Bodden
 
PPTX
Code for Startup MVP (Ruby on Rails) Session 2
Henry S
 
ODP
Ruby
Aizat Faiz
 
PPT
Rapid Application Development using Ruby on Rails
Simobo
 
KEY
A tour on ruby and friends
旻琦 潘
 
PDF
FGCU Camp Talk
Mark Brooks
 
PPT
Ruby for C# Developers
Cory Foy
 
PPTX
Day 1 - Intro to Ruby
Barry Jones
 
PDF
Introduction to Ruby & Modern Programming
Christos Sotirelis
 
PDF
Workin On The Rails Road
RubyOnRails_dude
 
PPTX
Ruby Loves Dot Net
Ivan Porto Carrero
 
PDF
Ruby for C#-ers (ScanDevConf 2010)
Thomas Lundström
 
IronRuby for the Rubyist
Will Green
 
Java, Ruby & Rails
Peter Lind
 
Introduction to Ruby
Mark Menard
 
Why Ruby?
IT Weekend
 
Workin ontherailsroad
Jim Jones
 
WorkinOnTheRailsRoad
webuploader
 
Ruby on Rails Training - Module 1
Mark Menard
 
Ruby for .NET developers
Max Titov
 
Ruby Metaprogramming - OSCON 2008
Brian Sam-Bodden
 
Code for Startup MVP (Ruby on Rails) Session 2
Henry S
 
Rapid Application Development using Ruby on Rails
Simobo
 
A tour on ruby and friends
旻琦 潘
 
FGCU Camp Talk
Mark Brooks
 
Ruby for C# Developers
Cory Foy
 
Day 1 - Intro to Ruby
Barry Jones
 
Introduction to Ruby & Modern Programming
Christos Sotirelis
 
Workin On The Rails Road
RubyOnRails_dude
 
Ruby Loves Dot Net
Ivan Porto Carrero
 
Ruby for C#-ers (ScanDevConf 2010)
Thomas Lundström
 
Ad

More from Ben Hall (20)

PPTX
The Art Of Documentation - NDC Porto 2022
Ben Hall
 
PPTX
The Art Of Documentation for Open Source Projects
Ben Hall
 
PPTX
Three Years of Lessons Running Potentially Malicious Code Inside Containers
Ben Hall
 
PPTX
Containers without docker
Ben Hall
 
PPTX
Deploying windows containers with kubernetes
Ben Hall
 
PPTX
The Art of Documentation and Readme.md for Open Source Projects
Ben Hall
 
PPTX
How Secure Are Docker Containers?
Ben Hall
 
PPTX
The Challenges of Becoming Cloud Native
Ben Hall
 
PPTX
Scaling Docker Containers using Kubernetes and Azure Container Service
Ben Hall
 
PPTX
The art of documentation and readme.md
Ben Hall
 
PPTX
Experimenting and Learning Kubernetes and Tensorflow
Ben Hall
 
PPTX
Running .NET on Docker
Ben Hall
 
PPTX
Real World Lessons on the Pain Points of Node.JS Application
Ben Hall
 
PPTX
Tips on solving E_TOO_MANY_THINGS_TO_LEARN with Kubernetes
Ben Hall
 
PPTX
Deploying applications to Windows Server 2016 and Windows Containers
Ben Hall
 
PPTX
The How and Why of Windows containers
Ben Hall
 
PPTX
Lessons from running potentially malicious code inside containers
Ben Hall
 
PPTX
Deploying Windows Containers on Windows Server 2016
Ben Hall
 
PPTX
Learning Patterns for the Overworked Developer
Ben Hall
 
PPTX
Real World Lessons on the Pain Points of Node.js Applications
Ben Hall
 
The Art Of Documentation - NDC Porto 2022
Ben Hall
 
The Art Of Documentation for Open Source Projects
Ben Hall
 
Three Years of Lessons Running Potentially Malicious Code Inside Containers
Ben Hall
 
Containers without docker
Ben Hall
 
Deploying windows containers with kubernetes
Ben Hall
 
The Art of Documentation and Readme.md for Open Source Projects
Ben Hall
 
How Secure Are Docker Containers?
Ben Hall
 
The Challenges of Becoming Cloud Native
Ben Hall
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Ben Hall
 
The art of documentation and readme.md
Ben Hall
 
Experimenting and Learning Kubernetes and Tensorflow
Ben Hall
 
Running .NET on Docker
Ben Hall
 
Real World Lessons on the Pain Points of Node.JS Application
Ben Hall
 
Tips on solving E_TOO_MANY_THINGS_TO_LEARN with Kubernetes
Ben Hall
 
Deploying applications to Windows Server 2016 and Windows Containers
Ben Hall
 
The How and Why of Windows containers
Ben Hall
 
Lessons from running potentially malicious code inside containers
Ben Hall
 
Deploying Windows Containers on Windows Server 2016
Ben Hall
 
Learning Patterns for the Overworked Developer
Ben Hall
 
Real World Lessons on the Pain Points of Node.js Applications
Ben Hall
 

TechDays - IronRuby

  • 1. IronRuby – A brave new world for .Net@Ben_Hall, Developer\tester, [email protected] Blog.BenHall.me.uk CodeBetter.com/blogs/BenHall
  • 2. London (UK) based C# MVPWeb Developer @ 7digital.com Working on a number of Open Source ProjectsCo-Author of Testing ASP.net Web Applicationshttp://www.testingaspnet.com
  • 6. Right language for the right job
  • 7. Everything is an object“Hello World”.upcase[5,3,4,1,6].sort10.times { |i| puts “Loop count: #{i}” }
  • 8. Blocks10.times do |i| puts “Loop count: #{i}”endLoop count: 0Loop count: 1Loop count: 2Loop count: 3Loop count: 4Loop count: 5Loop count: 6Loop count: 7Loop count: 8Loop count: 9
  • 9. Blockssearch_engines =   %W[Google Yahoo Bing].map do |engine|    "http://www.#{engine.downcase}.com"  endsearch_engines = [ ‘http://www.google.com’, ‘http://www.yahoo.com’, ‘http://www.bing.com’]
  • 10. Natural Programmingx = [1,2,3]y = [4,5,6]>>> x + y => [1,2,3,4,5,6]
  • 11. Duck Typing# Message sends itself via some transport protocolclass Message def publish(transport) puts transport.send(self) endendhttp://www.flickr.com/photos/normis/337183421/
  • 12. Duck Typingclass Queue def send(message) @server.open @server.issue(message) @server.close endend
  • 13. Duck Typingclass SmtpService def send(message) @service.post(message) endend
  • 14. Duck Typingm = Message.newm.subject = “Hello TechDays!”q = Queue.news = SmtpService.newm.publish(q)m.publish(s)
  • 15. Duck Typingclass Postman def send(message)phone_number = [email protected](phone_number) endendm.publish(Postman.new)
  • 16. Mixinsclass ProductPage < CMS::BasePageinclude Editable    includeThemeableincludeDroppableCustomisationsend
  • 17. Extendableclass Fixnum def odd?() !even? end def even?() self % 2 == 0 endend>>> 1.odd?=> true>>> 1.even?=> false>>> 2.odd?=> false>>> 2.even?=> true
  • 19. “Ruby is simple in appearance, but is very complex inside, just like our human body”Yukihiro “matz” Matsumoto – Creator of Ruby
  • 20. “trying to make Ruby natural, not simple”Yukihiro “matz” Matsumoto – Creator of Ruby
  • 21. FrameworksRails (Web)ActiveRecord (ORM)Sinatra (Web)RSpec (BDD \ Unit Testing)Cucumber (Acceptance Testing)
  • 22. If that’s RubyWhat’s IronRuby?http://www.flickr.com/photos/bflv/3328427869/
  • 23. DEMOs
  • 24. Static language => Dynamic languagehttp://github.com/BenHall/IronRuby_CSharp_Type_Interop
  • 25. Ruby Frameworks - Exposing NHibernate domain model in a ‘RESTful’ wayhttp://github.com/BenHall/IronRestfulRails
  • 26. @post = r.GetPost("PostID", params[:id].to_i)class PostRepository def method_missing(m, *args)columnName = m.id2name.sub(/find_by_/, "")get_postcolumnName, *args endend@post = r.find_by_PostID 1@post = r.find_by_Title “Post 1"http://github.com/BenHall/IronRestfulRails
  • 27. Ruby Frameworks - erbhttp://github.com/BenHall/IronRuby_Erb_Templating
  • 29. C# Frameworks - MeerPushhttp://github.com/BenHall/MeerPush
  • 30. What is the DLR?http://www.flickr.com/photos/lastrounds/3199561205/sizes/o/
  • 32. Combing the two worldshttp://www.flickr.com/photos/mendhak/2117622450/sizes/o/
  • 33. Embedding IronRuby into C#http://github.com/BenHall/EmbeddedIronRuby
  • 34. Extending C# applications using Ruby and MEFhttp://github.com/BenHall/ExtendViaMEF
  • 38. C# 4.0 - dynamic static void Main(string[] args) {Console.WriteLine("Executing from C#");ScriptRuntime runtime = IronRuby.Ruby.CreateRuntime();ScriptScope scope = runtime.ExecuteFile("person.rb"); dynamic person = scope.Engine.Execute("Person.new");person.say_hello();Console.ReadLine(); }Program.csperson.rbclass Person def say_hello puts "Hello world from IronRuby!" endendhttp://github.com/BenHall/IronRuby_CSharp_4
  • 41. How will the DLR changeyour world?
  • 43. Utvärdera gärna sessionen. Dina synpunkter är mycket värdefulla för oss. Därför är vi mycket tacksamma för att du tar dig någon minut att utvärdera den session som du just har lyssnat på. Besök din MINT-profil* i din mobil, gå till dina sessioner och klicka på ”utvärdera”. In English: Your feedback is very valuable to us. Therefore, we are very grateful that you take a minute to evaluate the session that you just listened to. Tack!*MINT är en mobil tjänst för evenemang och möten som bland annan erbjuder dig möjligheten att utvärdera de sessioner du besöker direkt i din mobil. Om du saknar mobil eller inte kan komma åt MINT av annan anledning har vi fysiska utvärderingar i pappersform.

Editor's Notes

  • #5: Dynamic language
  • #6: Static &gt; Dynamic. Dynamic are more flexible, can adapt the applications frameworks to fit your requirements. Produce similar results, cleaner code and provide a nicer experience for developers. As a result, the code is easier to maintain. Ruby community – testable, clean, natural, expressive =&gt; open source
  • #26: Git branch master (demo)Git branch to_json_via_ruby (monkey patch)
  • #31: http://www.flickr.com/photos/lastrounds/3199561205/sizes/o/
  • #34: C:UsersBen HallDocumentsSourceControlEmbeddedIronRubyGit branch demoGit branch master (complete)
  • #35: C:UsersBen HallDocumentsSourceControlMEFEnabledGit branch master (demo)Git branch with_ruby (complete)