Showing posts with label IronRuby. Show all posts
Showing posts with label IronRuby. Show all posts

Thursday, March 10, 2011

Calling IronRuby in F# on Mono

This is just a hobby, but wonderful. Mono 2.10 only can do it as out-of-the-box!
Microsoft (R) F# 2.0 Interactive build 2.0.0.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> #r "/Library/Frameworks/Mono.framework/Versions/Current/lib/ironruby/bin/IronRuby.dll";;

--> Referenced '/Library/Frameworks/Mono.framework/Versions/Current/lib/ironruby/bin/IronRuby.dll'

> #r "/Library/Frameworks/Mono.framework/Versions/Current/lib/ironruby/bin/IronRuby.Libraries.dll";;

--> Referenced '/Library/Frameworks/Mono.framework/Versions/Current/lib/ironruby/bin/IronRuby.Libraries.dll'

> #r "/Library/Frameworks/Mono.framework/Versions/Current/lib/ironruby/bin/Microsoft.Scripting.dll";;   

--> Referenced '/Library/Frameworks/Mono.framework/Versions/Current/lib/ironruby/bin/Microsoft.Scripting.dll'

> open IronRuby;;
> let runtime = IronRuby.Ruby.CreateRuntime();;          

val runtime : Microsoft.Scripting.Hosting.ScriptRuntime

> let engine = runtime.GetEngine("Ruby");;
Binding session to '/Library/Frameworks/Mono.framework/Versions/Current/lib/ironruby/bin/IronRuby.Libraries.dll'...
val engine : Microsoft.Scripting.Hosting.ScriptEngine

> engine.Execute("class Hello;def world;'Hello World';end;end");;
val it : obj = null
> engine.Execute("puts Hello.new.world");;
Hello World
val it : obj = null

Friday, February 18, 2011

Mono 2.10 has three more languages out-of-the-box

In two days ago, Mono 2.10 had been released. The most notable change is "three more languages out-of-the-box". These are F#,:
IronPython,:
and IronRuby.:

Tuesday, February 15, 2011

IronRuby 1.1.2 is released

One week ago, IronRuby 1.1.2 has been released. This release fixes many bugs related with RubyGems... here is also about RubyGems!

Monday, October 25, 2010

IronRuby 1.1.1 is released

A few days ago, IronRuby 1.1.1 has been released. It is the first release compatible with Ruby 1.9.2. And now, non-English languages are recognized almost correctly.

Monday, September 13, 2010

IronRuby 1.1 is available, maybe.

IronRuby's latest version is 1.1 (stable version is still 1.0) . This version will be compatible with Ruby 1.9.2.

Really? Show the irb of Ruby 1.9.2.

Next, show the irb of IronRuby 1.1.

Oops, String#encoding is not ready.

Saturday, June 19, 2010

re-check "begin-rescue-else-end" on your ruby environment

I found some bug report for JRuby in here (now fixed).

I copy and simplify this sample code like below:
def hoge
  puts 1
rescue Exception => e
  puts 2
  raise "shouldn't get here"
else
  puts 3
  raise "should raise out of the method"
end
begin
  puts RUBY_VERSION
  hoge
rescue => e
  puts e.message
end

Let's evaluate this on each ruby environment.

Thursday, April 15, 2010

IronRuby 1.0 is FINALLY released!

A few days ago, IronRuby 1.0 has been released. I download and install IronRuby for .Net 2.0 because My windows environment does not have .NET 4.0.

And I run sample WinForms application from IronRuby console:
IronRuby 1.0.0.0 on .NET 2.0.50727.4927
Copyright (c) Microsoft Corporation. All rights reserved.

>>> require 'System.Windows.Forms'
=> true
>>> include System::Windows::Forms
=> Object
>>> f = Form.new
=> System.Windows.Forms.Form, Text:
>>> f.text = 'Hello World'
=> "Hello World"
>>> Application.run(f)

Tuesday, October 20, 2009

Gestalt and Moonlight

I learned 'Gestalt' recently - that is browser-side Ruby/Python/XAML scripting (instead of ECMAScript) driven with jQuery and Silverlight. Is that the product only for Windows? No! Gestalt supports not only Silverlight but also Moonlight.

I try to run sample bundled with Gestalt onto the Firefox on the my openSUSE.
  1. Install Firefox add-on of moonlight from here
  2. Download the zip of Gestalt from here
  3. Uncompress the zip of Gestalt
  4. Open the XAML sample files Gestalt/samples/getting.started/03_xaml.html, Gestalt/samples/getting.started/04_animation.html and Gestalt/samples/getting.started/05_final.html
If Gestalt/samples/getting.started/03_xaml.html succeeded, Firefox renders like below:

But samples of Ruby or Python didn't work in intact. I guess it's suspicious that Moonlight on the openSUSE 11.1 is 1.0, not 2.0 even though Firefox add-on of moonlight is 2.0 beta.