Saturday, July 28, 2007
IronRuby = (Ruby + .NET)!

IronRuby is out in the open! And I'm digging it!

If you have been reading my most recent posts, you'll see that I've recently started getting into Ruby. Partly that's due to attending and speaking at eRubyCon but I wouldn't have gone to that conference had I not been interested in the technologies. I had first seen some of Ruby when I met John Lam at VSLive Toronto in 2006. He did a keynote talking about languages with Ruby being his language of choice. It was a thought provoking talk but I didn't quite get it. At some point, I started noticing Scott Hanselman start talking about using some of the testing tools in Ruby such as Watir. This intrigued me but I really didn't start getting interested in Ruby until I met Joe O'Brien when he did a session at CodeMash 2007. I really didn't have a chance to play with Ruby until I signed up to talk at eRubyCon and deliberately picked a topic that would require that I learn some Ruby. I probably could have just done a talk on Silverlight as a web front end and danced around the interop questions but I wanted to do something a little more substantial. The end result was that I wrote a Ruby on Rails app that serves up a Silverlight front end that then turned around and asked for JSON objects from the Rails back end. This was a cool demo! Ok - I didn't get a standing ovation but I thought it was fantastic and well received. In the process, I picked up a copy of Dave Thomas' Agile Ruby on Rails Development (See below) on a suggestion by Joe. it turned out to be a great book that walked through some very practical examples and labs. It was fantastically easy to toss together a site with InstantRails following Dave's tutorial. (I'm still reserving judgement on Ruby On Rails as a framework. There are some things that I really like about it and some that I really don't. I need to spend more time looking at it and separate it from Ruby and decide on the framework's attributes independently of Ruby.)

Glenn VanderburgI was asked this week by a fellow Architect Evangelist what I liked about Ruby as I kept babbling on about it. The easiest thing that I can do is point out Glenn Vanderburg's "The Beauty of Ruby". The whole talk is online. He did a variant of this talk at eRubyCon. He points out a handful of high level things that really make Ruby a fantastic language. Ruby is a fantastic blend between simple elegance and rock your world unbelievable power. It has a very clean but flexible syntax. There is just enough punctuation to make things readable without requiring a lot of extra bits. Another powerful bit that took a while to get my head around is that everything is an object from class declarations to instances to methods to variables to everything. And you can ask just about everything questions about itself, ask it to do stuff or pass it around and into new contexts. I've been enamored of .NET's Reflection with it's ability to self inspect and dynamically figure out context at runtime but I had no idea how powerful this type of work could be until I saw Ruby's meta programming layers. The metaphor that I used to explain this to a friend is that you can walk into a dark room and bump into someone and simply by asking them questions, you can turn on all the lights and see what's around you. That's the feel that I get from Ruby and it's extremely powerful self inspection. There are a lot more things that are interesting about Ruby but those two things - the simple but flexible syntax and the extremely powerful meta programming - are the heart of what I like about it right now.

Now that we have an IronRuby implementation that we can start playing with, I'm even more excited about it. This means that I'll have all the power of .NET at my fingertips with the power of Ruby. This makes for a very attractive package. Being build on top of the DLR (Dynamic Language Runtime) is very important as well because does two things. One, it enhances the Ruby implementation and two it enhances the DLR implementation. Scott Guthrie talks a little bit about the idea of "Dynamic Sites" which is a cashing mechanism from the DLR that IronRuby takes advantage of. However, John Lam talks about on his .NET Rocks episode about the DLR that they found and fixed bugs in the DLR. Through the DLR, we are going to have a fantastic dynamic type system. This type system allows all of the languages of .NET, dynamic and static, to share common types without having to do translations back and forth. There are a number of things that it doesn't do yet, the most notable being that it doesn't implement interfaces yet. This is not a big deal to Ruby and Python, but it is a big deal to VB.NET and C#. I know that this is coming - it's just a matter of time. Jim Hugunin talks a lot about the DLR and the type system on this blog.

What's missing right now from Ruby is tooling. I'll admit it, I'm still addicted to my "intelli-crack" and there are not a lot of great IDEs for Ruby that include intellisense. It's hard to get right because of the dynamic nature. There are some tools that are out there, but not any that really get it right. Most of the people in the Ruby community don't worry about the tools - in fact there was a huge argument over whether VI or Emacs was a better editor for Ruby (Emacs won...). I'll be honest - I was a little blown away that this is still a conversation.

RubyForgeOne interesting part of the IronRuby implementation and release is that John has make the decision to release IronRuby on RubyForge rather than CodePlex. Scott Guthrie talks about this on his blog. John decided that there would be a lot more community involvement with IronRuby if he did it on RubyForge than on a Microsoft property. I think this is a smart move that shows some dedication to making this a true community driven initiative. I say bravo John!

 

Additional Reading:

John Lam, who is the architect of Iron Ruby who wrote A First Look at IronRuby

Scott Guthrie, who has a nice sample on using IronRuby with WPF

Jason Zander, on working with the open source community

Miguel de Icaza, for an outside perspective of our changes as a company

 


DLR | Python | Ruby
Saturday, July 28, 2007 2:30:24 AM (GMT Standard Time, UTC+00:00)  #  Comments [0] 

 Tuesday, May 01, 2007
MIX07 - Dynamic Languages

I'm sitting in the back of a Dynamic Languages session by John Lam and Jim Hugunin called "Just Glue it! Ruby and the DLR in Silverlight". John Lam was a recent hire (January) to Microsoft. Prior to this he was working the Ruby CLR. Jim Hugunin is an architect on the CLR focused on DLR (Dynamic Language Runtime). He joined Microsoft specifically to work on Iron Python and make sure that the CLR was one of the best platform for dynamic languages such as Python.

They are showing a ton of very cool stuff. They are doing all of their programming in TextMate on a Mac. The samples so far have been in JavaScript, Ruby, Python and even Dynamic VB.

I recommend that you check out this session on the http://www.visitmix.com site when the recording gets up there. They do a fantastic job showing the power and ease of dev as well as poking a lot of fun at each other.

What's a lot of fun is the interplay between all of the different languages. For example, they created a library in C# that they could pull in and leverage from Ruby and a JavaScript lib that was doing some 3D work that they pulled in and did some quick and easy work.

Link to Visit MIX07

 

Technorati tags: , , , ,

DLR | MIX07 | Python | Ruby | Silverlight
Tuesday, May 01, 2007 8:01:02 PM (GMT Standard Time, UTC+00:00)  #  Comments [0] 

 Monday, April 30, 2007
MIX07 - Silverlight to support Ruby and Python

I know that I already mentioned this - but I thought I'd call it out specifically as it was part of a much larger post.

Silverlight 1.1 Alpha supports Ruby and Python on the client side so people can write their RIA (Rich Internet Applications) in their own language. If you have not looked at dynamic languages - you should. There's a lot of power there. Obviously, with power comes danger. I'll be blogging more about Dynamic Languages later.

I ran into David Laribee who wrote about MIX07: Silverlight, IronRuby, and Dynamic Languages. He's really geeked about Iron Ruby.

 

Technorati tags: , ,

DLR | MIX07 | Python | Ruby
Monday, April 30, 2007 9:04:47 PM (GMT Standard Time, UTC+00:00)  #  Comments [0] 

MIX07 Keynote - Information Overload

BTW - long post! Too many announcements!

I'm just out of the MIX07 keynote featuring Ray Ozzie and Scott Guthrie (Yes I find it a lot of fun that the top guys at Microsoft on the technology side blog about what they are doing). I'm still trying to get my head around what I just heard. They have far exceeded my wildest expectations.

First - the client demos were sweet!

Neil Hunt of Netflix got on stage with some guys from Razorfish and demoed the great rich media and interactive video support in Silverlight. One of the cool things is that it was completely integrated into the back-end Netflix site for ratings, ordering and so on, has a chat app inside, collaborative movie watching where two people can watch the same movie from different parts of the world and it will keep them in sync and let them IM during the movie. That was cool and Netflix is a fantastic backer as they are very demanding on their systems and need the highest quality experience for their clients.

CBS got up and showed how they are integrating pro media with community contributed media tied to that pro media so that they can all of the sudden get content and points of view from an amazing number of sources instead of just their one camera guy.

Top Banana - I was already blown away when this section of the keynote came up. It's one of the first managed applications with Silverlight and written with XAML and C# in Expression Studio, VS.NET and more. It's a full blown video editor written in Silverlight. Wait - video editing in the browser? This is really blurring the line between desktop and web application. It's only 50 kilobytes worth of payload to do all of the video editing. Yes - that's 50k worth of code that's downloaded. It does film stripping, frame by frame stepping, cutting, mixing, merging and everything that I could do with video. The did all of this in a month.

MLB.com are doing a ton with Silverlight as well. It has integrated overlays so you can watch the full screen video with overlays of your fantasy teams, pitch counts and more. It even ran on a phone! It's a great experience and I'd love to talk more about it but I'm numb at this point with all the cool stuff.

Second - the Silverlight Beta (the cross-platform plug-in formerly known as WPF/e) is going to have much richer support for JavaScript and AJAX. That we expected and needed.

Third - there had been a lot of rumors and speculation about the next bit of business and that is that the Silverlight 1.1 Alpha is going to have the same exact CLR as the desktop version that allows you to leverage your existing .NET skills in VB.NET or C# to build RIA (Rich Internet Applications). Read that again slowly though. You will be able to write .NET to run in the browser on the client side of one of these RIA's. In other words - you'll be able to run .NET on a Mac in a Safari browser! That includes LINQ and the whole ball of wax! That just put Silverlight RIA's in reach of any dev shops that are currently doing WPF with C# of VB.NET. And we are going to have support for Silverlight in VS.NET Orcas with a free download called the Silverlight Tools Alpha so we have proper tooling for the developers.

Fourth - The tooling is amazing. Expression Blend can export to XAML directly for Silverlight. That means that I'm not nearly as constricted by the limited number of controls and such that are available for Silverlight compared to WPF. It also manages and writes out all of your timelines, media integration, graphics work and so on. Expression Media does a great job of managing and encoding all of your videos. Expression Web has an AJAX Silverlight drop-in bit that can just drop in an RIA inside an existing application through drag and drop. As mentioned, VS.NET Orcas has support for development.

* Big point here * - Cross-Platform Debugging so you can do live debugging across the network to actually debug on the code that's running on the Mac. You have access to the memory, objects, single stepping code and the whole nine yards! That's amazing and it truly enables cross platform development!

* Another big point * - all of the tools from a SOAP perspective

Fifth - the Silverlight Streaming,  a companion service for Silverlight makes it easier for developers and designers to deliver and scale rich media as part of their Silverlight applications. Silverlight Streaming is a storage and video delivery service that will enable developers and designers to upload their application to Silverlight Streaming and then deliver this application to any website globally. Silverlight Streaming will provide 4GB of free storage as well as unlimited outbound streaming at 700 Kbps. For the first year, the service will be free. As the service moves out of beta it will be offered as part of the overall WL Platform offer, with continued 4GB free storage and free streaming up to 1 million minutes of streaming per site per month. Once a website goes over the 1 million minutes of streaming threshold, the site will have the option to take ads and revenue share or pay a small fee to help cover MSFT costs. Check out silverlight.live.com for more on this!

Fifth - and this one came out of the blue for me. The CLR will have full support for the DLR (Dynamic Language Runtime) including Iron Ruby, Iron Python and Managed JScript! Yes, you read that right - I had to ask for clarification when I heard about this too. You will be able to write your applications in C# or Vb.NET or Ruby or Python or Managed JScript! Sweet! That just put WPF and Silverlight (since it's running the exact same CLR) in reach of any shop who knows XML so that they can write XAML and does programming. :) I'm not saying that there won't be a learning curve, but HOLY COW you can write Ruby to run in the browser on the client side of your application! For those of you who haven't looked at Ruby and Python, you really need to take some time to delve into those languages and figure out some of the power and flexibility that dynamic languages bring to the table.

Sixth - Silverlight for Mobile!


DLR | MIX07 | Python | Ruby | WPF | Silverlight
Monday, April 30, 2007 6:54:15 PM (GMT Standard Time, UTC+00:00)  #  Comments [0]