Top Banner
Will Green [email protected] @hotgazpacho
34

IronRuby for the Rubyist

May 19, 2015

Download

Technology

Will Green

Presentation on IronRuby geared towards Rubyists
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: IronRuby for the Rubyist

Will Green [email protected] @hotgazpacho

Page 2: IronRuby for the Rubyist

History The DLR Why IronRuby? The Million Dollar Question Rusty Washers Getting IronRuby Additional Resources

Page 4: IronRuby for the Rubyist

Compiler that translates Ruby source code into .NET IL (Intermediate Langauage)

Ran Ruby code on the .NET CLR (Common Language Runtime)

Started by Dr. Wayne Kelly and Prof. John Gough of the Queensland University of Technology

Lost relevance around the beginning of 2008

Page 5: IronRuby for the Rubyist

“A high-performance Ruby to .NET bridge that allows seamless integration of CLR and Ruby objects in the same Win32 process.”

Developed by John Lam and Ceasar Larry Runs Ruby code on the .NET Common

Language Runtime Abandoned when John Lam was hired by

Microsoft

Page 6: IronRuby for the Rubyist

“IronRuby is a Open Source implementation of the Ruby programming language for .NET, heavily relying on Microsoft's Dynamic Language Runtime”

Microsoft’s implementation of Ruby John Lam hired as Program Manager Current Program Manager (also for IronPython) is

Jimmy Schementi First previewed at MIX 2007 Version 1.0 released at MIX 2010

Targets Ruby 1.8.6

Page 7: IronRuby for the Rubyist

You got your dynamic in my static! You got your static in my dynamic!

Source: http://www.flickr.com/photos/25517107@N00/2950954830/

Page 8: IronRuby for the Rubyist

A common runtime for dynamic languages on the .NET platform

Provides interop among various dynamic languages Use libraries from multiple languages simultaneously

Allows hosting dynamic languages in static .NET assemblies New .NET static type: dynamic

Page 9: IronRuby for the Rubyist

IronRuby IronPython IronScheme ClojureCLR IronJS (JavaScript) Nua (Lua)

JS

Page 10: IronRuby for the Rubyist

What is it good for?

Page 11: IronRuby for the Rubyist

Sometimes, you just ‘gotta interop with “Enterprise” systems written in .NET

SOAP and COM

WCF (Windows Communication Foundation) services

Access to the BCL == Base Class Library

Very extensive, rich set of standard libraries

IronRuby eases the pain

Page 12: IronRuby for the Rubyist

Standardized Packaging System Central Repository for hosting packages Allows installation and management of

multiple versions of a package Allows distribution of binary packages

targeting a specific platform

Ruby Gems 1.3.7 includes my patch to recognize universal-dotnet, universal-dotnet-2.0, and universal-dotnet-4.0 as platforms

Page 13: IronRuby for the Rubyist

Acceptance Testing Cucumber

Unit Testing, BDD style RSpec / Shoulda

Factories instead of Fixtures Factory Girl Machinist

Mocking RSpec Mocks Caricature

▪ Mock .NET types (death to sealed and internal!) ▪ http://github.com/casualjim/caricature

Page 14: IronRuby for the Rubyist

Believe in Magic! http://github.com/thbar/magic

DSL for creating UIs Windows Presentation Foundation ▪ Current hotness for client UI development on Windows

Silverlight ▪ WPF for the Web

Windows Forms ▪ Traditional battleship-grey Windows apps

Think Builder for Windows UIs

Page 15: IronRuby for the Rubyist

DEMO

Page 16: IronRuby for the Rubyist

<script type=“text/ruby”></script> Requires Silverlight, but you get to do this:

Page 17: IronRuby for the Rubyist

DEMO

Page 18: IronRuby for the Rubyist

Source: http://777denny.wordpress.com/2009/07/04/what-does-the-bible-say-about-money-take-this-quick-quiz-to-find-out/

Page 19: IronRuby for the Rubyist

YES!

Page 20: IronRuby for the Rubyist

YES! IronRuby.Rack

Rack adapter for IIS (HttpHandler)

Included in IronRuby source on GitHub

Needs some tweaks*

ActiveRecord Adapters

sqlite3-ironruby

Ironruby-sqlserver

Page 21: IronRuby for the Rubyist

DEMO

Page 22: IronRuby for the Rubyist

Where does IronRuby fall short?

Source: http://www.flickr.com/photos/92709190@N00/230032831

Page 23: IronRuby for the Rubyist

85.94% pass rate

vs 97.53% for MRI

Latest statistics at http://ironruby.info/ Need RubySpec contributions!

RubySepc helps ALL Ruby implementations!

http://rubyspec.org/

Page 24: IronRuby for the Rubyist

OpenSSL

Needs .NET implementation

Should not be an issue with .NET crypto APIs

Putting my money where my mouth is

If someone will write the RubySpec specs for OpenSSL, I will implement it for IronRuby

Page 25: IronRuby for the Rubyist

IronRuby doesn’t implement the C API However, equivalent libraries with .NET code

can be created (and packaged as Gems!)

eg. iron-term-ansicolor

▪ My lib for color console output on Windows

Page 26: IronRuby for the Rubyist

Cucumber’s parser, Gherkin, is now Ragel based

Ragel does not target C# or .NET Work-around:

Ragel does target Java

IKVM is Java (the langauge) for .NET

Use IKVM to create a .NET assembly

Still has some issues

Page 27: IronRuby for the Rubyist

IronRuby does not support FFI

FFI = Foreign Function Interface

▪ http://wiki.github.com/ffi/ffi/why-use-ffi

Perhaps could be implemented via p/Invoke?

Crazy thought, or craziest thought?

Page 28: IronRuby for the Rubyist

Mono == An open source, cross-platform, implementation of C# and the CLR that is binary compatible with Microsoft.NET

Most active contributors to IronRuby are ‘Softies, so running on Mono is not a priority

However, running on Mono is something the team would like

Page 30: IronRuby for the Rubyist

Binary Releases on CodePlex

http://ironruby.codeplex.com/

Source is synched from MS internal TFS to Github

http://github.com/ironruby/ironruby

Community contributions accepted, in some areas of the code, via pulls from forks

Page 32: IronRuby for the Rubyist

Mailing List: http://rubyforge.org/mailman/listinfo/ironruby-core

How to Contribute: http://wiki.github.com/ironruby/ironruby/

IronRuby web site: http://ironruby.net/

Jimmy Schementi’s blog http://blog.jimmy.schementi.com/

IronRuby in the Browser: http://www.rubyinside.com/ironruby-silverlight-ruby-in-browser-3192.html

Page 33: IronRuby for the Rubyist

“IronRuby Unleashed” by Shay Friedman (Sams)

“IronRuby In Action” by Ivan Porto Carrero (Manning)

Page 34: IronRuby for the Rubyist

Jimmy Schementi (MS) - @jschementi James Deville (MS) - @jredville Ivan Porto Carrero (MVP) - @casualjim Shay Friedman (MVP) - @ironshay Michael Letterle (MVP) - @mletterle Ben Hall (MVP) - @Ben_Hall Thibaut Barrère - @thibaut_barrere Mike Moore - @blowmage

http://twitter.com/casualjim/ironruby-community