<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-5419182</atom:id><lastBuildDate>Sat, 18 May 2013 21:13:32 +0000</lastBuildDate><category>ruby</category><category>Python</category><category>bob ross</category><category>DLR</category><category>Visual Studio</category><category>Chiron</category><category>Twitter</category><category>HAML</category><category>MacOSX</category><category>Microsoft</category><category>Performance</category><category>MacDrive</category><category>Hack</category><category>graduation</category><category>Release</category><category>NYC</category><category>WebCam</category><category>Lang.NET</category><category>Gestalt</category><category>christmas</category><category>Dynamic Languages</category><category>rational edge</category><category>SQLServer</category><category>Windows</category><category>Apple</category><category>Head First OOAD</category><category>ASP.NET</category><category>Finance</category><category>Testing</category><category>Dbus</category><category>Scripting</category><category>MSDN</category><category>Seattle</category><category>css</category><category>OSCON</category><category>git</category><category>Cucumber</category><category>PyCon</category><category>rails</category><category>DevConnections</category><category>Walk Through</category><category>Mono</category><category>Internship</category><category>JSON</category><category>IronPython</category><category>review</category><category>new york</category><category>JScript</category><category>HTML5</category><category>Windows 7</category><category>NYC CodeCamp</category><category>Embedding</category><category>rubyconf</category><category>wpi</category><category>Website</category><category>rafferty</category><category>RailsConf</category><category>Sparkline</category><category>tutorial</category><category>Pidgin</category><category>webdesign</category><category>ASP</category><category>wii</category><category>Silverline</category><category>Lab49</category><category>game</category><category>Sinatra</category><category>Java</category><category>IIS</category><category>VisualBasic</category><category>MIX10</category><category>Open Source</category><category>C#</category><category>nichum</category><category>Life</category><category>Firefox</category><category>.NET 4.0</category><category>Moonlight</category><category>Linux</category><category>html</category><category>assistment</category><category>Flickr</category><category>MIX08</category><category>worcester</category><category>IronRuby</category><category>smpl</category><category>Internet Explorer</category><category>WPF</category><category>REPL</category><category>talks</category><category>Silverlight</category><category>.NET</category><category>CodePlex</category><title>jimmy.thinking</title><description /><link>http://blog.jimmy.schementi.com/</link><managingEditor>noreply@blogger.com (Jimmy Schementi)</managingEditor><generator>Blogger</generator><openSearch:totalResults>198</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/jimmy-thinking" /><feedburner:info uri="jimmy-thinking" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>47.61487</geo:lat><geo:long>-122.345784</geo:long><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-5879555519916795818</guid><pubDate>Mon, 09 May 2011 04:15:00 +0000</pubDate><atom:updated>2011-05-09T18:56:58.306-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">WPF</category><category domain="http://www.blogger.com/atom/ns#">Finance</category><category domain="http://www.blogger.com/atom/ns#">Sparkline</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">Lab49</category><title>Sparklines in WPF and Silverlight</title><description>&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_OqCZhp9yI0Q/TcdqGOwvLII/AAAAAAAAAXw/kv7ipoVOWWU/s1600-h/image%5B38%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/TcdqHYBck1I/AAAAAAAAAX0/TfMiLAp5p9w/image_thumb%5B28%5D.png?imgmax=800" width="480" height="240"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;One seemingly-trivial-yet-recurring problem in financial software is the need for a live-updating line-chart. However, from multiple conversations with &lt;a href="http://lab49.com" target="_blank"&gt;Lab49&lt;/a&gt; folks, as well as from experience during my first project, I’ve learned that most WPF/Silverlight charting packages suck in various ways, especially if you’re updating their data frequently. Seems like everyone just rolls their own line chart and tailors it to each project, but doesn’t share it for some reason. I’d like to break that trend by sharing and early version of &lt;a href="http://github.com/jschementi/sparkline" target="_blank"&gt;my own sparkline control for WPF and Silverlight&lt;/a&gt;.&lt;/p&gt; &lt;p align="left"&gt;&lt;a href="http://github.com/jschementi/sparkline"&gt;&lt;strong&gt;&lt;font size="3"&gt;http://github.com/jschementi/sparkline&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Sample Usage:&lt;/strong&gt; &lt;/p&gt;&lt;script src="https://gist.github.com/961143.js"&gt; &lt;/script&gt; &lt;p&gt;It’s implementation is very basic; &lt;a href="https://github.com/jschementi/sparkline/blob/master/Schementi.Controls.Sparkline/Sparkline.xaml.cs#L255" target="_blank"&gt;Sparkline.AddTimeValue&lt;/a&gt; constructs a point at the next time interval and adds it to a &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.shapes.polyline.aspx" target="_blank"&gt;Polyline&lt;/a&gt;. You can control the sparkline’s visuals, including adding visible points along the line and showing horizontal lines for the latest/highest/lowest values. The source builds assemblies for both .NET 4.0 and Silverlight 4.&lt;/p&gt; &lt;p&gt;There are obvious features missing like rendered axis or variable x-axis (time) values, but hopefully this provides a simple starting place for anyone else needing a very simple updating line graph. &lt;/p&gt; &lt;p&gt;By the way, &lt;a href="http://decav.com/" target="_blank"&gt;Andre de Cavaignac&lt;/a&gt;, a colleague of mine at Lab49, and Daniel Simon shared their own a while back: &lt;a href="http://blog.lab49.com/archives/2028" target="_blank"&gt;Live Updating Line Graph in WPF&lt;/a&gt;. Let me know if there are any others out there.&lt;/p&gt; &lt;p&gt;Anyways, &lt;a href="http://en.wikipedia.org/wiki/Mother's_Day" target="_blank"&gt;Happy Mother’s Day&lt;/a&gt;!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=NjY2xBSr0yI:EEHPQf_TS4U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=NjY2xBSr0yI:EEHPQf_TS4U:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=NjY2xBSr0yI:EEHPQf_TS4U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=NjY2xBSr0yI:EEHPQf_TS4U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=NjY2xBSr0yI:EEHPQf_TS4U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=NjY2xBSr0yI:EEHPQf_TS4U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=NjY2xBSr0yI:EEHPQf_TS4U:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/NjY2xBSr0yI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/NjY2xBSr0yI/sparklines-in-wpf-and-silverlight.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_OqCZhp9yI0Q/TcdqHYBck1I/AAAAAAAAAX0/TfMiLAp5p9w/s72-c/image_thumb%5B28%5D.png?imgmax=800" height="72" width="72" /><thr:total>13</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2011/05/sparklines-in-wpf-and-silverlight.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-5629718108737088057</guid><pubDate>Fri, 25 Feb 2011 07:50:00 +0000</pubDate><atom:updated>2011-02-24T23:50:15.850-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Scripting</category><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">NYC CodeCamp</category><category domain="http://www.blogger.com/atom/ns#">talks</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">NYC</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><category domain="http://www.blogger.com/atom/ns#">DLR</category><category domain="http://www.blogger.com/atom/ns#">Lab49</category><title>NYC CodeCamp 2011</title><description>&lt;p&gt;This past weekend I spoke at &lt;a href="http://nyc.codecamp.us/" target="_blank"&gt;NYC CodeCamp 2011&lt;/a&gt; about the &lt;a href="http://github.com/IronLanguages" target="_blank"&gt;Iron Languages&lt;/a&gt; project and dynamic languages on .NET; here are the slides:&lt;/p&gt; &lt;div style="width: 425px" id="__ss_7053366"&gt;&lt;object id="__sse7053366" width="425" height="355"&gt;  &lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jschementi-codecampnyc-20110219-110225011534-phpapp02&amp;amp;rel=0&amp;amp;stripped_title=jschementi-codecampnyc20110219&amp;amp;userName=jschementi" /&gt;  &lt;param name="allowFullScreen" value="true" /&gt;  &lt;param name="allowScriptAccess" value="always" /&gt;  &lt;embed name="__sse7053366" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jschementi-codecampnyc-20110219-110225011534-phpapp02&amp;amp;rel=0&amp;amp;stripped_title=jschementi-codecampnyc20110219&amp;amp;userName=jschementi" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;  &lt;/object&gt; &lt;p&gt;Most of the demos were from previous talks, so look through my previous posts on &lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; and &lt;a href="http://ironpython.net" target="_blank"&gt;IronPython&lt;/a&gt; for relevant demos.&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=2DSj0hSGjrs:HOvbUpdO25U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=2DSj0hSGjrs:HOvbUpdO25U:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=2DSj0hSGjrs:HOvbUpdO25U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=2DSj0hSGjrs:HOvbUpdO25U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=2DSj0hSGjrs:HOvbUpdO25U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=2DSj0hSGjrs:HOvbUpdO25U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=2DSj0hSGjrs:HOvbUpdO25U:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/2DSj0hSGjrs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/2DSj0hSGjrs/nyc-codecamp-2011.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><thr:total>8</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2011/02/nyc-codecamp-2011.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-8964339373621087038</guid><pubDate>Thu, 21 Oct 2010 23:14:00 +0000</pubDate><atom:updated>2010-10-21T16:14:17.640-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Open Source</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><category domain="http://www.blogger.com/atom/ns#">Microsoft</category><category domain="http://www.blogger.com/atom/ns#">Lab49</category><title>Leadership of IronRuby and IronPython</title><description>&lt;p&gt;Now that &lt;a href="http://www.flickr.com/photos/jschementi/tags/crosscountry/" target="_blank"&gt;I’ve moved from Seattle to New York&lt;/a&gt;, started my new career at &lt;a href="http://lab49.com/" target="_blank"&gt;Lab49&lt;/a&gt;, &lt;a href="http://photographybyverdi.com/2010/10/18/the-wedding-of-felicia-and-james/" target="_blank"&gt;got married&lt;/a&gt;, and just got back from &lt;a href="http://www.flickr.com/photos/jschementi/sets/72157625070175315/" target="_blank"&gt;the honeymoon&lt;/a&gt;, my public techie life can resume. And I’m happy to resume it on a positive note.&lt;/p&gt; &lt;p&gt;Today signifies a big step in Microsoft’s commitment to open-source: &lt;a href="http://blogs.msdn.com/b/jasonz/" target="_blank"&gt;Jason Zander&lt;/a&gt; &lt;a href="http://blogs.msdn.com/b/jasonz/archive/2010/10/21/new-components-and-contributors-for-ironpython-and-ironruby.aspx" target="_blank"&gt;announced new leadership for IronRuby and IronPython&lt;/a&gt;, namely &lt;a href="http://tirania.org/blog/" target="_blank"&gt;Miguel de Icaza&lt;/a&gt;, &lt;a href="http://www.voidspace.org.uk/python/weblog/index.shtml" target="_blank"&gt;Michael Foord&lt;/a&gt;, &lt;a href="http://jdhardy.blogspot.com/" target="_blank"&gt;Jeff Hardy&lt;/a&gt;, and &lt;a href="http://blog.jimmy.schementi.com/" target="_blank"&gt;myself&lt;/a&gt;. Since Microsoft has officially put the project in our hands, both languages will be open to contributions from the community, not just the core team members. Also, any previously unreleased work as been released, include the IronRuby tools for Visual Studio and groundwork towards IronPython 2.7 and 1.9. You can find the appropriate releases on both &lt;a href="http://ironruby.codeplex.com" target="_blank"&gt;IronRuby&lt;/a&gt; and &lt;a href="http://ironpython.codeplex.com" target="_blank"&gt;IronPython&lt;/a&gt;’s CodePlex sites.&lt;/p&gt; &lt;p&gt;Though Microsoft is no longer directly resourcing these projects, there are definitely companies providing support. &lt;a href="http://lab49.com/"&gt;Lab49&lt;/a&gt; has been tremendously supportive of my participation in the project, and is interested in supporting the project in substantial ways going forward. Those details will become clearer in the future, but it’s great to see my company taking a proactive role in the projects I’m part of. Also, &lt;a href="http://tirania.org/blog/" target="_blank"&gt;Miguel&lt;/a&gt; is a big-shot at Novell, but I’ll let him comment on how his company is supporting the projects. =)&lt;/p&gt; &lt;p&gt;The reality of open-source software is that corporate sponsorship and funding comes and goes. I'm grateful to Microsoft for starting IronPython and IronRuby, funding it up until this point, and passing the torch to individuals who will continue to progress the languages forward. I’d specifically like to thank Bill Chiles, &lt;a href="http://blogs.msdn.com/b/dinoviehland/" target="_blank"&gt;Dino Viehland&lt;/a&gt;, and &lt;a href="http://blog.tomasm.net" target="_blank"&gt;Tomáš Matoušek&lt;/a&gt;, who did the hard work to make this transition happen.&lt;/p&gt; &lt;p&gt;If you’re interested in the future of these projects, please subscribe to their mailing lists (&lt;a href="http://ironruby.net/support" target="_blank"&gt;IronRuby&lt;/a&gt;, &lt;a href="http://ironpython.net/support/" target="_blank"&gt;IronPython&lt;/a&gt;) and help us to continue making a great dynamic language experience on .NET.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=kzdIRICEQf4:Fn1NydPperg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=kzdIRICEQf4:Fn1NydPperg:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=kzdIRICEQf4:Fn1NydPperg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=kzdIRICEQf4:Fn1NydPperg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=kzdIRICEQf4:Fn1NydPperg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=kzdIRICEQf4:Fn1NydPperg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=kzdIRICEQf4:Fn1NydPperg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/kzdIRICEQf4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/kzdIRICEQf4/leadership-of-ironruby-and-ironpython.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><thr:total>19</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2010/10/leadership-of-ironruby-and-ironpython.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-6302570575304821096</guid><pubDate>Fri, 06 Aug 2010 21:40:00 +0000</pubDate><atom:updated>2010-08-08T23:57:01.600-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">Dynamic Languages</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><category domain="http://www.blogger.com/atom/ns#">DLR</category><category domain="http://www.blogger.com/atom/ns#">Microsoft</category><category domain="http://www.blogger.com/atom/ns#">Lab49</category><title>“Start spreading the news”: the future of Jimmy and IronRuby</title><description>&lt;p&gt;Though &lt;a href="http://social.zune.net/bingplayer/?v=1.0#mid=1D5D1B01-0100-11DB-89CA-0019B92A3933&amp;amp;title=New%20York%2C%20New%20York&amp;amp;artist=Frank%20Sinatra&amp;amp;album=New%20York%2C%20New%20York&amp;amp;artistid=4E0C0000-0600-11DB-89CA-0019B92A3933&amp;amp;albumid=FF5C1B01-0100-11DB-89CA-0019B92A3933&amp;amp;dto=1&amp;amp;preview=0&amp;amp;explicit=0&amp;amp;lyrics="&gt;Frank Sinatra&lt;/a&gt; &lt;a href="http://www.bing.com/music/lyrics/detail?q=Frank+Sinatra+New+York,+New+York&amp;amp;songID=1D5D1B01-0100-11DB-89CA-0019B92A3933&amp;amp;lyricsID=T+++691568&amp;amp;albumID=FF5C1B01-0100-11DB-89CA-0019B92A3933&amp;amp;FORM=DTPMUM"&gt;says it best&lt;/a&gt;, “I’m leaving today” isn’t exactly accurate; my last day as a Microsoft employee was July 23rd, 2010. This post is almost two weeks delayed as &lt;a href="http://twitter.com/feliciacutrone" target="_blank"&gt;Felicia&lt;/a&gt; and I have been on the road since the 26th, driving cross-country to the east coast; we also decided to leave Seattle in favor of New York, our home state.&lt;/p&gt;  &lt;p&gt;Both decisions were extremely difficult to make, as I will miss all the brilliant people I worked with. Just being in their presence made me feel smarter, and we accomplished some amazing things together. Many were also my friends, making this a very heart-wrenching decision too. However, I joined Microsoft to bring Ruby and other open-source programming languages to the .NET framework, as well as to promote open-source practices in general, and I promised myself to ensure the truth of that statement throughout my Microsoft career. So, when my manager asked me, “what else would you want to work on other than Ruby,” I started looking for a new job outside Microsoft.&lt;/p&gt;  &lt;p&gt;While Microsoft’s commitment to dynamic languages on .NET has been questioned many times, my tiny team has been excellent at suppressing those fears with quality implementations of &lt;a href="http://ironruby.net" target="_blank"&gt;Ruby&lt;/a&gt; and &lt;a href="http://ironpython.net" target="_blank"&gt;Python&lt;/a&gt; for .NET, compiler services and language embedding API called the &lt;a href="http://dlr.codeplex.com" target="_blank"&gt;Dynamic Language Runtime&lt;/a&gt;, and integration with .NET application frameworks like &lt;a href="http://silverlight.net/dlr" target="_blank"&gt;Silverlight&lt;/a&gt; and &lt;a href="http://aspnet.codeplex.com/wikipage?title=Dynamic%20Language%20Support" target="_blank"&gt;ASP.NET&lt;/a&gt;. And most recently the beginnings of &lt;a href="http://ironpython.net/tools/" target="_blank"&gt;IDE support for dynamic languages in Visual Studio&lt;/a&gt;. And all this released under an well-known open-source license, the &lt;a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank"&gt;Apache License (Version 2)&lt;/a&gt;. This was only possible because my team had the freedom to do what we needed to do to counter those fears and run an effective open-source project&lt;/p&gt;  &lt;p&gt;However, a year ago the team shrunk by half and our agility was severely limited. I’m omitting the internal reasons for this, as they are the typical big-company middle-management issues every software developer has. In short, the team is now very limited to do anything new, which is why the Visual Studio support for IronPython took so long. IronRuby’s IDE support in Visual Studio hasn’t been released yet for the same reasons. While this is just one example, many other roadblocks have cropped up that made my job not enjoyable anymore.&lt;/p&gt;  &lt;p&gt;Overall, I see a serious lack of commitment to IronRuby, and dynamic language on .NET in general. At the time of my leaving &lt;a href="http://blog.tomasm.net/" target="_blank"&gt;Tomas&lt;/a&gt; and myself were the only Microsoft employees working on IronRuby. If this direction for dynamic languages on .NET is a path you &lt;strong&gt;do not&lt;/strong&gt; want Microsoft to take, I strongly suggest you provide feedback to the &lt;a href="http://tinyurl.com/2edqg6t" target="_blank"&gt;team’s management&lt;/a&gt; directly. Also, &lt;a href="http://blogs.msdn.com/b/jasonz/" target="_blank"&gt;Jason Zander&lt;/a&gt; runs the Visual Studio team, which IronRuby, IronPython, and the DLR happen to be a part of, and is a big &lt;strong&gt;proponent&lt;/strong&gt; of these dynamic languages efforts, so provide him with your thoughts as well.&lt;/p&gt;  &lt;p&gt;That being said, I am still interested in implementing dynamic languages on .NET, so I will remain a &lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; core-team member, ironically making me the first non-Microsoft core contributor. The bad-news is I will no longer be working on IronRuby full-time, but in the near future I’m definitely staying active. Also, Tomas will definitely continue working on IronRuby when he can; we weren’t the last two people left for no reason. :-)&lt;/p&gt;  &lt;p&gt;Given that Tomas and I will only be working part-time on IronRuby now, I invite the Ruby and .NET communities to come help us figure out how to continue the IronRuby project, assuming that Microsoft will eventually stop funding it. I’ll start a thread on the &lt;a href="http://rubyforge.org/pipermail/ironruby-core/" target="_blank"&gt;IronRuby Mailing List&lt;/a&gt; shortly, so keep an eye on that if you’d like to help. [&lt;strong&gt;Update&lt;/strong&gt;: &lt;a href="http://bit.ly/dBVJSC" target="_blank"&gt;here’s the thread about the next steps for IronRuby&lt;/a&gt;. &lt;a href="http://bit.ly/aKJz7p" target="_blank"&gt;Join the list&lt;/a&gt; and discuss.]&lt;/p&gt;  &lt;p&gt;While moving to New York is mainly a personal decision, as both my fiancée and I grew up there and our immediate families are still there, it was also for professional reasons; I’ve accepted a new position at &lt;a href="http://lab49.com/"&gt;Lab49&lt;/a&gt;, a financial technology consulting firm in New York City. I chose the financial industry not just because its dominance in New York, but because I see a lot of similarities between financial software and developer tools. Financial software serves a very technical user, much like programmers, but unlike programmers I know nothing these users, making it a challenging new space. It will be familiar as well, as Lab49 has done work with the new &lt;a href="http://www.zdnet.com/blog/microsoft/microsoft-launches-technical-computing-initiative-20/6240" target="_blank"&gt;Technical Computing&lt;/a&gt; team, which many people who once worked on dynamic languages moved to. Lab49 was also very interested in my IronRuby and IronPython background, so it’s a great next step for me.&lt;/p&gt;  &lt;p&gt;I’m grateful to have worked on compilers full-time, outside of academia, while still contributing to open-source, especially at a company that hardly showed up on the open-source radar just 4 years ago. And at least one dynamic language at Microsoft is getting love; &lt;a href="http://blogs.msdn.com/b/ie/archive/2010/03/18/the-new-javascript-engine-in-internet-explorer-9.aspx" target="_blank"&gt;IE9’s JavaScript engine&lt;/a&gt;, and Microsoft has awesome intentions with it. I’m totally a supporter of most things Microsoft is doing, and I look forward to working closely with them on financial problems. I’m just extremely disappointed with their decisions around dynamic languages on .NET. As one former-teammate’s email signature read, “If your ideas are any good, you'll have to ram them down people's throats.”&lt;/p&gt;  &lt;p&gt;I’m looking forward to this new chapter in both my life and my career. Not only am I living in the &lt;a href="http://en.wikipedia.org/wiki/New_York_City" target="_blank"&gt;city that never sleeps&lt;/a&gt;, but I hope to build upon my dynamic language work and use it in an area completely new to me. While I expect to still be Ruby and .NET oriented, my posts will be about solving new problems, and should make for some good reading. Stay tuned, and thanks for all the support thus far.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=xNdySfIQX_c:bkK90dRfc8Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=xNdySfIQX_c:bkK90dRfc8Q:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=xNdySfIQX_c:bkK90dRfc8Q:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=xNdySfIQX_c:bkK90dRfc8Q:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=xNdySfIQX_c:bkK90dRfc8Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=xNdySfIQX_c:bkK90dRfc8Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=xNdySfIQX_c:bkK90dRfc8Q:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/xNdySfIQX_c" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/xNdySfIQX_c/start-spreading-news-future-of-jimmy.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><thr:total>54</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-7819756077114608542</guid><pubDate>Mon, 26 Jul 2010 07:07:00 +0000</pubDate><atom:updated>2010-07-26T00:32:53.406-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dynamic Languages</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><category domain="http://www.blogger.com/atom/ns#">DLR</category><title>ASP.NET dynamic language support is open source</title><description>&lt;p&gt;I'm happy to &lt;i&gt;finally &lt;/i&gt;announce that the &lt;b&gt;&lt;a href="http://ironpython.net/download/aspnet-20100716" target="_blank"&gt;ASP.NET dynamic language support&lt;/a&gt;&lt;/b&gt; is now &lt;b&gt;&lt;a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank"&gt;open source&lt;/a&gt;&lt;/b&gt;: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironpython.net/download/aspnet-20100716" target="_blank"&gt;&lt;strong&gt;Download IronPython and ASP.NET integration&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;For a full &lt;a href="http://ironpython.net" target="_blank"&gt;IronPython&lt;/a&gt; release with the Python standard library, download &lt;/em&gt;&lt;a href="http://ironpython.codeplex.com/releases/view/42434" target="_blank"&gt;&lt;em&gt;IronPython 2.7 Alpha 1&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;This release contains the source code to &lt;code&gt;Microsoft.Scripting.AspNet.dll&lt;/code&gt;, located in the &lt;code&gt;src&lt;/code&gt; directory, licensed under the &lt;a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank"&gt;Apache License (Version 2)&lt;/a&gt;. It will be available in the source repository for IronPython in the very near future, but don't hesitate to start &lt;a href="http://ironpython.codeplex.com/SourceControl/UploadPatch.aspx" target="_blank"&gt;sending in patches&lt;/a&gt;. This release is compatible with &lt;a href="http://ironpython.codeplex.com/releases/view/42434" target="_blank"&gt;IronPython 2.7 Alpha 1&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;Background&lt;/h4&gt;  &lt;p&gt;This download enables &lt;a href="http://www.asp.net/dynamiclanguages" target="_blank"&gt;IronPython as an ASP.NET programming language&lt;/a&gt;. To create a new IronPython ASP.NET WebForms project, simply copy &lt;code&gt;examples\web.config&lt;/code&gt; and &lt;code&gt;examples\bin&lt;/code&gt;, and use &lt;code&gt;examples\hello-webforms.aspx&lt;/code&gt; as a reference. A redistributed copy of the IronPython 2.7 Alpha 1 binaries can be found in the &lt;code&gt;examples\bin&lt;/code&gt; directory; all files except &lt;code&gt;Microsoft.Scripting.AspNet.dll&lt;/code&gt;, the IronPython ASP.NET integration, are from the IronPython 2.7 Alpha 1 release.&lt;/p&gt;  &lt;p&gt;For more detail on getting started, &lt;a href="http://blog.jimmy.schementi.com/2008/09/aspnet-dynamic-language-support.html" target="_blank"&gt;here’s a simple walk-through of making the “hello-webforms” app&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;Package&lt;/h4&gt;  &lt;p&gt;Here's what's in the zip file:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;code&gt;/License.html&lt;/code&gt; - The Apache License, Version 2. &lt;/li&gt;    &lt;li&gt;&lt;code&gt;/dlr-aspnet.sln&lt;/code&gt; - VS2010 solution for examples &lt;/li&gt;    &lt;li&gt;&lt;code&gt;/examples&lt;/code&gt; - Examples of using IronPython in ASP.NET. &lt;/li&gt;    &lt;li&gt;&lt;code&gt;/examples/Web*.config&lt;/code&gt; - configures ASP.NET to use IronPython &lt;/li&gt;    &lt;li&gt;&lt;code&gt;/examples/bin&lt;/code&gt; - Microsoft.Scripting.AspNet.dll, the ASP.NET integration, and a redistribution of IronPython 2.7A1. &lt;/li&gt;    &lt;li&gt;&lt;code&gt;/src&lt;/code&gt; - C# source code that builds Microsoft.Scripting.AspNet.dll &lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;Upgrading&lt;/h4&gt;  &lt;p&gt;This release renames the main DLL from &lt;code&gt;Microsoft.Web.Scripting.dll&lt;/code&gt; to &lt;code&gt;Microsoft.Scripting.AspNet.dll&lt;/code&gt;. If upgrading, you'll have to replace all occurrences of &lt;code&gt;Microsoft.Web.Scripting&lt;/code&gt; with &lt;code&gt;Microsoft.Scripting.AspNet&lt;/code&gt;. This will primarily be at the top of all aspx pages, as well as in your application's web.config. Also note the version number is now 1.1.0.1, which matches all the other &lt;code&gt;Microsoft.Scripting&lt;/code&gt; assemblies.&lt;/p&gt;  &lt;h4&gt;Feedback&lt;/h4&gt;  &lt;p&gt;As always, please report issues on the &lt;a href="http://ironpython.codeplex.com/WorkItem/Create" target="_blank"&gt;IronPython issue tracker&lt;/a&gt;. You can also try to fix any issues yourself and &lt;a href="http://ironpython.codeplex.com/SourceControl/UploadPatch.aspx" target="_blank"&gt;submit a patch&lt;/a&gt;. Lastly, you can actually talk to humans on the &lt;a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank"&gt;IronPython mailing list&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;Enjoy!&lt;/h4&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=wiBN5dlW-O8:IX-c75tX9dQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=wiBN5dlW-O8:IX-c75tX9dQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=wiBN5dlW-O8:IX-c75tX9dQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=wiBN5dlW-O8:IX-c75tX9dQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=wiBN5dlW-O8:IX-c75tX9dQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=wiBN5dlW-O8:IX-c75tX9dQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=wiBN5dlW-O8:IX-c75tX9dQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/wiBN5dlW-O8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/wiBN5dlW-O8/aspnet-dynamic-language-support-is-open.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><thr:total>5</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2010/07/aspnet-dynamic-language-support-is-open.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-6620032828290068077</guid><pubDate>Tue, 20 Jul 2010 03:05:00 +0000</pubDate><atom:updated>2010-07-19T20:07:01.769-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Open Source</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><category domain="http://www.blogger.com/atom/ns#">DLR</category><category domain="http://www.blogger.com/atom/ns#">Release</category><title>Summer of “Iron”: LINQ, Visual Studio tooling, and the Apache License</title><description>&lt;p&gt;New releases and announcements from the “Iron” projects have come out over the last couple days, so I wanted to give you an overview of what’s happening, point out the really cool parts, and reiterate some of the motivations.&lt;/p&gt;  &lt;p&gt;From a release perspective, both IronRuby and IronPython released new versions of the DLR-based .NET programming language implementations: &lt;a href="http://ironpython.codeplex.com/releases/view/42434" target="_blank"&gt;IronPython 2.7 Alpha&lt;/a&gt; and &lt;a href="http://ironruby.codeplex.com/releases/view/43540" target="_blank"&gt;IronRuby 1.1&lt;/a&gt;. Click on the respective release name for the full release notes and downloads, but I’ll summarize a bit here:&lt;/p&gt;  &lt;h4&gt;IronPython 2.7 Alpha&lt;/h4&gt;  &lt;p&gt;&lt;a href="http://ironpython.codeplex.com/releases/view/42434" target="_blank"&gt;Install IronPython 2.7 Alpha&lt;/a&gt; (includes &lt;a href="http://ironpython.net/tools/" target="_blank"&gt;Visual Studio tooling&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;This Alpha release is the first IronPython release working towards Python 2.7 compatibility, and contains a number of bug fixes and performance improvements. It also now &lt;strong&gt;requires&lt;/strong&gt; .NET 4.0 or Silverlight 4; you will need to &lt;a href="http://ironpython.codeplex.com/SourceControl/list/changesets" target="_blank"&gt;build from source&lt;/a&gt; for down-level frameworks. The installer now includes Visual Studio support for IronPython, rather than being a separate installer, and the source-code for the tools has been open-sourced! Keep reading for licensing information …&lt;/p&gt;  &lt;h4&gt;IronRuby 1.1&lt;/h4&gt;  &lt;p&gt;&lt;a href="http://ironruby.codeplex.com/releases/view/43540" target="_blank"&gt;Install IronRuby 1.1&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Aside from a bunch of bug-fixes, the latest release of IronRuby adds support for .NET extension methods, meaning that .NET programming patterns that are dependent on extension methods, like LINQ, the Reactive framework, Parallel.NET, etc, are now all usable from Ruby code. For example, here’s a simple LINQ example:&lt;/p&gt; &lt;script src="http://gist.github.com/482344.js?file=linq.rb"&gt;&lt;/script&gt;  &lt;p&gt;For more information see the &lt;a href="http://github.com/ironruby/ironruby/blob/master/Languages/Ruby/Samples/Linq/101samples.rb" target="_blank"&gt;101 LINQ samples ported to IronRuby&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Also, since I never &lt;a href="http://ironruby.codeplex.com/releases/view/25901" target="_blank"&gt;announced the IronRuby 1.0 release&lt;/a&gt; on my blog … consider this the announcement.&lt;/p&gt;  &lt;h4&gt;Apache License, Version 2&lt;/h4&gt;  &lt;p&gt;&lt;a href="http://ironruby.codeplex.com/license" target="_blank"&gt;IronRuby&lt;/a&gt;, &lt;a href="http://ironpython.codeplex.com/license" target="_blank"&gt;IronPython&lt;/a&gt;, and the &lt;a href="http://dlr.codeplex.com/license" target="_blank"&gt;DLR&lt;/a&gt; are now licensed under the &lt;a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank"&gt;Apache License, Version 2&lt;/a&gt;. To address all concerns around &lt;em&gt;“why”&lt;/em&gt; this is changing, it is &lt;strong&gt;solely&lt;/strong&gt; in reaction to feedback about the licensing terms from users and the .NET/Python/Ruby/dynamic-language communities at-large. The Apache License is a more familiar and popular license to those communities than the Microsoft Public License; using it should lower any license-related barriers people encountered in the past when considering these programming-language implementations.&lt;/p&gt;  &lt;h4&gt;Enjoy!&lt;/h4&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=EFKNS48TlbA:VKAYU-ZYMwg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=EFKNS48TlbA:VKAYU-ZYMwg:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=EFKNS48TlbA:VKAYU-ZYMwg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=EFKNS48TlbA:VKAYU-ZYMwg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=EFKNS48TlbA:VKAYU-ZYMwg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=EFKNS48TlbA:VKAYU-ZYMwg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=EFKNS48TlbA:VKAYU-ZYMwg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/EFKNS48TlbA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/EFKNS48TlbA/summer-of-iron-linq-visual-studio.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><thr:total>2</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2010/07/summer-of-iron-linq-visual-studio.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-6639078554962062655</guid><pubDate>Tue, 27 Apr 2010 10:19:00 +0000</pubDate><atom:updated>2010-07-19T03:19:59.237-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MIX10</category><category domain="http://www.blogger.com/atom/ns#">Testing</category><category domain="http://www.blogger.com/atom/ns#">Embedding</category><category domain="http://www.blogger.com/atom/ns#">Dynamic Languages</category><category domain="http://www.blogger.com/atom/ns#">talks</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><title>MIX10, Part 3 - Using dynamic languages in existing web-applications</title><description>&lt;div style="border-bottom: #666 5px solid; border-left: #666 5px solid; padding-bottom: 5px; background-color: #333; margin: 0px 0px 10px; padding-left: 5px; padding-right: 5px; color: white; border-top: #666 5px solid; border-right: #666 5px solid; padding-top: 5px"&gt;   &lt;p style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" class="section"&gt;&lt;em&gt;This post is part of the “MIX10 – Pumping Iron on the web” series:&lt;/em&gt;&lt;/p&gt;    &lt;ul style="padding-bottom: 0px; margin: 0px 0px 0px 20px; padding-left: 0px; padding-right: 0px; padding-top: 0px"&gt;     &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/03/mix10-ironruby-and-ironpython-part-1.html"&gt;Part 1 - Introduction&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-21-server-side-web.html"&gt;Part 2.1 – Server-side web development with dynamic languages&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-22-client-side-web.html"&gt;Part 2.2 – Client-side web development with dynamic languages&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;strong&gt;Part 3 - Using scripting in static applications &lt;/strong&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;Coming soon: &lt;/em&gt;Part 4 - Web-app extensibility with scripts &lt;/li&gt;   &lt;/ul&gt; &lt;/div&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The original post was mistakenly removed, so it’s been reposted with the original post date, 4/27/2010. Sorry if this confuses your blog readers or causes any other inconvenience.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Up until now I've discussed how to use dynamic languages to power both the server-side as well as the client-side of your web-application, but what if you want to apply these methods to solve certain problems in an existing application?&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;Testing&lt;/strong&gt;&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;A low-risk, high-benefit use of dynamic languages in your existing applications is for testing. This helps make the act of writing tests simpler, and quite possibly more fun, encouraging your team to actually maintain the test suite.&lt;/p&gt;  &lt;p&gt;Before looking at how to test web-apps, let's take a brief look at what a test written with &lt;a href="http://rspec.info/" target="_blank"&gt;RSpec&lt;/a&gt;, a popular Ruby testing framework, looks like:&lt;/p&gt; &lt;script src="http://gist.github.com/481156.js?file=rspec.rb"&gt;&lt;/script&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: there are Ruby testing frameworks that look a bit more like what you might be used to. The following is an equivalent test written with test/unit, and this will give you a better idea of the structure of the above example:&lt;/p&gt;   &lt;script src="http://gist.github.com/481156.js?file=testunit.rb"&gt;&lt;/script&gt;&lt;/blockquote&gt;  &lt;p&gt;The RSpec snippet almost reads like english, making it very clear what the intended behavior of Stack is. Also, it shows the power of Ruby for creating internal DSLs; a &amp;quot;language&amp;quot; built out of the constructs of an existing language. &lt;code&gt;describe&lt;/code&gt; and &lt;code&gt;it&lt;/code&gt; look like language keywords, but in-fact they are really just methods, because Ruby has optional parameters (&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-21-server-side-web.html" target="_blank"&gt;as we discovered earlier with Sinatra&lt;/a&gt;). Using actual strings as the test name, rather than a method name, allows you to describe the test accurately. Each object has a &lt;code&gt;should&lt;/code&gt; method which makes any subsequent calls part of an assertion, making it very obvious which value is the &amp;quot;expected&amp;quot; value and which is the &amp;quot;actual&amp;quot;.&lt;/p&gt;  &lt;p&gt;The crazy thing is how little code is required to make that work; &lt;strong&gt;&lt;font color="#ff8000"&gt;24 lines of Ruby&lt;/font&gt;&lt;/strong&gt;. The key points are that &lt;code&gt;yield&lt;/code&gt; executes the &lt;code&gt;do-end&lt;/code&gt; block passed to a method, and the &lt;code&gt;should&lt;/code&gt; method is added to every object, turning any subsequent methods calls into an assertion:&lt;/p&gt; &lt;script src="http://gist.github.com/481156.js?file=test-spec.rb"&gt;&lt;/script&gt;  &lt;p&gt;However, please don't use this example as your real testing framework, and then get mad at me when it doesn't have a feature you want; &lt;a href="http://rspec.info/" target="_blank"&gt;RSpec&lt;/a&gt;, &lt;a href="http://github.com/chneukirchen/bacon" target="_blank"&gt;Bacon&lt;/a&gt;, or &lt;a href="http://test-spec.rubyforge.org" target="_blank"&gt;test/spec&lt;/a&gt; are much more mature testing frameworks that support this same syntax.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/03/testing-c-silverlight-apps-with.html" target="_blank"&gt;See my previous post about using IronRuby to test C# Silverlight applications&lt;/a&gt;; it’s still relevant though it’s a fairly old post.&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Hosting&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;IronRuby and IronPython are built on-top of the &lt;a href="http://dlr.codeplex.com" target="_blank"&gt;Dynamic Language Runtime&lt;/a&gt;, which is comprised of many parts, one of which being a &lt;strong&gt;&lt;a href="http://dlr.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=127516" target="_blank"&gt;.NET Hosting API&lt;/a&gt;&lt;/strong&gt;, allowing you to embed a scripting language in any .NET app.&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;Now we come to the &amp;quot;ah-ha!&amp;quot; moment of the talk&lt;/strong&gt;&lt;/font&gt;; &lt;strong&gt;everything&lt;/strong&gt; you've seen in the &lt;a href="http://blog.jimmy.schementi.com/search/label/MIX10" target="_blank"&gt;MIX10 posts&lt;/a&gt; is made possible by this API. Keep in mind these languages are built &lt;em&gt;on&lt;/em&gt; .NET, so their implementations are accessible from any .NET language. C# and VB today are not built on .NET; they just compile programs to run on .NET, which is why you can't easily host those languages today.&lt;/p&gt;  &lt;p&gt;Here's the catch; since these language engines are built on .NET, they need to run &lt;em&gt;in&lt;/em&gt; a .NET application. So, &lt;strong&gt;all&lt;/strong&gt; Ruby or Python code runs by hosting the languages inside a .NET application. We do things to make this seamless in specific environments: for example, &lt;tt&gt;ir.exe&lt;/tt&gt; and &lt;tt&gt;ipy.exe&lt;/tt&gt; are both .NET programs which host the language and run the code in a command-line, mimicking the behavior of ruby.exe and python.exe. Here are some other popular hosts:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;tt&gt;ipyw.exe&lt;/tt&gt;: runs scripts in a console-less program for Windows applications &lt;/li&gt;    &lt;li&gt;&lt;tt&gt;Microsoft.Scripting.Silverlight.dll&lt;/tt&gt;: entry-point for Silverlight applications which run HTML script tags and scripts inside the XAP &lt;/li&gt;    &lt;li&gt;&lt;tt&gt;IronRuby.Rack.dll&lt;/tt&gt;: run rack-based applications on IIS &lt;/li&gt;    &lt;li&gt;&lt;tt&gt;Microsoft.Web.Scripting.dll&lt;/tt&gt;: run Python in ASP.NET &lt;/li&gt;    &lt;li&gt;&lt;tt&gt;System.Web.Mvc.IronRuby&lt;/tt&gt;: run Ruby in ASP.NET MVC &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;However, we can't provide &amp;quot;runners&amp;quot; for every environment that will spring up, so we allow you to use the same APIs that these runners use in your own apps. These APIs have been kept very simple, as we want any .NET developer to be able to use a DLR scripting language in their applications.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;But why embed a scripting language into your application?&lt;/font&gt;&lt;/strong&gt; The main scenario is to scripts as an extensibility mechanism, either internally or as functionality you provide for your end-users. Here are a few concrete examples of what scripts could be used for:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;An advanced search/filter (letting users use LINQ safely) &lt;/li&gt;    &lt;li&gt;High-level business logic to computing prices of items, applying discounts, etc; any type of rules engine &lt;/li&gt;    &lt;li&gt;A system which changes behavior based on external data &lt;/li&gt;    &lt;li&gt;Customizing a single codebase for different clients &lt;/li&gt;    &lt;li&gt;Add-ons for end-users to make your application better (eg. Facebook) &lt;/li&gt;    &lt;li&gt;Making application logic simpler to read than the core of your system (polyglot) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Let's show you how to do the basics, and hopefully that will spark your imagine to think up other cool use-cases:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Create a new web application project in Visual Studio 2010, and open the Default.aspx.cs page. &lt;/li&gt;    &lt;li&gt;Place a label on the page and call it “Message”. &lt;/li&gt;    &lt;li&gt;Add references to the necessary DLLs to host IronPython (IronPython.dll and Microsoft.Scripting.dll) &lt;/li&gt;    &lt;li&gt;Write the 5 lines of code to update the label’s text from Python: &lt;/li&gt; &lt;/ol&gt; &lt;script src="http://gist.github.com/481156.js?file=hosting.cs"&gt;&lt;/script&gt;  &lt;p&gt;There are basically three types you need to know; &lt;code&gt;ScriptRuntime&lt;/code&gt;, &lt;code&gt;ScriptEngine&lt;/code&gt;, and &lt;code&gt;ScriptScope&lt;/code&gt;.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;p&gt;&lt;code&gt;ScriptRuntime&lt;/code&gt; is a level of encapsulation for your scripts; it represents the DLR scripting runtime, and all script operations go through it.&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;&lt;code&gt;ScriptEngine&lt;/code&gt; is the type that is returned from &lt;code&gt;ScriptRuntime.GetEngine&lt;/code&gt;; it represents a DLR-language. In this case, we asked for the language by name, as that's the easiest way to keep it easily configurable, but the downside is you need language configuration info in your &lt;code&gt;App.config&lt;/code&gt;. However, if you only want to depend on IronPython, you can use &lt;code&gt;IronPython.Hosting.Python.CreateEngine()&lt;/code&gt;, which does all the setup for Python for you.&lt;/p&gt;      &lt;p&gt;The &lt;code&gt;ScriptEngine&lt;/code&gt; enabled you to execute code in that language, in a variety of ways, from the basic &lt;code&gt;engine.Execute&lt;/code&gt; method (essentally &lt;code&gt;eval&lt;/code&gt;), or being more fine-grained &lt;code&gt;engine.CreateScriptSourceFromString(code).Compile().Execute()&lt;/code&gt;, which parses the file, compiles it, and then executes it. Code can be executed against a &lt;code&gt;ScriptScope&lt;/code&gt; to set initial state and share state between executions.&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;&lt;code&gt;ScriptScope&lt;/code&gt; defines the state for your script; like what variables/methods are present. It is a dynamic object, so you can do things like &lt;code&gt;scope.page = this&lt;/code&gt;, and that will set the &lt;code&gt;page&lt;/code&gt; variable for scripts that execute against the scope. In downlevel .NET frameworks, you'd have to use &lt;code&gt;scope.SetVariable(page, this)&lt;/code&gt;.&lt;/p&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;em&gt;Slight aside&lt;/em&gt;: since these APIs are .NET based, the dynamic languages themselves can consume them to run other dynamic languages! For example, here's Ruby executing Python code through the &lt;a href="http://dlr.codeplex.com" target="_blank"&gt;DLR&lt;/a&gt; Hosting APIs:&lt;/p&gt; &lt;script src="http://gist.github.com/481156.js?file=ruby-host-python.rb"&gt;&lt;/script&gt;  &lt;p&gt;What's also interesting is the dynamic languages can communicate between &lt;strong&gt;each-other&lt;/strong&gt; just as easily; here's Ruby calling Python code:&lt;/p&gt; &lt;script src="http://gist.github.com/481156.js?file=foo.py"&gt;&lt;/script&gt;&lt;script src="http://gist.github.com/481156.js?file=bar.rb"&gt;&lt;/script&gt;  &lt;p&gt;Anyway, hopefully this sparks some creativity! For more web-related information, also posted about this in relation to Silverlight applications: &lt;a href="http://blog.jimmy.schementi.com/2009/03/scripting-c-silverlight-apps-with.html" target="_blank"&gt;Scripting C# apps with IronPython&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The next post will show some cool applications of this … (&lt;em&gt;coming soon&lt;/em&gt;).&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=h35BkuCaQlk:wZhhMZ9OlOg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=h35BkuCaQlk:wZhhMZ9OlOg:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=h35BkuCaQlk:wZhhMZ9OlOg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=h35BkuCaQlk:wZhhMZ9OlOg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=h35BkuCaQlk:wZhhMZ9OlOg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=h35BkuCaQlk:wZhhMZ9OlOg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=h35BkuCaQlk:wZhhMZ9OlOg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/h35BkuCaQlk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/h35BkuCaQlk/mix10-part-3-using-dynamic-languages-in.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><thr:total>3</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2010/04/mix10-part-3-using-dynamic-languages-in.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-1733561290171250885</guid><pubDate>Mon, 26 Apr 2010 10:18:00 +0000</pubDate><atom:updated>2010-07-19T03:19:07.813-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MIX10</category><category domain="http://www.blogger.com/atom/ns#">Dynamic Languages</category><category domain="http://www.blogger.com/atom/ns#">talks</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><title>MIX10, Part 2.2 – Client-side web-development with dynamic languages</title><description>&lt;div style="border-bottom: #666 5px solid; border-left: #666 5px solid; padding-bottom: 5px; background-color: #333; margin: 0px 0px 10px; padding-left: 5px; padding-right: 5px; color: white; border-top: #666 5px solid; border-right: #666 5px solid; padding-top: 5px"&gt;   &lt;p style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" class="section"&gt;&lt;em&gt;This post is part of the “MIX10 – Pumping Iron on the web” series:&lt;/em&gt;&lt;/p&gt;    &lt;ul style="padding-bottom: 0px; margin: 0px 0px 0px 20px; padding-left: 0px; padding-right: 0px; padding-top: 0px"&gt;     &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/03/mix10-ironruby-and-ironpython-part-1.html"&gt;Part 1 - Introduction&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-21-server-side-web.html"&gt;Part 2.1 – Server-side web development with dynamic languages&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;strong&gt;Part 2.2 – Client-side web development with dynamic languages&lt;/strong&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-3-using-dynamic-languages-in.html"&gt;Part 3 - Using scripting in static applications&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;em&gt;Coming soon: &lt;/em&gt;Part 4 - Web-app extensibility with scripts &lt;/li&gt;   &lt;/ul&gt; &lt;/div&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The original post was mistakenly removed, so it’s been reposted with the original post date, 4/26/2010. Sorry if this confuses your blog readers or causes any other inconvenience.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; and &lt;a href="http://ironpython.net" target="_blank"&gt;IronPython&lt;/a&gt; are fully-supported in the browser, thanks to &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt;. In-fact, they are hands-down the simplest way to develop a Silverlight application. This is not only because of how expressive the programming languages are; the integration with Silverlight doesn't fight how the web works.&lt;/p&gt;  &lt;p&gt;For example, here's an entire Silverlight app which just writes a message into the HTML page, written in Python:&lt;/p&gt; &lt;script src="http://gist.github.com/318169.js?file=helloworld.html"&gt;&lt;/script&gt;  &lt;p&gt;DLR-based Silverlight applications let you write HTML script-tags in other languages than JavaScript, but in a way that works cross-browser and cross-platform; the languages work in &lt;a href="http://www.go-mono.com/moonlight/" target="_blank"&gt;Moonlight&lt;/a&gt; on Linux as well.&lt;/p&gt;  &lt;p&gt;Both inline and script-src tags are supported, so your scripts can be separated from the HTML file:&lt;/p&gt; &lt;script src="http://gist.github.com/481156.js?file=scripttag_ruby.html"&gt;&lt;/script&gt;  &lt;p&gt;This integration makes writing Silverlight applications just as easy as they were in Silverlight 1, but with the power of .NET and Ruby or Python. &lt;a href="http://dlr.codeplex.com" target="_blank"&gt;DLR&lt;/a&gt;-based applications also support a XAP model for anyone familiar with how static Silverlight applications work, so you get to choose which way you prefer to write your applications.&lt;/p&gt;  &lt;p&gt;All the specific examples used in this section of the talk were taken from these posts:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/03/pycon-2010-python-in-browser.html" target="_blank"&gt;Python in the browser&lt;/a&gt;: my blog post from PyCon 2010 about IronPython in Silverlight &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.rubyinside.com/ironruby-silverlight-ruby-in-browser-3192.html" target="_blank"&gt;Ruby in the browser&lt;/a&gt;: my article in &lt;a href="http://rubyinside.com" target="_blank"&gt;RubyInside&lt;/a&gt; about IronRuby in Silverlight &lt;/li&gt;    &lt;li&gt;&lt;a href="http://silverlight.net/dlr" target="_blank"&gt;Silverlight.net / d&lt;/a&gt;&lt;a href="http://silverlight.net/dlr" target="_blank"&gt;ynamic languages&lt;/a&gt;&lt;/a&gt;: tons of info on getting started with Python, Ruby, and the DLR in Silverlight. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font size="2"&gt;Next up, &lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-3-using-dynamic-languages-in.html"&gt;using dynamic languages in your existing web-applications&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=uc3qw2HXutA:qjFoByKBdUk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=uc3qw2HXutA:qjFoByKBdUk:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=uc3qw2HXutA:qjFoByKBdUk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=uc3qw2HXutA:qjFoByKBdUk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=uc3qw2HXutA:qjFoByKBdUk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=uc3qw2HXutA:qjFoByKBdUk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=uc3qw2HXutA:qjFoByKBdUk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/uc3qw2HXutA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/uc3qw2HXutA/mix10-part-22-client-side-web.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><thr:total>1</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2010/04/mix10-part-22-client-side-web.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-1793234947390378380</guid><pubDate>Mon, 26 Apr 2010 06:35:00 +0000</pubDate><atom:updated>2010-07-19T03:12:38.417-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MIX10</category><category domain="http://www.blogger.com/atom/ns#">IIS</category><category domain="http://www.blogger.com/atom/ns#">Open Source</category><category domain="http://www.blogger.com/atom/ns#">Dynamic Languages</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">talks</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><category domain="http://www.blogger.com/atom/ns#">HAML</category><title>MIX10, Part 2.1 – Server-side web development with dynamic languages</title><description>&lt;div style="border-bottom: #666 5px solid; border-left: #666 5px solid; padding-bottom: 5px; background-color: #333; margin: 0px 0px 10px; padding-left: 5px; padding-right: 5px; color: white; border-top: #666 5px solid; border-right: #666 5px solid; padding-top: 5px"&gt;   &lt;p style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" class="section"&gt;&lt;em&gt;This post is part of the “MIX10 – Pumping Iron on the web” series:&lt;/em&gt;&lt;/p&gt;    &lt;ul style="padding-bottom: 0px; margin: 0px 0px 0px 20px; padding-left: 0px; padding-right: 0px; padding-top: 0px"&gt;     &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/03/mix10-ironruby-and-ironpython-part-1.html"&gt;Part 1 - Introduction&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;strong&gt;Part 2.1 – Server-side web development with dynamic languages &lt;/strong&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-22-client-side-web.html"&gt;Part 2.2 – Client-side web development with dynamic languages&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-3-using-dynamic-languages-in.html"&gt;Part 3 - Using scripting in static applications&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;Coming soon: &lt;/em&gt;Part 4 - Web-app extensibility with scripts &lt;/li&gt;   &lt;/ul&gt; &lt;/div&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The original post was mistakenly removed, so it’s been reposted with the original post date, 4/25/2010. Sorry if this confuses your blog readers or causes any other inconvenience.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;One reason for embracing dynamic languages is to make your entire web-development experience simpler, be it on &lt;a href="http://asp.net" target="_blank"&gt;ASP.NET&lt;/a&gt; enabled web-servers, or on the client through &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt;. Let's first look at the server.&lt;/p&gt;  &lt;p&gt;Both &lt;a href="http://ironpython.net" target="_blank"&gt;IronPython&lt;/a&gt; and &lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; can run on the same infrastructure as your ASP.NET applications, though in their own ways. Due to historic reasons, IronPython is supported as an ASP.NET language through the &lt;a href="http://aspnet.codeplex.com/wikipage?title=Dynamic%20Language%20Support&amp;amp;referringTitle=Home" target="_blank"&gt;ASP.NET Dynamic Language integration&lt;/a&gt;, and IronRuby is supported through &lt;a href="http://www.ruby-forum.com/topic/212515" target="_blank"&gt;IronRuby.Rack&lt;/a&gt;, which enables &lt;a href="http://rack.rubyforge.org/" target="_blank"&gt;Rack&lt;/a&gt;-based Ruby web-applications to run on ASP.NET. However, both are open-source, so each one could be ported to the other language.&lt;/p&gt;  &lt;p&gt;Since these &lt;a href="http://dlr.codeplex.com" target="_blank"&gt;DLR&lt;/a&gt;-based languages run on ASP.NET, deploying them is no different than any other ASP.NET application; they can be run on any ASP.NET enabled web-server like &lt;a href="http://www.iis.net/" target="_blank"&gt;IIS&lt;/a&gt;. Keeping that in mind, let’s first look at how simple Ruby web apps can be.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;Minimal Ruby web-applications&lt;/strong&gt;&lt;/font&gt;&lt;/h4&gt;  &lt;h5&gt;&lt;a href="http://www.sinatrarb.com/" target="_blank"&gt;&lt;img style="display: inline" title="Slide34" alt="Slide34" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/TEQIcG9AmwI/AAAAAAAAAWg/m07YG790GLk/Slide345.jpg?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/h5&gt;  &lt;p&gt;Ruby itself has very expressive syntax, and the Ruby community has built many web-frameworks to make web-development really simple. For example, Sinatra is a web-framework made to minimize the amount of code required to respond to web requests:&lt;/p&gt; &lt;script src="http://gist.github.com/481096.js?file=helloworld-simple.rb"&gt;&lt;/script&gt;  &lt;p&gt;The above code does exactly what it says; when a get request happens for &lt;code&gt;'/'&lt;/code&gt;, show &amp;quot;Hello, World&amp;quot; on the page. This highlights Ruby's domain-specific language abilities; &lt;code&gt;get&lt;/code&gt; looks like a keyword, though it's really just a method call with &lt;code&gt;'/'&lt;/code&gt; as the first argument (Ruby lets you omit parenthesis from method calls too ... any VB script fans out there?). The &lt;code&gt;do-end&lt;/code&gt; block is syntactic sugar for passing a lambda as the last-argument to the &lt;code&gt;get&lt;/code&gt; method; all Ruby methods take an arbitrary &amp;quot;block&amp;quot; of code between &lt;code&gt;do&lt;/code&gt;-&lt;code&gt;end&lt;/code&gt; or &lt;code&gt;{}&lt;/code&gt;. Inside that block is what happens on each request, and whatever is returned is written to the response (&lt;code&gt;&amp;quot;Hello, World&amp;quot;&lt;/code&gt;); the last statement of any expression (blocks, methods, if-statements, etc) is implicitly the return value of the statement.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;For all those C# fans, you can use curly-braces too:&lt;/p&gt;   &lt;script src="http://gist.github.com/481096.js?file=helloworld-curly.rb"&gt;&lt;/script&gt;&lt;/blockquote&gt;  &lt;p&gt;Though these features sound arbitrary by themselves, if I were to write this with only the more-familiar language features found in Ruby, it would lose its character:&lt;/p&gt; &lt;script src="http://gist.github.com/481096.js?file=helloworld-verbose.rb"&gt;&lt;/script&gt;  &lt;p&gt;This defines a Ruby method &lt;code&gt;verbose&lt;/code&gt;, which explicitly returns the string &amp;quot;Hello, World&amp;quot;, and then calls the get method directly with the first argument being the URL and the second argument being an explicit pointer to the &lt;code&gt;verbose&lt;/code&gt; method. Why does this look so much uglier? While this might be closer to how the programming language actually runs the initial examples, it's not how the programmer thinks.&lt;/p&gt;  &lt;p&gt;Not to leave Python out of this love-fest, Python can make this look very pretty as well, but in her own special way. Imagining that a Sinatra-like library exists for Python:&lt;/p&gt; &lt;script src="http://gist.github.com/481096.js?file=helloworld.py"&gt;&lt;/script&gt;  &lt;p&gt;Here the &lt;code&gt;index&lt;/code&gt; method is created, which explicitly accepts both the request and the response as arguments; Python's all about being explicit, while Ruby is very implicit. Then the method would be &amp;quot;decorated&amp;quot; with the &lt;code&gt;sinatra.get&lt;/code&gt; decorator, which would tell the web-framework that &lt;code&gt;index&lt;/code&gt; represents a get-request for &amp;quot;/&amp;quot;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;h5&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;What's a decorator?&lt;/strong&gt;&lt;/font&gt;&lt;/h5&gt;    &lt;p&gt;A &lt;a href="http://www.python.org/dev/peps/pep-0318/" target="_blank"&gt;Python decorator&lt;/a&gt; is basically a function that accepts a function and returns a function, so this imaginary Sinatra-like framework would define &lt;code&gt;get&lt;/code&gt; something like this:&lt;/p&gt;   &lt;script src="http://gist.github.com/481096.js?file=sinatra.get.py"&gt;&lt;/script&gt;    &lt;p&gt;Another way of looking at it is without the decorator syntax:&lt;/p&gt;   &lt;script src="http://gist.github.com/481096.js?file=helloworld-verbose.py"&gt;&lt;/script&gt;    &lt;p&gt;It’s a bit more readable than Ruby, and almost equivalent to the decorator way, except for the order of &lt;code&gt;get&lt;/code&gt; in the code. You'll also see that getting a method pointer is much cleaner than Ruby (&lt;code&gt;index&lt;/code&gt; vs. &lt;code&gt;method(:index)&lt;/code&gt;); in Ruby &lt;code&gt;index&lt;/code&gt; would call the method, since Ruby allows method calls with or without parenthesis, where Python uses parenthesis to indicate a method call.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Point being is that both Ruby and Python are very expressive in their own ways, and makes it really easy to make simple websites on Windows. The IronRuby team takes of advantage of this to power &lt;a href="http://ironruby.info" target="_blank"&gt;http://ironruby.info&lt;/a&gt;, a Ruby-compatibility reporting website. This is the code from the &lt;a href="http://github.com/jschementi/ironruby-stats/blob/master/app.rb#L83" target="_blank"&gt;main page&lt;/a&gt;:&lt;/p&gt; &lt;script src="http://gist.github.com/481096.js?file=sinatra-haml.rb"&gt;&lt;/script&gt;  &lt;p&gt;This renders the &lt;a href="http://github.com/jschementi/ironruby-stats/blob/master/views/index.haml" target="_blank"&gt;index.haml&lt;/a&gt; template with the data returned from &lt;code&gt;Stats.get_latest&lt;/code&gt;, which is pretty much what the code says. The HTML is generated from the &lt;a href="http://haml-lang.com/" target="_blank"&gt;haml templating engine&lt;/a&gt;, which makes generating HTML and calling Ruby code extremely easy:&lt;/p&gt; &lt;script src="http://gist.github.com/481096.js?file=index.haml"&gt;&lt;/script&gt;  &lt;p&gt;To play around with using HAML, you can use &lt;a href="http://github.com/jschementi/orphanage/tree/master/aspnet-haml/" target="_blank"&gt;aspnet-haml&lt;/a&gt; to support .haml files though ASP.NET.&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Ruby on Rails - Databases with Ruby&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;&lt;a href="http://rubyonrails.org" target="_blank"&gt;&lt;img style="display: inline" title="Slide45" alt="Slide45" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/TEQIcsQcBUI/AAAAAAAAAWk/HjDOc25xSdU/Slide45%5B6%5D.jpg?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;One of the most popular (or most buzzed) web-frameworks is &lt;a href="http://rubyonrails.org/" target="_blank"&gt;Ruby on Rails&lt;/a&gt;, which is just a collection of Ruby libraries for structuring your web-application. Rails uses the &lt;a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller" target="_blank"&gt;Model-View-Controller pattern&lt;/a&gt;, so any &lt;a href="http://www.asp.net/mvc" target="_blank"&gt;ASP.NET MVC&lt;/a&gt; people will find it a very-familiar framework. However, Rails really shines when it comes to interacting with the database through it's ActiveRecord library (the “Model” layer). ActiveRecord maps Ruby classes to database tables, and provides an Ruby abstraction for interacting with the database:&lt;/p&gt; &lt;script src="http://gist.github.com/481096.js?file=rails-example.rb"&gt;&lt;/script&gt;  &lt;p&gt;This is all the code that is required to map your Ruby classes to the database, as well as create the structure of the database. ActiveRecord dynamically provides getters/setters for the table, as well as sets up foreign-keys and relationships based on conventions (belongs_to :posts assumes that the table has a 'post_id' field).&lt;/p&gt;  &lt;p&gt;Interacting with the database is just as easy as calling methods; &lt;code&gt;Post.all&lt;/code&gt; translates to the &lt;code&gt;SELECT * from posts&lt;/code&gt; SQL query, since the &lt;code&gt;Post&lt;/code&gt; object is mapped to the &lt;code&gt;posts&lt;/code&gt; database table. &lt;code&gt;Post.find(&amp;lt;id&amp;gt;)&lt;/code&gt; does a &lt;code&gt;SELECT * from posts where id=&amp;lt;id&amp;gt;&lt;/code&gt;, etc.&lt;/p&gt;  &lt;p&gt;Because Rails uses the &lt;a href="http://rack.rubyforge.org/" target="_blank"&gt;Rack web-server interface&lt;/a&gt;, it will also run on IIS using &lt;a href="http://www.ruby-forum.com/topic/212515" target="_blank"&gt;IronRuby.Rack&lt;/a&gt;. See &lt;a href="http://ironruby.net/documentation/rails" target="_blank"&gt;the IronRuby Rails documentation&lt;/a&gt; for more info about using Rails on IronRuby, and the &lt;a href="http://api.rubyonrails.org" target="_blank"&gt;Ruby on Rails documentation&lt;/a&gt; for general Rails usage.&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;ASP.NET MVC and IronRuby&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;Those were all Ruby-based web-frameworks, but what about using ASP.NET directly? The IronRuby community has developed an &lt;a href="http://github.com/casualjim/ironrubymvc" target="_blank"&gt;integration with ASP.NET MVC&lt;/a&gt;, so you can write your controllers and views in Ruby. Special thanks to &lt;a href="http://flanders.co.nz/" target="_blank"&gt;Ivan Porto Carrero&lt;/a&gt; for single-handedly maintaining it.&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;ASP.NET and IronPython&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;Again, to give Python some love, &lt;a href="http://aspnet.codeplex.com/wikipage?title=Dynamic%20Language%20Support" target="_blank"&gt;IronPython directly integrates with ASP.NET&lt;/a&gt;, letting you write your ASPX code-behind files in Python.&lt;/p&gt; &lt;script src="http://gist.github.com/481133.js?file=hello-webforms.aspx"&gt;&lt;/script&gt;&lt;script src="http://gist.github.com/481133.js?file=hello-webforms.aspx.py"&gt;&lt;/script&gt;  &lt;p&gt;Because of ASP.NET's events-based API (rather than a response-based API like Sinatra/Rails), Python methods can automatically hook events by using the &amp;lt;object&amp;gt;_&amp;lt;event-name&amp;gt; convention, and all server-side controls with &amp;quot;ID&amp;quot;s ends up being a variable available to the Python module. And application-level event hooks can go in global.py. But it's really nice to write Language=&amp;quot;IronPython&amp;quot; at the top. =)&lt;/p&gt;  &lt;p&gt;Python code can can also interact with the controls:&lt;/p&gt; &lt;script src="http://gist.github.com/481133.js?file=python-controls.aspx"&gt;&lt;/script&gt;  &lt;p&gt;The &amp;lt;%# %&amp;gt; syntax lets run Python code in the context of the ASP.NET control's data source. The repeater's data-source was set to a list of IMAGETAGS (a python class), which has all those fields on it.&lt;/p&gt;  &lt;p&gt;In conclusion, on the server you have many options for using IronRuby and IronPython to simplify your solutions.&lt;/p&gt;  &lt;p&gt;Next up, &lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-22-client-side-web.html"&gt;using dynamic languages on the client through Silverlight&lt;/a&gt;.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=w3uG0ZIWz6Q:QJ8EYxw7jic:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=w3uG0ZIWz6Q:QJ8EYxw7jic:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=w3uG0ZIWz6Q:QJ8EYxw7jic:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=w3uG0ZIWz6Q:QJ8EYxw7jic:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=w3uG0ZIWz6Q:QJ8EYxw7jic:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=w3uG0ZIWz6Q:QJ8EYxw7jic:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=w3uG0ZIWz6Q:QJ8EYxw7jic:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/w3uG0ZIWz6Q" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/w3uG0ZIWz6Q/mix10-part-21-server-side-web.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_OqCZhp9yI0Q/TEQIcG9AmwI/AAAAAAAAAWg/m07YG790GLk/s72-c/Slide345.jpg?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2010/04/mix10-part-21-server-side-web.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-5170431777114379598</guid><pubDate>Sat, 24 Apr 2010 07:10:00 +0000</pubDate><atom:updated>2010-07-19T03:11:16.184-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MIX10</category><category domain="http://www.blogger.com/atom/ns#">Open Source</category><category domain="http://www.blogger.com/atom/ns#">Dynamic Languages</category><category domain="http://www.blogger.com/atom/ns#">talks</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><category domain="http://www.blogger.com/atom/ns#">Microsoft</category><title>MIX10, Part 1 – IronRuby, IronPython, and the web</title><description>&lt;div style="border-bottom: #666 5px solid; border-left: #666 5px solid; padding-bottom: 5px; background-color: #333; margin: 0px 0px 10px; padding-left: 5px; padding-right: 5px; color: white; border-top: #666 5px solid; border-right: #666 5px solid; padding-top: 5px"&gt;   &lt;p style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px" class="section"&gt;&lt;em&gt;This post is part of the “MIX10 – Pumping Iron on the web” series:&lt;/em&gt;&lt;/p&gt;    &lt;ul style="padding-bottom: 0px; margin: 0px 0px 0px 20px; padding-left: 0px; padding-right: 0px; padding-top: 0px"&gt;     &lt;li&gt;&lt;strong&gt;Part 1 - Introduction&lt;/strong&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-21-server-side-web.html"&gt;Part 2.1 – Server-side web development with dynamic languages&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-22-client-side-web.html"&gt;Part 2.2 – Client-side web development with dynamic languages&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-3-using-dynamic-languages-in.html"&gt;Part 3 - Using scripting in static applications&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;em&gt;Coming soon: &lt;/em&gt;Part 4 - Web-app extensibility with scripts &lt;/li&gt;   &lt;/ul&gt; &lt;/div&gt;  &lt;blockquote&gt;&lt;em&gt;The original post was mistakenly removed, so it’s been reposted with the original post date, 4/24/2010. Sorry if this confuses your blog readers or causes any other inconvenience.&lt;/em&gt;&lt;/blockquote&gt;  &lt;p class="section"&gt;This past week I had the pleasure of attending and speaking at &lt;a href="http://live.visitmix.com" target="_blank"&gt;MIX10&lt;/a&gt; in Las Vegas about using &lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; and &lt;a href="http://ironpython.net" target="_blank"&gt;IronPython&lt;/a&gt; on the web. If you’re a TV-person instead of a reading-person, here’s a video of the talk:&lt;/p&gt;  &lt;p class="section"&gt;&lt;a href="http://live.visitmix.com/MIX10/Sessions/FT09" target="_blank"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/S6qrVHtweUI/AAAAAAAAAUg/RVL6vjAsKWM/image5.png?imgmax=800" width="400" height="225" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p class="section"&gt;As I usually do, this series of posts will be a write-up of my talk … but first …&lt;/p&gt;  &lt;blockquote class="section"&gt;   &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;&lt;a href="http://lh3.ggpht.com/_OqCZhp9yI0Q/S6qrVURfhdI/AAAAAAAAAU8/anhVG5dFE8g/s1600-h/Slide10%5B1%5D.jpg" target="_blank"&gt;&lt;img style="display: inline" title="Slide10" alt="Slide10" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/S6qrWbaTf7I/AAAAAAAAAVE/Iv14jTJoBL0/Slide10_thumb.jpg?imgmax=800" width="360" height="270" /&gt;&lt;/a&gt; &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;iron?&lt;/font&gt; - &lt;/strong&gt;Jim Hugunin and John Lam have both been quoted as saying &amp;quot;Iron&amp;quot; stands for different acronyms; &amp;quot;Implementation running on .NET&amp;quot; and &amp;quot;It runs on .NET&amp;quot;, respectively. I’m going to put my foot down and officially side with Jim, though really they are bacronyms; neither is actually the original meaning. A &lt;a class="reference external" href="http://stackoverflow.com/questions/1194309/why-are-many-ports-of-languages-to-net-prefixed-with-iron"&gt;StackOverflow&lt;/a&gt; post explains more, and I hope that puts the wondering to rest.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p class="section"&gt;This talk is all about the why and how of &lt;font color="#ff8000"&gt;&lt;strong&gt;embrace dynamic languages on Microsoft's web platform&lt;/strong&gt;&lt;/font&gt; - be it on the web-server (IIS) or in the web-browser (Silverlight), and even in existing applications. To start out with, here’s my rational for why we as a developer community should care:&lt;/p&gt;  &lt;p class="section"&gt;It’s no secret that &lt;strong&gt;&lt;font color="#ff8000"&gt;developers like things to be simple&lt;/font&gt;&lt;/strong&gt;, and the web is pretty simple as far as application models go. While the web’s feature-set is pretty attractive itself (server-client oriented, instant client deployment, and cross-platform clients to name a few), the equally attractive development experience (simple UI mark-up system and a scripting language) still make it easy for people to build amazing websites.&lt;/p&gt;  &lt;p class="section"&gt;&lt;a href="http://lh4.ggpht.com/_OqCZhp9yI0Q/S6qrWn3XQ_I/AAAAAAAAAVM/quIxKntxHBk/s1600-h/Slide13%5B1%5D.jpg" target="_blank"&gt;&lt;img style="display: inline" title="Slide13" alt="Slide13" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/S6qrXpJmfOI/AAAAAAAAAVQ/IzeXCfL87tc/Slide13_thumb.jpg?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p class="section"&gt;Though the application model is simple, &lt;font color="#ff8000"&gt;&lt;strong&gt;developers continue to evolve it&lt;/strong&gt;&lt;/font&gt;; server and client frameworks are vital tools that make the web-development experience even more productive – it’s very rare that a website has no server side or client side dependencies.&lt;/p&gt;  &lt;p class="section"&gt;&lt;a href="http://lh4.ggpht.com/_OqCZhp9yI0Q/S6qrYKz9pvI/AAAAAAAAAVY/pzdJZgxmIAU/s1600-h/Slide18%5B1%5D.jpg" target="_blank"&gt;&lt;img style="display: inline" title="Slide18" alt="Slide18" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/S6qrYi1OSMI/AAAAAAAAAVg/gIK3pQR9eXI/Slide18_thumb.jpg?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p class="section"&gt;These frameworks provide such innovative features because they stand on the shoulders of powerful and expressive dynamic/scripting languages, giving the frameworks the unique ability to model the &amp;quot;web&amp;quot; as they see fit.&lt;/p&gt;  &lt;p class="section"&gt;While each web-framework is powerful in its own right, the power really comes from the &lt;font color="#ff8000"&gt;&lt;strong&gt;choice to use whatever tools help get things done&lt;/strong&gt;&lt;/font&gt;. Developers and designers for .NET have the same need to get things done, and if &lt;font color="#ff8000"&gt;&lt;strong&gt;getting things done is essentially the result of programming language choice&lt;/strong&gt;&lt;/font&gt;, what choices are there? Really only C# and VB, which are static programming languages, requiring a compile step before execution and relying on debugging to see code in action. Take a look at the other languages mainly used on the web again -- they're all dynamic languages, running from source code, and providing interactive environments for running code. &lt;strong&gt;&lt;font color="#ff8000"&gt;Why is .NET static while the rest of the web is dynamic?&lt;/font&gt;&lt;/strong&gt; Why can't they exist together? If .NET provided some language choice for developers, all the languages be used together, and the &lt;font color="#ff8000"&gt;&lt;strong&gt;.NET community could benefit from the amazing work being done by dynamic language community&lt;/strong&gt;&lt;/font&gt;, and visa versa.&lt;/p&gt;  &lt;p class="section"&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;We in-fact live in this world&lt;/font&gt;&lt;/strong&gt;, and embracing dynamic languages is possible on .NET, but &lt;strong&gt;&lt;font color="#ff8000"&gt;why would you want to do it&lt;/font&gt;&lt;/strong&gt;? I'll discuss this in the following posts (links to posts coming soon):&lt;/p&gt;  &lt;div class="section"&gt;   &lt;ul&gt;     &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-21-server-side-web.html"&gt;Server-side web development with dynamic languages&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-22-client-side-web.html"&gt;Client-side web development with dynamic languages&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2010/04/mix10-part-3-using-dynamic-languages-in.html"&gt;Using dynamic languages in your existing web-applications&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;Coming soon: &lt;/em&gt;Opening up your applications to extensibility with scripts &lt;/li&gt;   &lt;/ul&gt; &lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=AJQKfrO2SQg:aveiTCdmf7Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=AJQKfrO2SQg:aveiTCdmf7Q:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=AJQKfrO2SQg:aveiTCdmf7Q:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=AJQKfrO2SQg:aveiTCdmf7Q:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=AJQKfrO2SQg:aveiTCdmf7Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=AJQKfrO2SQg:aveiTCdmf7Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=AJQKfrO2SQg:aveiTCdmf7Q:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/AJQKfrO2SQg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/AJQKfrO2SQg/mix10-ironruby-and-ironpython-part-1.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_OqCZhp9yI0Q/S6qrVHtweUI/AAAAAAAAAUg/RVL6vjAsKWM/s72-c/image5.png?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2010/03/mix10-ironruby-and-ironpython-part-1.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-9091592033547030332</guid><pubDate>Fri, 05 Mar 2010 22:30:00 +0000</pubDate><atom:updated>2010-03-05T15:41:07.790-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PyCon</category><category domain="http://www.blogger.com/atom/ns#">talks</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><category domain="http://www.blogger.com/atom/ns#">Python</category><title>PyCon 2010: Python in the browser</title><description>&lt;p&gt;&lt;a href="http://us.pycon.org/"&gt;&lt;img alt="PyCon 2010: Atlanta" src="http://www.processmechanics.com/media/pycon2010/speaking-pycon2010-400x60.png" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Last weekend I was very fortunate to &lt;a href="http://us.pycon.org/2010/conference/schedule/event/14/" target="_blank"&gt;speak&lt;/a&gt; at &lt;a href="http://us.pycon.org/2010/about/" target="_blank"&gt;PyCon 2010 in Atlanta&lt;/a&gt; about &lt;a href="http://ironpython.net/browser/" target="_blank"&gt;writing browser-based applications in Python&lt;/a&gt;. A majority of the &lt;a href="http://ironpython.codeplex.com/team/view" target="_blank"&gt;IronPython team&lt;/a&gt; was also there; &lt;a href="http://blogs.msdn.com/dinoviehland/" target="_blank"&gt;Dino Viehland&lt;/a&gt; &lt;a href="http://blip.tv/file/3263361/" target="_blank"&gt;spoke about IronPython Tooling in a keynote slot&lt;/a&gt;, &lt;a href="http://knowbody.livejournal.com/" target="_blank"&gt;Dave Fugate&lt;/a&gt; gave a &lt;a href="http://us.pycon.org/2010/conference/posters/accepted/#p6-behind-the-iron-curtain-testing-python-at-microsoft" target="_blank"&gt;poster presentation about testing IronPython&lt;/a&gt;, and Bill Chiles was there for emotional support. It was also great to see &lt;a href="http://www.voidspace.org.uk/" target="_blank"&gt;Michael Foord&lt;/a&gt;, and also see how supportive the Python community is of IronPython.&lt;/p&gt;  &lt;p&gt;Here’s the write-up from my talk:&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;Introductions and talk overview&lt;/strong&gt;&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;I primarily work on IronRuby, but when it comes to web technologies I give IronPython love as well. Actually, I was an intern back when it was just the IronPython team, and when I started full-time I was doing exactly what this talk is about -- getting Python running in the browser -- so I'm really excited to be talking about this at PyCon.&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff8000"&gt;You, the Python developer, use Python because you want to, but in the browser you use JavaScript because you &lt;i&gt;think&lt;/i&gt; you have to.&lt;/font&gt; With IronPython you can write browser code in Python. I’ll only begin to answer &amp;quot;&lt;em&gt;what can the browser bring to Python?&lt;/em&gt;&amp;quot; and &amp;quot;&lt;em&gt;what can Python bring to the browser?&lt;/em&gt;&amp;quot; in this short overview; examples will be very simple (with the exception of a few flashy ones) to make sure you can get started immediately.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Follow along&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blip.tv/file/3259502/" target="_blank"&gt;Watch the video of the talk from PyCon&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://github.com/jschementi/pycon2010" target="_blank"&gt;Get all the demos from GitHub&lt;/a&gt; (&lt;a href="http://github.com/jschementi/pycon2010/raw/master/slides/jimmysch-python-in-the-browser.pdf" target="_blank"&gt;slides too&lt;/a&gt;) (&lt;a href="http://ironpython.net/browser/examples/pycon2010/" target="_blank"&gt;view online&lt;/a&gt;)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Also, all information and documentation about this can be found the &lt;strong&gt;&lt;em&gt;new&lt;/em&gt;&lt;/strong&gt;&amp;#160;&lt;a href="http://ironpython.net/browser/" target="_blank"&gt;ironpython.net/browser&lt;/a&gt;&lt;strong&gt;&lt;/strong&gt; page:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironpython.net/browser/" target="_blank"&gt;&lt;img style="display: inline" title="IronPython: Python in the Browser" alt="IronPython: Python in the Browser" src="http://lh6.ggpht.com/_OqCZhp9yI0Q/S5GF7qVWGTI/AAAAAAAAASw/sCtzGTVTac8/pythonbrowser%5B2%5D.png?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h5&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;Setting Expectations&lt;/strong&gt;&lt;/font&gt;&lt;/h5&gt;  &lt;p&gt;“Python in the browser” is &lt;strong&gt;&lt;em&gt;&lt;u&gt;not&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt; Microsoft embracing and extending the browsers to support Python. In fact, this integration downloads python on demand, so there is no change required to the browser This is because &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt; as the Python execution engine …&lt;/p&gt;  &lt;p&gt;&lt;a href="http://silverlight.net" target="_blank"&gt;&lt;img style="display: inline" title="Slide6" alt="Slide6" src="http://lh6.ggpht.com/_OqCZhp9yI0Q/S5GF8DegJEI/AAAAAAAAAUY/nU2MGZZLF20/Slide6%5B1%5D.png?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;… and if you’re wondering “What is Silverlight?” …&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://microsoft.com/silverlight"&gt;Silverlight&lt;/a&gt; is a browser plug-in for Windows, and Mac OS (Novell makes a Linux version called “Moonlight”), which provide a managed execution engine for .NET-based programming languages in the browser, a rich set of vector-graphics-based UI features, and interop with the browser programming model and DOM. Go to &lt;a href="http://silverlight.net"&gt;http://silverlight.net&lt;/a&gt; for more information.&lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;&lt;a name="Hello_World_11966306436806917_11799363233149052"&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Hello, World&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;Let's start with the latter, and show the most obvious thing Python can bring to the browser: &lt;b&gt;&lt;font color="#00c800"&gt;Python&lt;/font&gt;&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;To develop a Python application in the browser, you just need your favorite text editor; so open it up, create a HTML file, reference &lt;code&gt;dlr.js&lt;/code&gt;, and then you can use script-tags for running Python code:&lt;/p&gt; &lt;script src="http://gist.github.com/318169.js?file=helloworld.html"&gt;&lt;/script&gt;  &lt;p&gt;And the Python code does what you'd expect:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironpython.net/browser/examples/pycon2010/start.html" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Hello from Python!" border="0" alt="Hello from Python!" src="http://lh4.ggpht.com/_OqCZhp9yI0Q/S5GPr44r_SI/AAAAAAAAATg/NgB7Pc0fCFY/hello-world%5B1%5D.png?imgmax=800" width="370" height="145" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p style="border-left: orange 10px solid; padding-left: 10px"&gt;Though, I’d strongly suggest against writing any real app with your python &lt;em&gt;inline&lt;/em&gt; with HTML, as it then can’t be reused. Sticking your python code in a .py file and referencing it from a script-tag is preferred for separation-purposes.&lt;/p&gt;  &lt;p&gt;Simple, right? Let's do something slightly more complicated, like handling mouse clicks. I'd prefer to do this in a REPL window, so let's turn one on in the browser; just place the following script-tag in the page:&lt;/p&gt; &lt;script src="http://gist.github.com/318169.js?file=repl.html"&gt;&lt;/script&gt;  &lt;p&gt;&lt;em&gt;Note: you have &lt;a href="http://github.com/jschementi/pycon2010/raw/master/repl.py" target="_blank"&gt;repl.py&lt;/a&gt; locally if you downloaded the demos, or point to the &lt;a href="http://github.com/jschementi/pycon2010/raw/master/repl.py" target="_blank"&gt;online one&lt;/a&gt; directly.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;And now when you add &lt;code&gt;?console&lt;/code&gt; to the page's URL a Python repl window will appear:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironpython.net/browser/examples/pycon2010/start.html?console" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="IronPython REPL in browser" border="0" alt="IronPython REPL in browser" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/S5GF9qHjXRI/AAAAAAAAATw/Jw05re18QuU/ipy-console%5B2%5D.png?imgmax=800" width="400" height="245" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The console is hooked up to &lt;code&gt;sys.stdout&lt;/code&gt;, so your existing text-based Python scripts can come alive in the browser (sans reading from stdin). Also, any print statements you use in the app will show up in the console as well, making it a great println-debugging tool.&lt;/p&gt;  &lt;p&gt;Let's play around with the page a bit, adding a DOM element and changing it's HTML content to &amp;quot;Ouch!&amp;quot; when clicked:&lt;/p&gt; &lt;script src="http://gist.github.com/318169.js?file=dom.py"&gt;&lt;/script&gt;  &lt;h4&gt;&lt;a name="How_all_this_works_51619907561"&gt;&lt;/a&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;How all this works&lt;/strong&gt;&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Wow, Python works in the browser! Let's look behind the curtain for a second to see what is really going on.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_OqCZhp9yI0Q/S5GF9z6_85I/AAAAAAAAARI/1Xa_-MK8Odw/s1600-h/Slide9%5B3%5D.png"&gt;&lt;img style="display: inline" title="Slide9" alt="Slide9" src="http://lh6.ggpht.com/_OqCZhp9yI0Q/S5GF-43d3LI/AAAAAAAAARM/H07zENyIddw/Slide9_thumb%5B1%5D.png?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;dlr.js contains a collection of functions for creating a Silverlight control on the HTML page that is capable of running IronPython code.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_OqCZhp9yI0Q/S5GF_WJ6OHI/AAAAAAAAARQ/Zs2OynTAJ18/s1600-h/Slide10%5B3%5D.png"&gt;&lt;img style="display: inline" title="Slide10" alt="Slide10" src="http://lh6.ggpht.com/_OqCZhp9yI0Q/S5GF_vQmqnI/AAAAAAAAARU/F23H8Tffy10/Slide10_thumb%5B1%5D.png?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;By default, just running dlr.js injects a Silverlight &lt;code&gt;&amp;lt;object&amp;gt;&lt;/code&gt; tag into the page (immediately after the script-tag) so it can run only DOM-based scripts, and also scans for other script-tags indicating that you want a Silverlight rendering surface, but more on that later.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_OqCZhp9yI0Q/S5GGADNQNjI/AAAAAAAAARY/3P9ucpP4vlQ/s1600-h/Slide11%5B3%5D.png"&gt;&lt;img style="display: inline" title="Slide11" alt="Slide11" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/S5GGATuqKBI/AAAAAAAAARc/nzeNu-SlsH0/Slide11_thumb%5B1%5D.png?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The injected Silverlight control points to a Silverlight application made specifically to embed the &lt;a href="http://dlr.codeplex.com" target="_blank"&gt;dynamic language runtime&lt;/a&gt;, the compiler/runtime/embedding infrastructure IronPython is built on, find all the Python code the HTML page uses, and executes it.&lt;/p&gt;  &lt;p&gt;The XAP is tiny, as the DLR and IronPython are in separate packages which are downloaded on-demand; the DLR and IronPython are not installed with Silverlight, so they must be downloaded with the application.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_OqCZhp9yI0Q/S5GGAyQJvoI/AAAAAAAAARg/zZYmsKKs33c/s1600-h/Slide12%5B3%5D.png"&gt;&lt;img style="display: inline" title="Slide12" alt="Slide12" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/S5GGBUBagFI/AAAAAAAAARk/yZ0osMmBqSg/Slide12_thumb%5B1%5D.png?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;However, if the application depends on the ironpython.net binaries, the user's browser will cache them and they won't be re-downloaded for any other app; almost as good as being part of the installer, while still being able to be open-source.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_OqCZhp9yI0Q/S5GGBrQAl0I/AAAAAAAAARo/8ph1eYwqc1s/s1600-h/Slide13%5B3%5D.png"&gt;&lt;img style="display: inline" title="Slide13" alt="Slide13" src="http://lh4.ggpht.com/_OqCZhp9yI0Q/S5GGBxTj5TI/AAAAAAAAARs/0D1ys0w-yn4/Slide13_thumb%5B1%5D.png?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now user-code is able to run. Each inline Python script-tag is executed as if it was one Python module, and all other Python files execute as their own modules.&lt;/p&gt;  &lt;div style="border-left: orange 10px solid; padding-left: 10px"&gt;   &lt;p&gt;To allow Python to be indented inside a script tag, the margin of the first line which does not only contain whitespace is removed. Line numbers in the HTML are preserved, so error messages show up correctly:&lt;/p&gt;    &lt;p&gt;&lt;img title="python error messages" alt="python error messages" src="http://docs.google.com/File?id=dcvr9mmg_161dvgrbnhm_b" width="380" height="157" /&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;The code is handed off to the DLR Hosting APIs (in the Microsoft.Scripting.Hosting namespace), which (a bit simplified) looks like this in C#:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_OqCZhp9yI0Q/S5GGCd7esbI/AAAAAAAAARw/f6NhskEnmf4/s1600-h/Slide14%5B3%5D.png"&gt;&lt;img style="display: inline" title="Slide14" alt="Slide14" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/S5GGCzByChI/AAAAAAAAAR0/rU3Aj0WAbpE/Slide14_thumb%5B1%5D.png?imgmax=800" width="400" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Executing Python code with the DLR hosting APIs is very straight-forward; essentially Python-eval for .NET-based languages. This hosting API abstract the “embedding” of Python away from the actual engine, so an application that hosts the DLR can use one API and switch between any language compatible with the DLR.&lt;/p&gt;  &lt;p&gt;For more information how how this all works, see the &lt;a href="http://ironpython.net/browser/sl-back-to-just-text.pdf" target="_blank"&gt;paper&lt;/a&gt; and the &lt;a href="http://github.com/ironruby/ironruby/tree/master/Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/" target="_blank"&gt;source code&lt;/a&gt;. Also, for more information on the DLR, see the &lt;a href="http://dlr.codeplex.com" target="_blank"&gt;DLR docs page&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;&lt;a name="Using_Python_libs_190130538307"&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Batteries included here too&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;&lt;em&gt;Great, I can write python code in my browser, but how do I test it?&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;A powerful part of Python is its standard-library; almost all Python applications depend on it, and it has some really useful libraries, like unittest. Here's a very simple test of the “say_ouch” app:&lt;/p&gt; &lt;script src="http://gist.github.com/318169.js?file=unittest.html"&gt;&lt;/script&gt;  &lt;p&gt;&lt;a href="http://ironpython.net/browser/examples/pycon2010/unittest.html?test" target="_blank"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/S5GPsjED7zI/AAAAAAAAAT0/PFm7wnEnX5k/image%5B4%5D.png?imgmax=800" width="400" height="156" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;But where did unittest come from? Take a closer look at the first line:&lt;/p&gt; &lt;script src="http://gist.github.com/318169.js?file=py-stdlib.html"&gt;&lt;/script&gt;  &lt;p&gt;That zip file contains the pieces of the Python standard-library that unittest depends on.&lt;/p&gt;  &lt;p style="border-left: orange 10px solid; padding-left: 10px"&gt;The Python standard library is a little less than 5MB compressed, so it's not &lt;i&gt;unthinkable&lt;/i&gt; to include the whole thing for development, but for deployment you should just include the dependencies; unittest's dependencies are 58 KB.&lt;/p&gt;  &lt;p&gt;When a zip file's filename is added to the path, it is treated like any other directory; &lt;code&gt;import&lt;/code&gt; looks inside it to find modules. You'll also notice that &lt;code&gt;import repl&lt;/code&gt; just worked, even though &lt;code&gt;repl.py&lt;/code&gt; isn't in the zip file; it was referenced by a script-tag earlier. It works because script-tags actually represent file-system entries; doing &lt;code&gt;open(&amp;quot;repl.py&amp;quot;)&lt;/code&gt;, or &lt;code&gt;open(&amp;quot;PythonStdLib/unittest.py&amp;quot;)&lt;/code&gt; would also work.&lt;/p&gt;  &lt;p style="border-left: orange 10px solid; padding-left: 10px"&gt;For anyone familiar with the older XAP-file/Chiron-based way to build Silverlight apps with IronPython: this combined script-tag/zip-file file-system abstraction is what allows you to never need to put file in the main application's XAP.&lt;/p&gt;  &lt;p&gt;Another interesting library to in Silverlight is &lt;a href="http://code.google.com/p/rst2xaml/" target="_blank"&gt;rst2xaml&lt;/a&gt;, which takes any &lt;a href="http://docutils.sourceforge.net/" target="_blank"&gt;reStructuredText&lt;/a&gt;-formatted files and converts them to XAML to be rendered in Silverlight. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironpython.net/browser/examples/pycon2010/rst2xaml/Silverlight/index.html" target="_blank"&gt;&lt;img style="display: inline" title="rst2xaml" alt="rst2xaml" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/S5GGDPfBzhI/AAAAAAAAAT4/cMpE12n1Jqg/rst2xaml%5B2%5D.png?imgmax=800" width="376" height="300" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Using .NET built-in and external APIs&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;Now let's transition to what the browser can bring to Python; specifically the APIs that Silverlight exposes. Silverlight has a ton of functionality, and as I was only able to discuss a few Python libraries in Silverlight, I'll only be able to show a few Silverlight libraries being used from Python, but the entirety of Silverlight can be used from Python. See all the features Silverlight provides, as well as how to use .NET APIs in-general from Python.&lt;/p&gt;  &lt;p&gt;One interesting API is the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.writeablebitmap(VS.95).aspx" target="_blank"&gt;WritableBitmap&lt;/a&gt;, which gives you per-pixel access to render whatever you want. For example, here its used to render a fractal:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironpython.net/browser/examples/pycon2010/mandelbrot.html" target="_blank"&gt;&lt;img style="display: inline" title="mandelbrot" alt="mandelbrot" src="http://lh6.ggpht.com/_OqCZhp9yI0Q/S5GGD9uJvoI/AAAAAAAAAUE/yyq7DkCSv-k/mandelbrot1-400%5B1%5D.png?imgmax=800" width="400" height="301" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p style="margin-top: 0px; padding-top: 0px"&gt;&lt;em&gt;&lt;font size="1"&gt;Example derived from &lt;/font&gt;&lt;/em&gt;&lt;a href="http://www.silverlightplayground.org/post/2009/03/18/Silverlight3-WriteableBitmap.aspx" target="_blank"&gt;&lt;em&gt;&lt;font size="1"&gt;A.Boschin&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font size="1"&gt;.&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;This is even more interesting because the actual bitmap was generated by code written in C#, but called from Python:&lt;/p&gt; &lt;script src="http://gist.github.com/318169.js?file=mandelbrotbase.cs"&gt;&lt;/script&gt;&lt;script src="http://gist.github.com/318169.js?file=mandelbrot.py"&gt;&lt;/script&gt;  &lt;p style="border-left: orange 10px solid; padding-left: 10px"&gt;Source code summarized from both &lt;a href="http://github.com/jschementi/pycon2010/blob/master/mandelbrot/mandelbrotbase.cs" target="_blank"&gt;mandelbrotbase.cs&lt;/a&gt; and &lt;a href="http://github.com/jschementi/pycon2010/blob/master/mandelbrot/mandelbrot.py" target="_blank"&gt;mandelbrot.py&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As with any computationally-intensive operations, it's a good idea to write them in a static pre-compiled language; for example the scientific-computation libraries for Python are actually written in C, but the library provide an API accessible to Python programmers. Unfortunately, CPython puts that responsibility on the library developer; not every C library can be directly consumed by Python code. However, this example shows that IronPython can call into any C# library, or any library written in a .NET language for that matter. This makes it trivial to just begin writing your application in Python, and then decide to convert the performance-sensitive sections to C#.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironpython.net/browser/examples/pycon2010/webcam.html" target="_blank"&gt;&lt;img style="display: inline" title="Hello from Python (and my webcam!)" alt="Hello from Python (and my webcam!)" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/S5GGE-DmxZI/AAAAAAAAAUQ/mEIWALq39i0/webcam%5B2%5D.png?imgmax=800" width="400" height="468" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p style="margin-top: 0px; padding-top: 0px"&gt;&lt;font size="1"&gt;&lt;em&gt;Example derived from &lt;/em&gt;&lt;/font&gt;&lt;a href="http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx#webcam" target="_blank"&gt;&lt;font size="1"&gt;&lt;em&gt;Tim Heuer’s webcam-mic app&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Another interesting use of WritableBitmap is attaching different types of video sources to it, like a webcam! The upcoming version of Silverlight (version 4) supports webcam and microphone capture, and all that can be used from Python:&lt;/p&gt; &lt;script src="http://gist.github.com/318169.js?file=webcam.py"&gt;&lt;/script&gt;  &lt;p style="border-left: orange 10px solid; padding-left: 10px"&gt;Webcam usage requires Silverlight 4 Beta; you can download the installer for &lt;a href="http://silverlight.dlservice.microsoft.com/download/F/6/5/F653F7FD-AD4D-411D-8B1F-9C4B1BD69881/Silverlight_Developer.dmg"&gt;mac&lt;/a&gt; or &lt;a href="http://silverlight.dlservice.microsoft.com/download/F/6/5/F653F7FD-AD4D-411D-8B1F-9C4B1BD69881/Silverlight_Developer.exe"&gt;windows&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;&lt;a name="Tooling_356330999173224_48773967288434505"&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Tooling&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;The IronPython team’s big announcement at PyCon 2010 was the preview-availability of “IronPython Tools”, and add-on for Visual Studio 2010. This release was only distributed to PyCon 2010 attendees on CDs in their swag-bags, with a public release planned for the same time that VS 2010 final is released.&lt;/p&gt;  &lt;p&gt;IronPython tools comes with the beginnings of Silverlight support; for starters you can make a new Silverlight project:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_OqCZhp9yI0Q/S5GGFAJXH9I/AAAAAAAAASM/CeP8aMSYXog/s1600-h/vs-newproj%5B4%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="VS2010 New IronPython Silverlight project" border="0" alt="VS2010 New IronPython Silverlight project" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/S5GGFtb5fOI/AAAAAAAAASQ/Gn3Nz0mp9UI/vs-newproj_thumb%5B2%5D.png?imgmax=800" width="400" height="217" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;IronPython tools uses the DLR hosting APIs for colorizing code:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_OqCZhp9yI0Q/S5GGFzkqZbI/AAAAAAAAASY/ckkjDAfVu48/s1600-h/vs-colorization%5B4%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="VS2010 IronPython colorization" border="0" alt="VS2010 IronPython colorization" src="http://lh6.ggpht.com/_OqCZhp9yI0Q/S5GGG8o92CI/AAAAAAAAASc/tBrpb04J7Cg/vs-colorization_thumb%5B2%5D.png?imgmax=800" width="400" height="277" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And using Debug-&amp;gt;Attach To Process you can set breakpoints in your python code (even code embedded in the HTML page) and use the Visual Studio debugger to step-through you app:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_OqCZhp9yI0Q/S5GGHfiAeqI/AAAAAAAAASg/EmBGN8aDNGw/s1600-h/vs-debug%5B4%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="VS2010 IronPython Silverlight debugging" border="0" alt="VS2010 IronPython Silverlight debugging" src="http://lh4.ggpht.com/_OqCZhp9yI0Q/S5GGHp7I7HI/AAAAAAAAASk/6zGdg6KOxZk/vs-debug_thumb%5B2%5D.png?imgmax=800" width="400" height="277" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Now you know …&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;What a Python browser app looks like &lt;/li&gt;    &lt;li&gt;What is going on behind the scenes &lt;/li&gt;    &lt;li&gt;How to use real python libs in the browser &lt;/li&gt;    &lt;li&gt;How to use Silverlight APIs from Python &lt;/li&gt;    &lt;li&gt;That there is a prototype of IronPython tooling! &lt;/li&gt; &lt;/ul&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=hOlDtnQBFMg:vOJ6kP7nDcA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=hOlDtnQBFMg:vOJ6kP7nDcA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=hOlDtnQBFMg:vOJ6kP7nDcA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=hOlDtnQBFMg:vOJ6kP7nDcA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=hOlDtnQBFMg:vOJ6kP7nDcA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=hOlDtnQBFMg:vOJ6kP7nDcA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=hOlDtnQBFMg:vOJ6kP7nDcA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/hOlDtnQBFMg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/hOlDtnQBFMg/pycon-2010-python-in-browser.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_OqCZhp9yI0Q/S5GF7qVWGTI/AAAAAAAAASw/sCtzGTVTac8/s72-c/pythonbrowser%5B2%5D.png?imgmax=800" height="72" width="72" /><thr:total>12</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2010/03/pycon-2010-python-in-browser.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-1159494539523701321</guid><pubDate>Thu, 21 Jan 2010 00:54:00 +0000</pubDate><atom:updated>2010-01-20T16:56:30.871-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Gestalt</category><category domain="http://www.blogger.com/atom/ns#">HTML5</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><title>What can you get with 10KB of Ruby or Python code?</title><description>&lt;h3&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;$1000 and a trip to MIX 2010!&lt;/font&gt;&lt;/strong&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://mix10k.visitmix.com/" target="_blank"&gt;&lt;img style="display: inline" title="mix10kart" alt="mix10kart" src="http://lh4.ggpht.com/_OqCZhp9yI0Q/S1eltjOaRdI/AAAAAAAAAQc/VYs1v6V0ECg/mix10kart%5B5%5D.png?imgmax=800" width="367" height="360" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;9 days left, an counting&lt;/font&gt;, &lt;/strong&gt;to &lt;a href="http://mix10k.visitmix.com/Entry/Create" target="_blank"&gt;enter&lt;/a&gt; your minimalist creation into the &lt;a href="http://mix10k.visitmix.com/" target="_blank"&gt;MIX 10K Sm&lt;strong&gt;&lt;font color="#ff8000"&gt;art&lt;/font&gt;&lt;/strong&gt; Coding Challenge&lt;/a&gt;. Do anything you want, it just has to be less than 10 kilobytes of source code. You can use HTML5, or Silverlight, and also use &lt;a href="http://visitmix.com/labs/gestalt" target="_blank"&gt;Ruby or Python through Gestalt&lt;/a&gt; (&lt;a href="http://mix10k.visitmix.com/Terms#4" target="_blank"&gt;learn more about the entry rules&lt;/a&gt;). You can win a free trip to MIX and up to $1000 in cash (&lt;a href="http://mix10k.visitmix.com/Terms#8" target="_blank"&gt;learn more about the prizes&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;Check out the &lt;a href="http://mix10k.visitmix.com/Gallery" target="_blank"&gt;already submitted apps&lt;/a&gt; for inspiration; they are starting to look really awesome.&lt;/p&gt;  &lt;p&gt;As an added bonus, I’m part of the &lt;a href="http://live.visitmix.com/News/MIX-10K-Judge-Panel-Announced" target="_blank"&gt;MIX 10K Judge Panel&lt;/a&gt;! Since I work on &lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; and &lt;a href="http://ironpython.net" target="_blank"&gt;IronPython&lt;/a&gt;, and wrote/maintain &lt;a href="http://visitmix.com/labs/gestalt" target="_blank"&gt;Gestalt&lt;/a&gt;, I’ll be &lt;em&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;“very happy”&lt;/font&gt;&lt;/strong&gt;&lt;/em&gt; if I you submit a Ruby or Python app. Of course I won’t be biased against JavaScript or C# based apps, but just sayin’ … ;)&lt;/p&gt;  &lt;p&gt;Entries will be accepted through January 29, so …&lt;/p&gt; &lt;style type="text/css"&gt;


#mix10k_enter,
#mix10k_enter:link,
#mix10k_enter:visited {
border-bottom: #666 3px solid; border-left: #666 3px solid; padding-bottom: 10px; background-color: #444; margin: 10px 50px 20px 0px; padding-left: 10px; padding-right: 10px; display: block; color: white; font-size: 24px; border-top: #666 3px solid; border-right: #666 3px solid; padding-top: 10px;
}
#mix10k_enter:hover {
  background-color: #555;
  text-decoration: none;
}&lt;/style&gt;&lt;a id="mix10k_enter" href="http://mix10k.visitmix.com/Entry/Create" target="_blank"&gt;&lt;strong&gt;Enter your app right now »&lt;/strong&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=euq9xTKM_GM:stYkXbLHmgA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=euq9xTKM_GM:stYkXbLHmgA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=euq9xTKM_GM:stYkXbLHmgA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=euq9xTKM_GM:stYkXbLHmgA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=euq9xTKM_GM:stYkXbLHmgA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=euq9xTKM_GM:stYkXbLHmgA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=euq9xTKM_GM:stYkXbLHmgA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/euq9xTKM_GM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/euq9xTKM_GM/what-can-you-get-with-10kb-of-ruby-or.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_OqCZhp9yI0Q/S1eltjOaRdI/AAAAAAAAAQc/VYs1v6V0ECg/s72-c/mix10kart%5B5%5D.png?imgmax=800" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2010/01/what-can-you-get-with-10kb-of-ruby-or.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-3249979134638588635</guid><pubDate>Tue, 15 Dec 2009 23:41:00 +0000</pubDate><atom:updated>2009-12-15T16:01:39.785-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">rubyconf</category><category domain="http://www.blogger.com/atom/ns#">Release</category><title>IronRuby @ RubyConf 2009 – Part 4: Project status</title><description>&lt;em&gt;This is part of a &lt;a href="http://blog.jimmy.schementi.com/search/label/rubyconf"&gt;RubyConf 2009 series&lt;/a&gt;:&lt;/em&gt;   &lt;br /&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-1-summary.html"&gt;Overview&lt;/a&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-2-what-sets.html"&gt;What sets IronRuby apart?&lt;/a&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-part-3-sneaking-ruby.html"&gt;Sneaking Ruby to the top&lt;/a&gt; / &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-35.html"&gt;Embedding IronRuby&lt;/a&gt; | &lt;strong&gt;Project status&lt;/strong&gt;   &lt;p&gt;It’s been a long ride – starting in 2007 when IronRuby was introduced running in Silverlight. Things started out slowly, but for the last year we’ve moved pretty quick, have gotten great feedback, and IronRuby is due for another bump:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironruby.net/download" target="_blank"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/Sygeh-0Z_1I/AAAAAAAAAP4/GD1MmrErHsM/image8.png?imgmax=800" width="393" height="157" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We’ve exceeded our goals for 1.0, and still plan on further &lt;em&gt;excess&lt;/em&gt; before 1.0 is final. Let’s dive into our top goals: performance, compatibility, and CLR integration.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://github.com/jschementi/rubyconf2009/raw/master/jimmysch-ironruby.pdf#page=21" target="_blank"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh6.ggpht.com/_OqCZhp9yI0Q/SygeiL81K1I/AAAAAAAAAP8/DwP64lYEJ_Y/image37.png?imgmax=800" width="400" height="315" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We’ve been tracking performance against MRI 1.8.6, which though isn’t a final performance goal, it’s a good measure of performance for a 1.0. In the next major release we’ll start tracking MRI 1.9. In general we’re a significantly faster than MRI, but still a tad unacceptable compared to JRuby – that needs to be fixed before 1.0.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://github.com/jschementi/rubyconf2009/raw/master/jimmysch-ironruby.pdf#page=22" target="_blank"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/Sygeig7M38I/AAAAAAAAAQA/HL4H78JRRXE/image38.png?imgmax=800" width="400" height="277" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We measure compatibility against RubySpec, as well as some popular Ruby libraries (only the top-used ones are shown here). We’re over 90% for every group of tests. In practice, compatibility is being tested against almost every library we can get our hands on, which is a ton, so I feel confident IronRuby 1.0 will be a very compatible Ruby implementation.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-1-summary.html" target="_blank"&gt;As I said in a previous post&lt;/a&gt;, this compatibility measure is against 1.8.6; IronRuby does not yet suppor 1.9 completely, though we may quickly change our opinion on this.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://github.com/jschementi/rubyconf2009/raw/master/jimmysch-ironruby.pdf#page=23" target="_blank"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh4.ggpht.com/_OqCZhp9yI0Q/Sygei6fka6I/AAAAAAAAAQE/9429X2zalk4/image40.png?imgmax=800" width="400" height="221" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;CLR integration is very flushed out, supporting using all CLR classes, calling all methods, properties, etc, generics, inheritance, and all the other CLR features exposed to managed languages such as C# and F#. The only missing hole is generating actual CLR types and backings for Ruby types, though we feel this is an OK feature to ship without, because the work-arounds are simple. However, it will be a priority to fix in the next major release.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://github.com/jschementi/rubyconf2009/raw/master/jimmysch-ironruby.pdf#page=24" target="_blank"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/SygejVsjn_I/AAAAAAAAAQI/ekE2LnuRi2o/image41.png?imgmax=800" width="400" height="288" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;With RC1 being released, RC2, 3, etc. will come as the community reports issues that we all agree must be fixed by 1.0 final. As far as the core team’s priorities, we want to fix startup and throughput performance issues, as well as get through the backlog of bugs.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://github.com/jschementi/rubyconf2009/raw/master/jimmysch-ironruby.pdf#page=25" target="_blank"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh4.ggpht.com/_OqCZhp9yI0Q/SygejmM9E1I/AAAAAAAAAQM/65NaDmK7Llo/image42.png?imgmax=800" width="400" height="227" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;After 1.0 is released, we’ll probably take a bit of a break, but then look to do some features we didn’t get to finish in 1.0, as well as Visual Studio Integration, since it’s the &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=479957" target="_blank"&gt;highest voted feature for VS2010&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_OqCZhp9yI0Q/Sygej9QQQvI/AAAAAAAAAQQ/DKtfxg0iNXI/s1600-h/image36.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/Sygek8N1qjI/AAAAAAAAAQU/SDpoVtBcprc/image_thumb17.png?imgmax=800" width="400" height="185" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Download the &lt;a href="http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35312" target="_blank"&gt;IronRuby 1.0 RC1&lt;/a&gt; and let us know what you think! You can &lt;a href="http://ironruby.codeplex.com/WorkItem/Create.aspx" target="_blank"&gt;submit any issues you find to the CodePlex site&lt;/a&gt;. &lt;font color="#ff8000"&gt;&lt;strong&gt;Thanks!&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=CPQ4THmx86Q:pFG8Dh8ilto:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=CPQ4THmx86Q:pFG8Dh8ilto:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=CPQ4THmx86Q:pFG8Dh8ilto:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=CPQ4THmx86Q:pFG8Dh8ilto:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=CPQ4THmx86Q:pFG8Dh8ilto:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=CPQ4THmx86Q:pFG8Dh8ilto:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=CPQ4THmx86Q:pFG8Dh8ilto:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/CPQ4THmx86Q" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/CPQ4THmx86Q/ironruby-rubyconf-2009-part-4-project.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_OqCZhp9yI0Q/Sygeh-0Z_1I/AAAAAAAAAP4/GD1MmrErHsM/s72-c/image8.png?imgmax=800" height="72" width="72" /><thr:total>7</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-4-project.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-4847271533064123372</guid><pubDate>Tue, 15 Dec 2009 06:29:00 +0000</pubDate><atom:updated>2009-12-15T15:59:38.744-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Embedding</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">rubyconf</category><title>IronRuby @ RubyConf 2009 – Part 3.5: Embedding IronRuby</title><description>&lt;p&gt;&lt;em&gt;This is part of a &lt;a href="http://blog.jimmy.schementi.com/search/label/rubyconf"&gt;RubyConf 2009 series&lt;/a&gt;:&lt;/em&gt;     &lt;br /&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-1-summary.html"&gt;Overview&lt;/a&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-2-what-sets.html"&gt;What sets IronRuby apart?&lt;/a&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-part-3-sneaking-ruby.html"&gt;Sneaking Ruby to the top&lt;/a&gt; / &lt;strong&gt;Embedding IronRuby&lt;/strong&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-4-project.html"&gt;Project status&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Imagine you’re building a program to help create animations, visualizations, and other interactive applications. The requirements are simple:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;2D rendering surface with simple primitive shapes &lt;/li&gt;    &lt;li&gt;Simple animation support – callbacks for each frame and each object on the canvas &lt;/li&gt;    &lt;li&gt;User-loadable “macros” for drawing and animating &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;A .NET developer can easily code up the first two requirements in C#, but implementing the third will be tricky. What does a macro look like? How do I discover them? How can I make it interactive? Why is this so hard!? This scenario requires the user to input some data, and the program must make an animation out of it; the data of your program is the code. Here are the options most .NET developers would come up with:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Domain specific language – people usually cop out here and make it XML-based, which happens to produce the most human-unreadable code ever. This DSL &lt;em&gt;could&lt;/em&gt; also be GUI-based, but you won’t get any programmers interesting in extending your app that way. &lt;/li&gt;    &lt;li&gt;Completely punt on the interactivity and require the macros be .NET DLLs. &lt;/li&gt;    &lt;li&gt;Find a way to use C# interactively - either using &lt;a href="http://msdn.microsoft.com/en-us/library/650ax5cx.aspx" target="_blank"&gt;CodeDom&lt;/a&gt; to compile and run C# code dynamically (much like ASP.NET does), or code-generate a valid C# class from the snippet, compile it to a DLL (aka shell out to csc.exe), loading that DLL, and finally reflecting over that DLL to call the user’s code. This is, of course, ignoring the question of whether C# is a good macro language or not. &lt;em&gt;It’s worth noting that Mono supports &lt;/em&gt;&lt;a href="http://www.go-mono.com/docs/index.aspx?link=N:Mono.CSharp" target="_blank"&gt;&lt;em&gt;hosting&lt;/em&gt;&lt;/a&gt;&lt;em&gt; it’s C# compiler, so you could do more dynamic things with C# through Mono.&lt;/em&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Given all that talk about Ruby before, let’s try using IronRuby to write these macros. Here’s a C# app to start from:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_OqCZhp9yI0Q/SycsxGvRmmI/AAAAAAAAAOo/rh-7Yk3_YoM/s1600-h/image%5B7%5D.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_OqCZhp9yI0Q/SycsxnTO4RI/AAAAAAAAAOs/SbrR43DWA3s/image_thumb%5B6%5D.png?imgmax=800" width="400" height="200" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://github.com/jschementi/rubyconf2009/tree/sketchscript-part1" target="_blank"&gt;SketchScript starter on GitHub&lt;/a&gt; (&lt;a href="http://github.com/jschementi/rubyconf2009/zipball/sketchscript-part1" target="_blank"&gt;zip&lt;/a&gt;)&lt;/p&gt;  &lt;p align="center"&gt;&lt;em&gt;For the lazy, &lt;a href="http://github.com/jschementi/rubyconf2009/tree/master/sketchscript" target="_blank"&gt;get the finished app’s source code&lt;/a&gt; (&lt;a href="http://github.com/jschementi/rubyconf2009/zipball/master" target="_blank"&gt;zip&lt;/a&gt;), and a &lt;font color="#ff0000"&gt;binary build (coming soon)&lt;/font&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The starter app does ABSOLUTELY NOTHING; just a Window with a &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.canvas(VS.100).aspx" target="_blank"&gt;Canvas&lt;/a&gt; and a bunch of textboxes for coding. Keep in mind this is just a demonstration, and this app could have been written entirely in Ruby, but the point is to show .NET developers how powerful an embedded scripting language can be.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Setting up your environment&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;.NET developers have choices for development environments: mainly &lt;a href="http://www.microsoft.com/visualstudio" target="_blank"&gt;Visual Studio&lt;/a&gt; or &lt;a href="http://www.icsharpcode.net/OpenSource/SD/" target="_blank"&gt;SharpDevelop&lt;/a&gt;, or even the command-line and text-editor (I left out &lt;a href="http://monodevelop.com/" target="_blank"&gt;MonoDevelop&lt;/a&gt; since Mono doesn’t support the Windows UI stuff I’m doing, but a future version will be able to run in Mono). I’ll be using &lt;a href="http://download.microsoft.com/download/1/3/1/1316A924-AF88-4CC9-9661-CD1D2BBF3E5E/vs_proweb.exe" target="_blank"&gt;Visual Studio 2010 Beta 2&lt;/a&gt; for this walkthrough’s screenshots and examples, specifically because it C# 4 has special dynamic language features,&lt;strike&gt; but you can also use C# 3 with Visual Studio 2008 (&lt;/strike&gt;&lt;a href="http://www.microsoft.com/express/vcsharp/#webInstall" target="_blank"&gt;&lt;strike&gt;free version here&lt;/strike&gt;&lt;/a&gt;&lt;strike&gt;),&lt;/strike&gt; or just stick to a text-editor and &lt;a href="http://en.wikipedia.org/wiki/MSBuild" target="_blank"&gt;MSBuild&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;If you’re using .NET 4.0, &lt;code&gt;sketchscript\sketchscript.sln&lt;/code&gt; is the solution file you want to use. &lt;strike&gt;The .NET 3.5 version is &lt;code&gt;sketchscript\sketchscript3.5.sln&lt;/code&gt;, but seriously, try out .NET 4.0&lt;/strike&gt;.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;font color="#ff0000"&gt;I haven’t tested it out in VS2008 yet, so please bare with me. If you’re feeling adventurous, you can fork my git repo, get it working in VS2008, and I’ll pull your changes in.&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Adding references to IronRuby&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;If you downloaded SketchScript from the above link, you’ll find four DLLs required for embedding IronRuby in the &lt;code&gt;sketchscript\ironruby&lt;/code&gt; directory. Add those as references to the sketchscript.csproj:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_OqCZhp9yI0Q/Sycsx3szVGI/AAAAAAAAAOw/11s_xD274X8/s1600-h/image%5B8%5D.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_OqCZhp9yI0Q/SycsySkF0tI/AAAAAAAAAO0/G6YqFDt8y84/image_thumb%5B7%5D.png?imgmax=800" width="285" height="225" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In case you’re curious about what each DLL is: &lt;code&gt;IronRuby.dll&lt;/code&gt; is the IronRuby compiler, while &lt;code&gt;IronRuby.Libraries.dll&lt;/code&gt; is the core libraries of Ruby. &lt;code&gt;Microsoft.Dynamic.dll&lt;/code&gt; are the APIs that IronRuby depend on for DLR compiler features, and &lt;code&gt;Microsoft.Scripting.dll&lt;/code&gt; is the DLR Hosting API.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;If anyone who has used IronRuby before is thinking there are missing DLLs, then you’re right. IronRuby’s &lt;code&gt;Microsoft.Scripting.Core.dll&lt;/code&gt; has been integrated into .NET 4.0 as the new &lt;code&gt;System.Core.dll&lt;/code&gt;. This also removes the need for &lt;code&gt;Microsoft.Scripting.ExtensionAttribute.dll&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Embedding IronRuby&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Now let’s get that code window working; first add some &lt;code&gt;using&lt;/code&gt; statements at the top of &lt;a href="http://github.com/jschementi/rubyconf2009/blob/3db197e19f75832822e28811de90a76bd426cf40/sketchscript/sketchscript/MainWindow.xaml.cs#L19" target="_blank"&gt;MainWindow.xaml.cs&lt;/a&gt;:&lt;/p&gt; &lt;script src="http://gist.github.com/255762.js?file=MainWindow-usings.xaml.cs"&gt;&lt;/script&gt;  &lt;p&gt;And some fields to hold onto the scripting engine anywhere in the &lt;code&gt;MainWindow&lt;/code&gt; class:&lt;/p&gt; &lt;script src="http://gist.github.com/255762.js?file=MainWindow-fields.xaml.cs"&gt;&lt;/script&gt;  &lt;p&gt;Now initialize the scripting engine; add this code to the &lt;code&gt;Loaded&lt;/code&gt; event action, after setting the &lt;code&gt;OutputBuffer&lt;/code&gt; but before the &lt;code&gt;KeyBindings()&lt;/code&gt; call (around line 71):&lt;/p&gt; &lt;script src="http://gist.github.com/255762.js?file=MainWindow-Loaded.xaml.cs"&gt;&lt;/script&gt;  &lt;p&gt;And lastly let’s run the code when Ctrl-Enter is pressed. Since that’s already set up for us, all we need to do is add this code in the &lt;code&gt;RunCode&lt;/code&gt; method, right at the &amp;quot;TODO&amp;quot; comment around line 92:&lt;/p&gt; &lt;script src="http://gist.github.com/255762.js?file=MainWindow-RunCode.xaml.cs"&gt;&lt;/script&gt;  &lt;p&gt;And that’s it! Now you’ll be able to run some actual Ruby code:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_OqCZhp9yI0Q/SycsyiiHxJI/AAAAAAAAAO8/6xVCyHphKOc/s1600-h/image%5B9%5D.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/Sycsy8GOyTI/AAAAAAAAAPI/gEuDPxBZi9c/image_thumb%5B8%5D.png?imgmax=800" width="400" height="331" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Interacting with the host application&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Though Ruby code can run, there is no obvious interaction with the host application. That black void of a canvas on the left would be completely useless if it wasn’t accessible from Ruby code, so add this single line to the &lt;code&gt;Loaded&lt;/code&gt; event action, before the &lt;code&gt;KeyBinding()&lt;/code&gt; call:&lt;/p&gt; &lt;script src="http://gist.github.com/255762.js?file=MainWindow-expose.xaml.cs"&gt;&lt;/script&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Note: if the host application didn’t do this, it would still be possible to get to the canvas from Ruby code, but the script writer would have to do it themselves:&lt;/em&gt;&lt;/p&gt;   &lt;script src="http://gist.github.com/255885.js?file=without-host-help.rb"&gt;&lt;/script&gt;    &lt;p&gt;&lt;em&gt;So, as a general rule-of-thumb, have your host program decide what parts to extend to script code, and have the script code only use that object-model, though their may be ways around it.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Trying it out&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Now that there’s a way to draw on the canvas, play around with drawing random things on the screen. Here’s a little script I’ve been playing with:&lt;/p&gt; &lt;script src="http://gist.github.com/255885.js?file=lots-o-squares.rb"&gt;&lt;/script&gt;  &lt;p&gt;Which draws this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_OqCZhp9yI0Q/SycszJJagnI/AAAAAAAAAPQ/1GpBiNQWFcc/s1600-h/squares%5B3%5D.jpg" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="squares" border="0" alt="squares" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/SycszvE7NSI/AAAAAAAAAPY/teqQBnaIJkI/squares_thumb%5B2%5D.jpg?imgmax=800" width="400" height="445" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Ooo, pretty! So without much effort we have a very extendable application. Before you get carried away playing around with making pretty things, there’s one more thing to do to make this app really awesome …&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Animation support&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;While animations could still be built with IronRuby’s native thread support or &lt;a href="http://msdn.microsoft.com/en-us/library/ms752312.aspx" target="_blank"&gt;WPF animations&lt;/a&gt; directly from Ruby code, it’d be nice for the host to provide some simple animation support, like a callback that fires for every frame, and even a way to attach animations to any object.&lt;/p&gt;  &lt;p&gt;The &lt;a href="http://github.com/jschementi/rubyconf2009/blob/sketchscript-basicembed/sketchscript/sketchscript/MainWindow.xaml.cs#L158" target="_blank"&gt;host currently supports these two callbacks&lt;/a&gt;, but they need to be wired up. Add the following code at the bottom of the &lt;code&gt;Loaded&lt;/code&gt; event action, before the call to &lt;code&gt;KeyBindings()&lt;/code&gt;: &lt;/p&gt; &lt;script src="http://gist.github.com/255762.js?file=MainWindow-RegisterCallback.xaml.cs"&gt;&lt;/script&gt;  &lt;p&gt;And also add this call at the end of the &lt;code&gt;RunCode&lt;/code&gt; method:&lt;/p&gt; &lt;script src="http://gist.github.com/255762.js?file=MainWindow-CaptureCallbacks.xaml.cs"&gt;&lt;/script&gt;  &lt;p&gt;Lastly we need to implement &lt;code&gt;CatureAnimationCallbacks&lt;/code&gt;, by looking for special method names to get a hold of. Look for &lt;code&gt;each_frame&lt;/code&gt; as the &lt;code&gt;EachFrame&lt;/code&gt; action, and &lt;code&gt;each_object&lt;/code&gt; as the &lt;code&gt;EachObject&lt;/code&gt; func.&lt;/p&gt; &lt;script src="http://gist.github.com/255762.js?file=MainWindow-CaptureCallbackImpl.xaml.cs"&gt;&lt;/script&gt;  &lt;p&gt;Now 30-times-a-second the host will try to call &lt;code&gt;each_frame&lt;/code&gt;, and it will call &lt;code&gt;each_object&lt;/code&gt; once for each element on the canvas, store the return value on the actual element, and then try to call an &lt;code&gt;update&lt;/code&gt; method on that stored object 30-times-a-second. This lets you either run random animations, or specific behavior for objects.&lt;/p&gt;  &lt;p&gt;A good animation example is bouncing, so let's run the script that produced all the squares first, and then run the following code to make them all bounce.&lt;/p&gt; &lt;script src="http://gist.github.com/255885.js?file=bounce.rb"&gt;&lt;/script&gt;  &lt;p&gt;And now it should look something like this:&lt;/p&gt; &lt;object width="400" height="300"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8185302&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=8185302&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"&gt;&lt;/embed&gt;&lt;/object&gt;  &lt;p&gt;There are more goodies to run in the &lt;a href="http://github.com/jschementi/rubyconf2009/tree/master/sketchscript/features" target="_blank"&gt;features directory&lt;/a&gt;, but try writing your own fun little animations. &lt;a href="http://blog.jredville.com" target="_blank"&gt;Jim Deville&lt;/a&gt; ported &lt;a href="http://github.com/jcasimir/code_of_art/raw/master/documents/Code%20of%20Art%20-%20Tutorial.pdf" target="_blank"&gt;the tutorial&lt;/a&gt; from &lt;a href="http://github.com/jcasimir" target="_blank"&gt;Jeff Casimir’s&lt;/a&gt; &lt;a href="http://github.com/jcasimir/code_of_art" target="_blank"&gt;Code of Art&lt;/a&gt; talk, which is pretty fun to play with, so if you make your own please post a comment with a screenshot and code!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://github.com/jschementi/rubyconf2009/blob/master/sketchscript/features/circles.rb" target="_blank"&gt;&lt;strong&gt;circle.rb&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_OqCZhp9yI0Q/Sycszz0ew-I/AAAAAAAAAPg/HPMRUr-U4OI/s1600-h/artclear2%5B2%5D.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="artclear2" border="0" alt="artclear2" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/Sycs0eNOBVI/AAAAAAAAAPw/16GTRLcFXE4/artclear2_thumb%5B1%5D.png?imgmax=800" width="400" height="444" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And there you have it, IronRuby embedded to do interesting things. In case you missed any steps along the way, &lt;a href="http://gist.github.com/256632" target="_blank"&gt;here's the full diff&lt;/a&gt; against the initial download.&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;Next stop, &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-4-project.html"&gt;IronRuby’s status and roadmap&lt;/a&gt;.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=jatq0ntUhnE:jQvtsHvBDDs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=jatq0ntUhnE:jQvtsHvBDDs:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=jatq0ntUhnE:jQvtsHvBDDs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=jatq0ntUhnE:jQvtsHvBDDs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=jatq0ntUhnE:jQvtsHvBDDs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=jatq0ntUhnE:jQvtsHvBDDs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=jatq0ntUhnE:jQvtsHvBDDs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/jatq0ntUhnE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/jatq0ntUhnE/ironruby-rubyconf-2009-part-35.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_OqCZhp9yI0Q/SycsxnTO4RI/AAAAAAAAAOs/SbrR43DWA3s/s72-c/image_thumb%5B6%5D.png?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-35.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-6474314197621642837</guid><pubDate>Mon, 14 Dec 2009 09:28:00 +0000</pubDate><atom:updated>2009-12-15T15:58:22.058-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">rubyconf</category><title>IronRuby @ RubyConf - Part 3: Sneaking Ruby to the top</title><description>&lt;p&gt;&lt;em&gt;This is part of a &lt;a href="http://blog.jimmy.schementi.com/search/label/rubyconf"&gt;RubyConf 2009 series&lt;/a&gt;:&lt;/em&gt;     &lt;br /&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-1-summary.html"&gt;Overview&lt;/a&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-2-what-sets.html"&gt;What sets IronRuby apart?&lt;/a&gt; | &lt;strong&gt;Sneaking Ruby to the top&lt;/strong&gt; / &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-35.html"&gt;Embedding IronRuby&lt;/a&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-4-project.html"&gt;Project status&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Let’s be honest: not everyone uses Ruby. I know, it hurts to hear, but it’s the truth. To get a general idea of how &lt;em&gt;bad&lt;/em&gt; it really is, let’s look at indeed.com’s job trends for Ruby, Python, Java, and .NET, and &lt;em&gt;assume &lt;/em&gt;that’s a good measure of usage:&lt;/p&gt;  &lt;div style="width: 540px"&gt;&lt;a title="Ruby, Python, .NET, Java Job Trends" href="http://www.indeed.com/jobtrends?q=Ruby%2C+Python%2C+.NET%2C+Java"&gt;&lt;img border="0" alt="Ruby, Python, .NET, Java Job Trends graph" src="http://www.indeed.com/trendgraph/jobgraph.png?q=Ruby%2C+Python%2C+.NET%2C+Java" width="400" height="222" /&gt; &lt;/a&gt;&lt;/div&gt;  &lt;p&gt;&lt;strong&gt;Holy crap!&lt;/strong&gt; Regardless of the actual numbers, we all know what this graph is saying to be true. But why are dynamic language’s so &lt;em&gt;under-used&lt;/em&gt;? Aside from the obvious, like fear of something different, the dynamic language community hasn’t sufficiently answered the “why” questions to the other camp, like “Why should I use Ruby if I already know .NET?”, and “why even bother.” Our answer has always been “Productivity, expressiveness, blah, blah, blah”; that turns out to be a horrible way to sell dynamic languages to people who love C# or Java for it’s productivity and expressiveness. =) However, their fears are justified; Ruby’s main usage today is for stand-alone apps (mainly websites, but there are some client apps), so they assume Ruby can’t be use it in their existing environment.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Let’s solve this!&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Let’s make it easy for those programmers at the top of the graph to use the languages at the bottom of the graph. Ruby gets to expand its ecosystem, and &lt;em&gt;enterprise&lt;/em&gt; developers get a great dynamic language to use. Ruby is nicely position for this specific scenario since implementations of Ruby exist for both Java and .NET, so Ruby’s usage could become more on-par with Java and .NET. And here’s the way we make this happen: &lt;font color="#ff8000"&gt;.NET and Java developers can easily &lt;strong&gt;embed&lt;/strong&gt; Ruby into their existing applications for &lt;strong&gt;scripting&lt;/strong&gt;&lt;/font&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;All this also applies for Python, and IronPython is forging this path along with IronRuby. This talk was for a Ruby crowd … I hope you understand &lt;a href="http://www.voidspace.org.uk/" target="_blank"&gt;Michael&lt;/a&gt; :). But don’t worry, &lt;a href="http://blogs.msdn.com/dinoviehland/archive/2009/11/17/world-s-worst-paint-program.aspx" target="_blank"&gt;Dino Viehland&lt;/a&gt; has already &lt;a href="http://microsoftpdc.com/Sessions/FT30" target="_blank"&gt;begun brainwashing .NET developers for Python&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Also, since I work on IronRuby, I’ll be talking about this in relation to IronRuby and .NET from now on, though the same arguments work for JRuby and Java (and Jython). Check out the &lt;a href="http://kenai.com/projects/jruby/pages/RedBridge" target="_blank"&gt;embedding JRuby page&lt;/a&gt;, and &lt;a href="http://www.jython.org/archive/21/docs/embedding.html" target="_blank"&gt;also how all this work in Jython&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The .NET people reading this might be smiling, but the Ruby people want to vomit … &lt;em&gt;(maybe partly because of .NET, but in all seriousness)&lt;/em&gt; … because of the word “&lt;em&gt;scripting”&lt;/em&gt;. I know, I too hate the negative associations “&lt;em&gt;scripting”&lt;/em&gt; has; when I first started working at Microsoft I was openly against naming a component “Microsoft.Scripting”, but who listens to the new guy? For those who don’t get it, “&lt;em&gt;scripting”&lt;/em&gt; makes these amazing languages sound like they are only useful for little toy things, and not for real work. Anyway, this plan takes advantage of that misconception, so don’t look at it as such a bad thing. :)&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Why and How?&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;&lt;em&gt;Ok, .NET developers, stop reading … you’ll ruin the surprise! Just kidding. I love you. Read on …&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Since .NET developers see Ruby as a &lt;em&gt;scripting&lt;/em&gt; language, it’s not a stretch to convince them that Ruby is good for embedding into their applications as a extensibility feature; allowing customize their application with bits of Ruby code. Here’s where all the &lt;a href="http://en.wikipedia.org/wiki/Trojan_Horse" target="_blank"&gt;Trojans jump out of the wooden horse&lt;/a&gt;. Getting Ruby into existing .NET applications is a much easier way for those developers to learn and use Ruby, rather than asking them to build a new app from scratch, or just look at tutorials, docs, etc, without having a good reason to. If .NET developers want to look at Ruby for use in their existing projects, then we’ve succeeded; it’ll then be pretty obvious that they can do &lt;em&gt;real &lt;/em&gt;things with these &lt;em&gt;so-called&lt;/em&gt; scripting languages. They’ll probably start using Ruby to prototype new features in their existing system, and then either keep that code as Ruby, or port some of it to their main language. Keep in mind, the goal isn’t to steal people from .NET – they would have left long ago like many of the Ruby community did – it’s to make Ruby co-exist with these more “enterprise” systems, and overall &lt;font color="#ff8000"&gt;&lt;strong&gt;make software development fun again for everyone&lt;/strong&gt;&lt;/font&gt;. &lt;/p&gt;  &lt;p&gt;But how do .NET developers really benefit from having a scripting language they can use from their current environments? Three words: &lt;font color="#ff8000"&gt;&lt;strong&gt;No More XML&lt;/strong&gt;&lt;/font&gt;. XML seemed to be the solution to all .NET developer’s problems since it was a way to make their environments more dynamic. It is easy to parse and walk XML, making it also easy to attach some meaning to seemingly meaningless angle-brackets. One could implement anything using this technique, even logic. Which is why XML became a dynamic language and meta-programming tool for .NET. But really &lt;font color="#ff8000"&gt;&lt;strong&gt;XML is a work-around to these static languages lacking the ability to be treated as both code and data&lt;/strong&gt;&lt;/font&gt;.&lt;/p&gt;  &lt;p&gt;Being able to use your code just like your data is liberating. For example, running Ruby code from just at string:&lt;/p&gt; &lt;script src="http://gist.github.com/254800.js?file=MainWindow1.cs"&gt;&lt;/script&gt;  &lt;p&gt;&lt;em&gt;IronRuby supports the &lt;a href="http://dlr.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=91404" target="_blank"&gt;DLR Hosting API&lt;/a&gt;, a language-neutral script hosting API for .NET. For instance, supporting another is just as easy as changing the 2nd line to &amp;quot;IronPython&amp;quot;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Imagine doing this with XML; you’d have to somehow encode what element and field you want to modify, along the value to update it to, and then use something like reflection to interpret the XML and do the work. And that’s just for this simple example of setting the text of a TextBlock. So using a real programming language allows for endless extensibility-possibilities. Ruby is especially interesting since it can be &lt;font color="#ff8000"&gt;&lt;strong&gt;simple enough for non-programmers, but powerful enough for adding full features&lt;/strong&gt;&lt;/font&gt;.&lt;/p&gt;  &lt;p&gt;Software which allows simple extensibility, like Firefox and Rails, tend to always create an ecosystem of extensions around them, which end up being one of the most compelling features of the program. Maybe that next app could be yours?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Next up, &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-35.html"&gt;an example of embedding IronRuby for graphics&lt;/a&gt;.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=vzL4OfwNs30:a2Y-Rn54OYE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=vzL4OfwNs30:a2Y-Rn54OYE:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=vzL4OfwNs30:a2Y-Rn54OYE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=vzL4OfwNs30:a2Y-Rn54OYE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=vzL4OfwNs30:a2Y-Rn54OYE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=vzL4OfwNs30:a2Y-Rn54OYE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=vzL4OfwNs30:a2Y-Rn54OYE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/vzL4OfwNs30" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/vzL4OfwNs30/ironruby-rubyconf-part-3-sneaking-ruby.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><thr:total>3</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-part-3-sneaking-ruby.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-6792360172068169543</guid><pubDate>Wed, 09 Dec 2009 07:20:00 +0000</pubDate><atom:updated>2009-12-15T15:57:18.767-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">rubyconf</category><title>IronRuby @ RubyConf 2009 – Part 2: What sets IronRuby apart?</title><description>&lt;p&gt;&lt;em&gt;This is part of a &lt;a href="http://blog.jimmy.schementi.com/search/label/rubyconf"&gt;RubyConf 2009 series&lt;/a&gt;:&lt;/em&gt;     &lt;br /&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-1-summary.html"&gt;Summary&lt;/a&gt; | &lt;strong&gt;What sets IronRuby apart?&lt;/strong&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-part-3-sneaking-ruby.html"&gt;Sneaking Ruby to the top&lt;/a&gt; / &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-35.html"&gt;Embedding IronRuby&lt;/a&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-4-project.html"&gt;Project status&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;First a little background for those new to IronRuby …&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; is a Ruby 1.8.6-compatible implementation, with support for some 1.9 features like string encodings. IronRuby is built on-top of the &lt;a href="http://msdn.microsoft.com/en-us/library/8bs2ecf4(VS.71).aspx" target="_blank"&gt;Common Language Runtime&lt;/a&gt;, so certain runtime-specific Ruby features are not supported on IronRuby, like callcc, ObjectSpace, and native extensions. However, local-continuations are coming, and we are considering &lt;a href="http://github.com/ffi/ffi" target="_blank"&gt;FFI&lt;/a&gt; post-1.0 to support native code.&lt;/p&gt;  &lt;p&gt;IronRuby runs on the CLR (2.0 SP1+) and &lt;a href="http://www.mono-project.com" target="_blank"&gt;Mono&lt;/a&gt; (2.0+), so IronRuby runs on a ton of platforms, including Mac OS and Linux. IronRuby also runs in the browser with Silverlight and Moonlight, a 4MB runtime which allows you to use Ruby to build “rich internet applications” … basically anything doing vector-graphics, webcam, audio, etc in the browser.&lt;/p&gt;  &lt;p&gt;To at least prove IronRuby runs on the Mac, here’s IronRuby installing the activerecord gem:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_OqCZhp9yI0Q/Sx9Py6Z2VkI/AAAAAAAAANw/UxvxdKdBEk0/s1600-h/image8.png" target="_blank"&gt;&lt;img style="display: inline; margin-left: 0px; margin-right: 0px" title="image" alt="image" src="http://lh6.ggpht.com/_OqCZhp9yI0Q/Sx9P0XnNYUI/AAAAAAAAAN8/c3oXFsgZNwQ/image_thumb6.png?imgmax=800" width="400" height="110" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Yay =P I spoke in-depth about this at &lt;a href="http://en.oreilly.com/oscon2009" target="_blank"&gt;OSCON&lt;/a&gt; this year, so if you’re interested in how IronRuby runs cross-platform, please read my &lt;a href="http://blog.jimmy.schementi.com/2009/07/ironruby-at-oscon-2009-mono-moonlight.html" target="_blank"&gt;OSCON 2009 post&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;While &lt;font color="#ff8000"&gt;“IronRuby running everywhere”&lt;/font&gt; is a great bullet-point, when would you use it instead of another implementation? I’ll briefly mention a few Windows-focused reasons, but the focus will be on things that work regardless of your platform.&lt;/p&gt;  &lt;p&gt;One of IronRuby’s goals is to be the premiere Ruby implementation for Windows. Any type of development possible on Windows should be great on IronRuby; GUI, console, DirectX, etc. And some of these benefits also go cross-platform; for example using .NET’s WinForms for GUI apps will let you run the same app on Window and Linux.&lt;/p&gt;  &lt;p&gt;Even systems management tasks can benefit from IronRuby – a scripting language that Windows developers can use for anything – like all the languages that come standard on Mac OS and Linux distributions.&lt;/p&gt;  &lt;p&gt;Web developers can also use IronRuby to deploy their Ruby-based apps on: IIS is a great web-server, and IronRuby will make it easy for Windows shops to justify using Ruby on Rails or any other Ruby-based web framework. An interesting factoid: &lt;strong&gt;&lt;font color="#ff8000"&gt;51% of traffic on wiki.rubyonrails.org is from Windows users&lt;/font&gt;&lt;/strong&gt; (data source: &lt;a href="http://merbist.com/" target="_blank"&gt;Matt Aimonetti&lt;/a&gt; and the Rails Core Team) – I’m not quite sure what that means, but at a minimum it means people who have an interest in Rails are using Windows.&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Ruby in the browser&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;One of the great features of IronRuby is it’s ability to run in the browser. Unfortunately there isn’t a ton of information about how to do this, but a nice set of documentation is being prepared for when the new IronRuby site goes live. Here’s a sneak peak into how easy it is to run Ruby in the browser:&lt;/p&gt; &lt;script src="http://gist.github.com/252173.js?file=hello.html"&gt;&lt;/script&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;The code in the “text/ruby” script-tag is actually running in the browser&lt;/font&gt;&lt;/strong&gt; -- it's &lt;b&gt;not&lt;/b&gt; sending the code to the server or anything like that. Ruby can be used to build HTML-only apps (&lt;a href="http://blog.jimmy.schementi.com/2008/08/walk-through-silverlight-flickr-client.html" target="_blank"&gt;an Flickr photoviewer example walkthrough&lt;/a&gt;), full vector-graphics-based apps (&lt;a href="http://ironruby.com/tutorial" target="_blank"&gt;the IronRuby tutorial&lt;/a&gt;), or a combination of both. These apps can also be run out of the browser; &lt;a href="http://blog.jimmy.schementi.com/2009/06/ironruby-tutorial.html" target="_blank"&gt;this post shows the above tutorial running as a native Windows desktop app&lt;/a&gt;. In the browser, this requires &lt;a href="http://microsoft.com/silverlight" target="_blank"&gt;Silverlight&lt;/a&gt; for Mac OS and Windows, or &lt;a href="http://go-mono.com/moonlight-beta/" target="_blank"&gt;Moonlight&lt;/a&gt; for Linux.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Great, it’s easy, but what can I do with it?&lt;/font&gt; &lt;/strong&gt;Right now, the best source of documentation for this is my &lt;a href="http://ironruby.com/browser/sl-back-to-just-text.pdf" target="_blank"&gt;Back to Just-Text with Silverlight&lt;/a&gt; paper. A place-holder page for where all this info will be is &lt;a href="http://ironruby.com/browser" target="_blank"&gt;http://ironruby.com/browser&lt;/a&gt;, but like I said, there is much more to come. The &lt;a href="http://www.visitmix.com/Labs/gestalt/" target="_blank"&gt;Gestalt project&lt;/a&gt; has a ton of cool samples and information as well, but most of this will eventually live on the actual IronRuby website.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;For demos I showed during the talk, see &lt;a href="http://github.com/jschementi/rubyconf2009/tree/master/gestalt" target="_blank"&gt;http://github.com/jschementi/rubyconf2009/tree/master/gestalt&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;font color="#ff8000"&gt;Other than this being some cool technology, how could it actually be useful?&lt;/font&gt;&lt;/b&gt; I &lt;em&gt;would not&lt;/em&gt; recommend porting all your JavaScript to this, but this is useful anywhere you need to show graphs, charts, anything visually oriented, or really anything where the browser feature-set isn’t enough. Rather than writing in ActionScript for Flash, you could use Ruby and Silverlight. Once you have a good reason to require Silverlight for a page, then it opens up the possibilities for using Ruby in the browser for things you used to use JavaScript for. For example, imagine writing both your server and client code in Ruby, and even reusing code between the two.&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;It may not be the only way to run Ruby in the browser, but it’s the most web-friendly.&lt;/strong&gt;&lt;/font&gt; It’s worth noting that JRuby lets you write &lt;a href="http://github.com/hakunin/jruby-applet" target="_blank"&gt;Ruby inside a Java applet&lt;/a&gt;, but that requires Java to be installed. While Java still has more market-penetration than Silverlight, Silverlight’s tiny size makes this an irrelevant point for me. Also, &lt;a href="http://arstechnica.com/microsoft/news/2009/11/silverlight-4-beta-arrives-for-developers.ars" target="_blank"&gt;Silverlight is installed on 45% of the connected internet machines&lt;/a&gt;, so Silverlight’s market share is briskly increasing.&lt;/p&gt;  &lt;p&gt;Also, &lt;a href="http://hotruby.yukoba.jp/" target="_blank"&gt;HotRuby&lt;/a&gt; lets you write Ruby which compiles down to JavaScript or Flash, and while the demos are very impressive, the implementation is &lt;strong&gt;very not &lt;/strong&gt;completed, and hasn’t been updated for almost two years. HotRuby requires the Ruby source code to be compiled on the server with YARV, and then the serialized bytecode is run on the client with a JavaScript VM for Ruby (which is the incomplete part). It’s a promising project if someone picks it back up.&lt;/p&gt;  &lt;p&gt;Considering those alternatives, IronRuby’s script-tag development and just-html deployment make it the best experience for writing Ruby browser apps currently.&lt;/p&gt;  &lt;p&gt;Anyway, I’ll write more about this when I can point you at a real website that shows what all this can really do.&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;Next stop,&lt;em&gt; &lt;/em&gt;&lt;/strong&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-part-3-sneaking-ruby.html" target="_blank"&gt;&lt;strong&gt;&lt;em&gt;sneaking&lt;/em&gt; Ruby to the top&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=_HE1ql-8SPg:0UG2aRwGXbY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=_HE1ql-8SPg:0UG2aRwGXbY:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=_HE1ql-8SPg:0UG2aRwGXbY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=_HE1ql-8SPg:0UG2aRwGXbY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=_HE1ql-8SPg:0UG2aRwGXbY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=_HE1ql-8SPg:0UG2aRwGXbY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=_HE1ql-8SPg:0UG2aRwGXbY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/_HE1ql-8SPg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/_HE1ql-8SPg/ironruby-rubyconf-2009-part-2-what-sets.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_OqCZhp9yI0Q/Sx9P0XnNYUI/AAAAAAAAAN8/c3oXFsgZNwQ/s72-c/image_thumb6.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-2-what-sets.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-74313311577101095</guid><pubDate>Wed, 09 Dec 2009 06:39:00 +0000</pubDate><atom:updated>2009-12-15T15:55:38.839-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ruby</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">rubyconf</category><title>IronRuby @ RubyConf 2009 – Part 1: Summary</title><description>&lt;em&gt;This is part of a RubyConf 2009 series:&lt;/em&gt;   &lt;br /&gt;&lt;strong&gt;Summary&lt;/strong&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-2-what-sets.html" target="_blank"&gt;What sets IronRuby apart?&lt;/a&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-part-3-sneaking-ruby.html" target="_blank"&gt;Sneaking Ruby to the top&lt;/a&gt; / &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-35.html" target="_blank"&gt;Embedding IronRuby&lt;/a&gt; | &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-4-project.html" target="_blank"&gt;Project status&lt;/a&gt;   &lt;p&gt;Now that the turkey has settled and I’m back in Seattle, I’m finally getting around to writing about my time at &lt;a href="http://rubyconf.org" target="_blank"&gt;RubyConf 2009&lt;/a&gt; in &lt;a href="http://www.bing.com/maps/#JmNwPTM3LjY3OTY2Njg3Njc5MjkxNX4tMTIyLjM4NTA2NDczNjAwODY0Jmx2bD0xMSZzdHk9ciZydHA9cG9zLjM3LjU4MDE3MzY4NjE0NjczNl8tMTIyLjM1MDQ2MDIxNjQwMzAxX0J1cmxpbmdhbWUlMkMlMjBDQV9fX2VffnBvcy4zNy43NzkxNjAwNjc0MzkwOF8tMTIyLjQyMDA0OTQ1ODc0MjE0X1NhbiUyMEZyYW5jaXNjbyUyQyUyMENBX19fZV8mcnRvcD0wfjB+MH4=" target="_blank"&gt;Burlingame, CA&lt;/a&gt; (&lt;strong&gt;&lt;a href="http://www.bing.com/maps/#JmNwPTM3LjY3OTY2Njg3Njc5MjkxNX4tMTIyLjM4NTA2NDczNjAwODY0Jmx2bD0xMSZzdHk9ciZydHA9cG9zLjM3LjU4MDE3MzY4NjE0NjczNl8tMTIyLjM1MDQ2MDIxNjQwMzAxX0J1cmxpbmdhbWUlMkMlMjBDQV9fX2VffnBvcy4zNy43NzkxNjAwNjc0MzkwOF8tMTIyLjQyMDA0OTQ1ODc0MjE0X1NhbiUyMEZyYW5jaXNjbyUyQyUyMENBX19fZV8mcnRvcD0wfjB+MH4=" target="_blank"&gt;not San Francisco&lt;/a&gt;&lt;/strong&gt;, &lt;a href="http://rubyconf.org/" target="_blank"&gt;liars&lt;/a&gt;! ;)). I spoke about IronRuby, got to meet a bunch of the other implementers, and overall had a great time. &lt;a href="http://github.com/jredville" target="_blank"&gt;Jim Deville&lt;/a&gt; also got to come along for free, since Microsoft was a Silver sponsoring of RubyConf – next year we should sponsor the internet-connections since everyone using Chad’s room’s wireless was, well, fun … but no promises ;)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.flickr.com/photos/jdeville/4167967539/" target="_blank"&gt;&lt;img style="display: inline" title="4167967539_e7d1e43df3_b" alt="4167967539_e7d1e43df3_b" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/Sx9GJQci_sI/AAAAAAAAANk/xqb-WepnDQs/4167967539_e7d1e43df3_b%5B10%5D.jpg?imgmax=800" width="278" height="393" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;My talk was all about how IronRuby is extending the reach of Ruby. The two areas I focused on was “&lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-2-what-sets.html" target="_blank"&gt;running in the browser&lt;/a&gt;” and “scripting existing applications.” And all that was sandwiched with a overview of the project and a status update. All content from the talk can be found in my &lt;a href="http://github.com/jschementi/rubyconf2009" target="_blank"&gt;RubyConf 2009 GitHub repo&lt;/a&gt;, but I’ll walk you through the talk with a couple of posts:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-2-what-sets.html" target="_blank"&gt;What sets IronRuby apart? (brief highlight of Silverlight support)&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-part-3-sneaking-ruby.html" target="_blank"&gt;Sneaking Ruby to the top&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-35.html" target="_blank"&gt;Embedding IronRuby&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-4-project.html" target="_blank"&gt;Project status&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;em&gt;&lt;a href="http://github.com/jschementi/rubyconf2009/raw/master/jimmysch-ironruby.pdf" target="_blank"&gt;Here’s a direct-link to slides if you want them&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Everyone else’s talks&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;Here’s my strategy for attending talks: open laptop and code until the speaker catches my attention. When bored, go back to coding, and repeat. I got nothing done at RubyConf; irritating and refreshing at the same time. Maybe it was the shotty wireless, but I’ll stick with saying the talks were awesome. Here’s what I liked:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Keynote - &lt;strong&gt;Yukihiro Matsumoto&lt;/strong&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Matz outlined a new language called ZEPT: A general-purpose dynamic language which is great for distributed programming and metaprogramming. After explaining this very familiar language in some detail, he then turned it around and essentially said, “Wait, it’s Ruby! Kinda.” &lt;/p&gt;  &lt;p&gt;While Ruby’s syntax is great for metaprogramming and DSLs, it needs work for distributed programming to be really great, but this is being worked on. Ruby currently has most of the building blocks for distributed programming, like lambdas, enumerators, and continuations, and things like a lazy-array are planned for future versions of Ruby. He closed with, “You can create the future of programming by working on Ruby,” and that there are more advances in internal DSLs in Ruby’s future.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rubyconf.org/talks/83-code-of-art"&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Code of Art&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt; (Jeff Casimir)&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Jeff handed out &lt;a href="http://github.com/jcasimir/code_of_art/raw/master/documents/Code%20of%20Art%20-%20Tutorial.pdf" target="_blank"&gt;actual paper&lt;/a&gt; for his talk, so he gets props for that. He &lt;a href="http://github.com/jcasimir/code_of_art" target="_blank"&gt;demoed&lt;/a&gt; &lt;a href="http://github.com/jashkenas/ruby-processing" target="_blank"&gt;ruby-processing&lt;/a&gt;, a port of the Java Processing library for making fancy graphics and visualizations; it uses JRuby. The main demo was a very simple “click-and-make-a-random-sized-circle” … so simple I had to rip it off for my talk. So, I sent Jim off with &lt;a href="http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-35.html" target="_blank"&gt;my demo&lt;/a&gt; to &lt;a href="http://github.com/jschementi/rubyconf2009/blob/master/sketchscript/features/circles.rb" target="_blank"&gt;hack it up&lt;/a&gt;, and now we’re close to having a full 2D-only-port of ruby-processing for IronRuby. More about that later though.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rubyconf.org/talks/126-ffi-creating-cross-engine-gems"&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;FFI – creating cross engine gems&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt; (Jeremy Hinegardner)&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://github.com/ffi/ffi" target="_blank"&gt;FFI, Foreign Function Interface&lt;/a&gt;, is a DSL for describing C-libraries in Ruby; very similar to writing a header file. A benefit of using writing an C-extension based on FFI is that it should be compatible with many ruby engines, as the compatibility burden is placed on the ruby engine rather than the extension implementer. Supporting FFI will be a reality for IronRuby after 1.0; I’ll put this on the project’s TODO list. Anyone interested in starting an FFI implementation for IronRuby?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rubyconf.org/talks/121-embracing-collaboration-with-j-ruby-and-java-script"&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Embracing Collaboration with JRuby and JavaScript&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;(Jon Crosby)&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Jon’s talk got me smiling, since it’s the same problem I tried to solve with &lt;a href="http://schementi.com/silverline" target="_blank"&gt;IronRuby on the client and server&lt;/a&gt;, but decided a Rails-specific solution was just good for a demo. He started his talk out with “browser plugins are not an option” … crap =P. Jon walked through his design process, until landing on a solution that basically cuts Ruby out completely and uses JavaScript to build both the client and the server portions of a webapp, sharing implementations and data. Wow, that’s one way to do it. :)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rubyconf.org/talks/64-j-ruby-everywhere-"&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;JRuby Everywhere!&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;(Charles Nutter &amp;amp; Thomas Enebo)&lt;/font&gt; &lt;/strong&gt;– &lt;a href="http://jruby.kenai.com/presentations/RubyConf%202009%20-%20JRuby.pdf" target="_blank"&gt;slides&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rubyconf.org/talks/142-mac-ruby-ruby-for-your-mac"&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;MacRuby: Ruby for your Mac&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt; (Laurent Sansonetti)&lt;/font&gt;&lt;/strong&gt; – &lt;font color="#ff0000"&gt;&lt;strong&gt;slides?&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rubyconf.org/talks/21-rubinius-in-one-act-or-rubinius-a-war-on-two-fronts"&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Rubinius in One Act OR Rubinius: A War on Two Fronts&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt; (Evan Phoenix)&lt;/font&gt;&lt;/strong&gt; – &lt;a href="http://www.slideshare.net/evanphx/rubyconf-2009" target="_blank"&gt;slides&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rubyconf.org/talks/42-rippin-off-python"&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Rippin’ off Python&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt; (Chris Wanstrath)&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I actually didn’t get to see this since it was at the same time as my talk. I saw someone say on Twitter that this was one of the best attended talk at RubyConf. Jerk :)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rubyconf.org/talks/65-ruby-mutants"&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Ruby Mutants&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt; (Charles Nutter)&lt;/font&gt;&lt;/strong&gt; – &lt;a href="http://jruby.kenai.com/presentations/RubyConf%202009%20Duby.pdf" target="_blank"&gt;slides&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Charlie talked about &lt;a href="http://www.github.com/headius/duby" target="_blank"&gt;Duby&lt;/a&gt; and Surinx, his Ruby-derivatives. Duby is a statically typed Ruby-like language, while Surinx is a dynamic-typed language which depends on &lt;a href="http://jcp.org/en/jsr/detail?id=292" target="_blank"&gt;invokedynamic&lt;/a&gt;. Duby’s nice in that it’s not very JVM-specific (other than the backend), so an upcoming project of mine will be to write a CLR backend for this – having a Ruby-like language that is basically a facade on the CLR will fill in a lot of the holes we have with IronRuby, and hopefully influence some future IronRuby work – just like JRuby is planning.&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Other Thoughts&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;No implementers care about Ruby 1.8.6 anymore; Ruby 1.9 is the focus for all future work. MacRuby isn’t even supporting 1.8.6. So why should IronRuby support it? Granted, JRuby supports 1.8.6, as well as other 1.9 features, but they have been a “real” implementation for a while. When IronRuby actually starts to get production apps, do we really think Rails 3.0 (which is Ruby 1.9 focused) won’t be standard by then? Personally I think IronRuby should re-evaluate it’s reasons for supporting Ruby 1.8.6; if we support 1.9, compatibility will get better as time goes on … where as supporting 1.8.6 is a sure-fire way to ensure a decrease level of compatibility in the future if we don’t keep up. Thoughts?&lt;/p&gt;  &lt;p&gt;Also I got to meet &lt;a href="http://merbist.com/" target="_blank"&gt;Matt Aimonetti&lt;/a&gt;, of the &lt;a href="http://www.rubyrailways.com/rails-is-still-a-ghetto/" target="_blank"&gt;“Pr0n Star” fiasco&lt;/a&gt;, but I’ll let that slide :) He’s seems genuinely excited about using Ruby in the browser with Silverlight, and also has always offered his help with promoting &lt;a href="http://ironruby.net/Documentation/Rails" target="_blank"&gt;IronRuby on Rails&lt;/a&gt;; he &lt;a href="http://weblog.rubyonrails.org/2009/8/11/community-highlights-ironruby" target="_blank"&gt;interviewed me on the Rails blog&lt;/a&gt; not too long ago. I look forward to seeing greater collaboration between the rest of the Ruby community on IronRuby, and hopefully this is the start.&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Overall it was a blast, see you all next year!!&lt;/font&gt;&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;&lt;a href="http://www.flickr.com/photos/jdeville/4168730340/" target="_blank"&gt;&lt;img src="http://farm3.static.flickr.com/2553/4168730340_4e5f584c7f.jpg" width="400" height="266" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=NbK_AOlidB4:XWMIDzTVdi8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=NbK_AOlidB4:XWMIDzTVdi8:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=NbK_AOlidB4:XWMIDzTVdi8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=NbK_AOlidB4:XWMIDzTVdi8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=NbK_AOlidB4:XWMIDzTVdi8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=NbK_AOlidB4:XWMIDzTVdi8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=NbK_AOlidB4:XWMIDzTVdi8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/NbK_AOlidB4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/NbK_AOlidB4/ironruby-rubyconf-2009-part-1-summary.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_OqCZhp9yI0Q/Sx9GJQci_sI/AAAAAAAAANk/xqb-WepnDQs/s72-c/4167967539_e7d1e43df3_b%5B10%5D.jpg?imgmax=800" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/12/ironruby-rubyconf-2009-part-1-summary.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-1998078639790741178</guid><pubDate>Mon, 07 Dec 2009 21:29:00 +0000</pubDate><atom:updated>2009-12-07T13:30:36.520-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IronPython</category><category domain="http://www.blogger.com/atom/ns#">Website</category><title>IronPython gets a long overdue website!</title><description>&lt;p align="left"&gt;In preparation for the &lt;a href="http://ironpython.net/download/" target="_blank"&gt;final IronPython 2.6 release&lt;/a&gt;, the project finally gets a nice homepage: &lt;a href="http://ironpython.net" target="_blank"&gt;&lt;strong&gt;IronPython.net&lt;/strong&gt;&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironpython.net" target="_blank"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh4.ggpht.com/_OqCZhp9yI0Q/Sx1zp94rEZI/AAAAAAAAANU/O9hFVBdxEBQ/image%5B7%5D.png?imgmax=800" width="400" height="253" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://ironpython.codeplex.com" target="_blank"&gt;CodePlex&lt;/a&gt; will continue to be the tool we use for project management and releases, but all end-user information will be on &lt;a href="http://ironpython.net" target="_blank"&gt;IronPython.net&lt;/a&gt;. Also, the .com domain still points at the super-old site, but will redirect to this site shortly.&lt;/p&gt;  &lt;p&gt;The most notably addition is the &lt;a href="http://ironpython.net/documentation/dotnet/" target="_blank"&gt;.NET Integration Documentation&lt;/a&gt;, a thorough set of examples and descriptions of using IronPython with .NET. Considering this is IronPython’s main purpose, it’s amazing we got away with having hardly no documentation for this long … I guess the .NET integration is just that intuitive :) Anyway, please give it a read and let us know if you have any suggestions.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;There’s a ton left to do!&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;This site is very much a shell of what it could be, and I’d love for the IronPython community to help out here. Here are a few things I’d like to add to the site in the very near future; please let me know if you’d lie to help out, or have other ideas:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;em&gt;&lt;strong&gt;Who’s using IronPython?&lt;/strong&gt;&lt;/em&gt; A list of companies, public websites, and any type of application which use IronPython, in any way, would be a great addition to the site. If you’re taking a large dependency on IronPython, I’d also love to have a more in-depth write up posted about you: &lt;a href="http://www.resolversystems.com" target="_blank"&gt;Resolver Systems&lt;/a&gt; should definitely be on this list :) &lt;/li&gt;    &lt;li&gt;&lt;em&gt;&lt;strong&gt;Many more code-snippets for the front-page which show IronPython’s strengths&lt;/strong&gt;&lt;/em&gt;. Maybe a random code snippet every time you refresh, or a auto-cycling with some simple navigation to pause and go back-and-forth between them. &lt;/li&gt;    &lt;li&gt;&lt;em&gt;&lt;strong&gt;Better organization of community articles&lt;/strong&gt;&lt;/em&gt;: the IronPython community produces an enormous amount of documentation through blogs, articles, screencasts, and other mediums on the web. The IronPython website could never replicate this, so let’s make it a place to organize this information, grouping documentation together by topic and linking to the original author’s site. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Hope you like the new website!&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=5dfQFm3awLw:rpaz9XvtgIA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=5dfQFm3awLw:rpaz9XvtgIA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=5dfQFm3awLw:rpaz9XvtgIA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=5dfQFm3awLw:rpaz9XvtgIA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=5dfQFm3awLw:rpaz9XvtgIA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=5dfQFm3awLw:rpaz9XvtgIA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=5dfQFm3awLw:rpaz9XvtgIA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/5dfQFm3awLw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/5dfQFm3awLw/ironpython-gets-long-overdue-website.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_OqCZhp9yI0Q/Sx1zp94rEZI/AAAAAAAAANU/O9hFVBdxEBQ/s72-c/image%5B7%5D.png?imgmax=800" height="72" width="72" /><thr:total>5</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/12/ironpython-gets-long-overdue-website.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-6825820697040619507</guid><pubDate>Wed, 11 Nov 2009 09:05:00 +0000</pubDate><atom:updated>2009-11-11T01:05:18.388-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Embedding</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><title>Embedding IronPython in Silverlight - Importing</title><description>&lt;p&gt;I’ve heard plenty of times on the &lt;a href="http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011606.html" target="_blank"&gt;IronPython Mailing List&lt;/a&gt; that embedding IronPython in Silverlight is easy at first, but then you fall off a cliff when trying to import, be it from a .NET namespace, the Python built-ins, or even other Python files. Let me clear some things up, and fix some code in the process.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Slight detour – Embedding in Silverlight 101&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;First off, Michael Foord has an article on his website about &lt;a href="http://www.voidspace.org.uk/ironpython/silverlight/embedding_ironpython.shtml" target="_blank"&gt;Embedding IronPython in Silverlight&lt;/a&gt;, which still works. However, that’s a ton of complicated code, all having to do with creating a &lt;code&gt;ScriptRuntime&lt;/code&gt; instance correctly configured for Silverlight. To make this much less verbose, &lt;code&gt;DynamicEngine.CreateRuntime&lt;/code&gt; (in the &lt;code&gt;Microsoft.Scripting.Silverlight &lt;/code&gt;namespace) will create a &lt;code&gt;ScriptRuntime&lt;/code&gt; all prepped for use in Silverlight; this significantly reduces the boilerplate hosting code:&lt;/p&gt; &lt;script src="http://gist.github.com/231540.js"&gt;&lt;/script&gt;  &lt;p&gt;In case you need to customize your &lt;code&gt;ScriptRuntime&lt;/code&gt;, the &lt;code&gt;DynamicEngine.CreateRuntimeSetup&lt;/code&gt; method is there to create a &lt;code&gt;ScriptRuntimeSetup&lt;/code&gt; object configured for Silverlight, which then you can tweak things as necessary and create your own &lt;code&gt;ScriptRuntime&lt;/code&gt;.&lt;/p&gt; &lt;script src="http://gist.github.com/231772.js"&gt;&lt;/script&gt;  &lt;p&gt;&lt;em&gt;Note: The IronPython sources currently are &lt;strong&gt;broken&lt;/strong&gt; for embedding, but in the next few days the sources should reflect what this post shows.&lt;/em&gt;&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Testing that "import" works&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Ok, great, the boilerplate hosting code doesn’t need to look hideous, but let’s get back on track.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://jimmy.schementi.com/silverlight/embedding-ipy" target="_blank"&gt;&lt;img style="display: block; float: none; margin-left: auto; margin-right: auto" title="Embedding IronPython in Silverlight - Importing test" alt="Embedding IronPython in Silverlight - Importing test" src="http://lh6.ggpht.com/_OqCZhp9yI0Q/Svp-TQ-aWJI/AAAAAAAAANM/t4O3o71LlG4/ipy-sl-embed-import-test%5B7%5D.png?imgmax=800" width="400" height="260" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://jimmy.schementi.com/silverlight/embedding-ipy" target="_blank"&gt;Embedding IronPython in Silverlight – importing test&lt;/a&gt; (&lt;a href="http://github.com/jschementi/orphanage/tree/master/embedding-ipy/" target="_blank"&gt;sources&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;Here’s a quick test of IronPython’s ability to import various modules in Silverlight, testing this exact code works while being embedded:&lt;/p&gt; &lt;script src="http://gist.github.com/231783.js"&gt;&lt;/script&gt;  &lt;p&gt;None of these worked when I first wrote the tests, since there was an exception being thrown in the XAP-virtual-filesystem, &lt;a href="http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011606.html" target="_blank"&gt;reported yesterday on the IronPython mailing list&lt;/a&gt;. But with that fixed, the &lt;code&gt;import bar.baz&lt;/code&gt; case still failed:&lt;/p&gt;  &lt;pre style="background-color: #333; color: white; padding: 5px;"&gt;[FAIL]
Traceback (most recent call last):
  at test_import in foo.py, line 5
ImportError: No module named bar.baz&lt;/pre&gt;

&lt;p&gt;Here's the layout of the Python files in the XAP&lt;/p&gt;

&lt;pre style="background-color: #333; color: white; padding: 5px;"&gt;foo.py
bar/
bar/__init__.py
bar/baz.py&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;Application.GetResourceStream(&amp;quot;bar/__init__.py&amp;quot;)&lt;/code&gt; was returning &lt;code&gt;null&lt;/code&gt;, though &lt;code&gt;bar/__init__.py&lt;/code&gt; was definitely inside the XAP. However, &lt;code&gt;bar/__init__.py&lt;/code&gt; was empty, and it turns out that &lt;code&gt;Application.GetResourceStream&lt;/code&gt; returns &lt;code&gt;null&lt;/code&gt; if the file is empty as well as if it doesn’t exist! Putting a single space in &lt;code&gt;bar/__init__.py&lt;/code&gt; (or anything that will make the file not empty … I suggest a comment) causes it to be found, and then &lt;code&gt;bar/baz.py&lt;/code&gt; can be imported properly.&lt;/p&gt;

&lt;p&gt;So, moral of the story:&lt;br /&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;“an empty file in the XAP is a non-existent file!”&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;Anyway, I hope that clears up some of the issues most people initially face with embedding IronPython in Silverlight. Let me know if there are any more issues.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: As I said before, the current IronPython sources are broken for embedding, but in the next few days the sources should reflect what this post shows. &lt;a href="http://github.com/jschementi/orphanage/tree/master/embedding-ipy/Dependencies/" target="_blank"&gt;If you’re impatient, grab these binaries&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=Gm6B-9tu5LY:XkhUPv-Gyyo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=Gm6B-9tu5LY:XkhUPv-Gyyo:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=Gm6B-9tu5LY:XkhUPv-Gyyo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=Gm6B-9tu5LY:XkhUPv-Gyyo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=Gm6B-9tu5LY:XkhUPv-Gyyo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=Gm6B-9tu5LY:XkhUPv-Gyyo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=Gm6B-9tu5LY:XkhUPv-Gyyo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/Gm6B-9tu5LY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/Gm6B-9tu5LY/embedding-ironpython-in-silverlight.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_OqCZhp9yI0Q/Svp-TQ-aWJI/AAAAAAAAANM/t4O3o71LlG4/s72-c/ipy-sl-embed-import-test%5B7%5D.png?imgmax=800" height="72" width="72" /><thr:total>5</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/11/embedding-ironpython-in-silverlight.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-6818404913992991051</guid><pubDate>Thu, 22 Oct 2009 09:20:00 +0000</pubDate><atom:updated>2009-10-22T02:28:06.361-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dynamic Languages</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">Visual Studio</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><title>IronRuby and IronPython for .NET 4.0 Beta 2</title><description>&lt;p&gt;Quick download links: &lt;a href="http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33305"&gt;IronRuby&lt;/a&gt; | &lt;a href="http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28125"&gt;IronPython&lt;/a&gt; | &lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;.NET 4.0 Beta 2&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="IronRuby and IronPython in .NET 4.0" border="0" alt="IronRuby and IronPython in .NET 4.0" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/SuAjvpky3II/AAAAAAAAAMs/8q2A49l6gZ0/irb-ipy-dotnet-beta2%5B8%5D.png?imgmax=800" width="360" height="323" /&gt; &lt;/p&gt;  &lt;p&gt;I’m pleased to announce the release of the &lt;b&gt;IronRuby and IronPython CTPs for .NET 4.0 Beta 2&lt;/b&gt;. This is the third preview of IronRuby and IronPython running under &lt;a href="http://dlr.codeplex.com/"&gt;the Dynamic Language Runtime&lt;/a&gt; that is built directly into .NET 4.0. As before, this release allows you to use IronRuby objects and types as .NET 4.0 dynamic objects from within C# and Visual Basic code. These binaries are roughly equivalent to the functionality found in IronRuby 0.9 and IronPython 2.6 RC. Take a look at &lt;a href="http://devhawk.net" target="_blank"&gt;Harry Pierson&lt;/a&gt;’s &lt;a href="http://devhawk.net/2009/10/21/IronPython+And+IronRuby+CTPs+For+NET+40+Beta+2.aspx" target="_blank"&gt;blogpost about this release&lt;/a&gt; as well, especially if you’re more into snakes than gemstones.&lt;/p&gt;  &lt;p&gt;Here's a small example showing just how powerful the new dynamic feature is for taking advantage of dynamic language functionality in statically typed languages:&lt;/p&gt; &lt;script src="http://gist.github.com/215817.js"&gt;&lt;/script&gt;  &lt;p&gt;&lt;font color="#ff8000"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://gist.github.com/215819" target="_blank"&gt;Here is the IronPython version as well&lt;/a&gt;. It basically loads up the desired scripting engine (in this case, Ruby), loads a script, instantiates the “Mock” class defined in the script, and calls a method on an instance of “Mock” which the C# compiler cannot possibly know of; the Mock class dynamically responds to any method call with a random result. The “dynamic” keyword indicates that the C# compiler should use the DLR to dispatch method calls at runtime, rather than trying to validate the method calls at compile time. This enables a very clean integration between dynamic languages and static languages, and even gives you the ability to define your own dynamic objects. &lt;a href="http://blogs.msdn.com/cburrows/" target="_blank"&gt;Chris Burrows&lt;/a&gt; has a great &lt;a href="http://blogs.msdn.com/cburrows/archive/tags/dynamic/default.aspx" target="_blank"&gt;blog series on how C# “dynamic” works&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Try it out&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;To try out this release:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx" target="_blank"&gt;Install NET 4.0 Beta 2 or Visual Studio 2010 Beta 2&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Download either &lt;a href="http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33305" target="_blank"&gt;IronRuby&lt;/a&gt; or &lt;a href="http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28125" target="_blank"&gt;IronPython&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Follow any of the many dynamic walkthroughs online. &lt;a href="http://blogs.msdn.com/vbteam/archive/2008/12/17/walkthrough-dynamic-programming-in-visual-basic-10-0-and-c-4-0-lisa-feigenbaum.aspx" target="_blank"&gt;This would be a good start&lt;/a&gt;. &lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Build from source&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;To build IronPython or IronRuby for .NET 4.0 Beta 2 from source, get the sources from:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;IronPython: &lt;a href="http://ironpython.codeplex.com/SourceControl/ListDownloadableCommits.aspx" target="_blank"&gt;CodePlex&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;IronRuby: &lt;a href="http://github.com/ironruby/ironruby" target="_blank"&gt;GitHub&lt;/a&gt; (&lt;a href="http://github.com/ironruby/ironruby/zipball/master" target="_blank"&gt;direct download&lt;/a&gt;) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Note: use the &amp;quot;v4&amp;quot; build configurations.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Caveats&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Being a “preview” release, these releases haven’t gone through the usual testing that the normal binary releases go through. However, both IronRuby and IronPython will be supported on .NET 4.0 when it ships for real. Also note that the these releases will run only under .NET 4.0 Beta 2.&lt;/p&gt;  &lt;p&gt;There is no project-system integration between IronRuby and IronPython in Visual Studio 2010 Beta 2, so don’t expect to find File-&amp;gt;New Project-&amp;gt;IronPython or something like that; this release is just about the integration between .NET 4.0 and &lt;a href="http://dlr.codeplex.com" target="_blank"&gt;DLR&lt;/a&gt;-based languages. If you’d like that to not be the case, please continue to let Microsoft know that on the open &lt;a href="http://connect.microsoft.com"&gt;http://connect.microsoft.com&lt;/a&gt; issues for &lt;a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=479957" target="_blank"&gt;IronRuby&lt;/a&gt; and &lt;a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=475830" target="_blank"&gt;IronPython&lt;/a&gt; Visual Studio 2010 integration.&lt;/p&gt;  &lt;p&gt;If you find any issues, please report them on the language’s respective CodePlex sites (&lt;a href="http://ironpython.codeplex.com/WorkItem/Create.aspx"&gt;IronPython&lt;/a&gt; | &lt;a href="http://ironruby.codeplex.com/WorkItem/Create.aspx"&gt;IronRuby&lt;/a&gt;).&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=bnkxTtUea-s:ELBYimgQbMg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=bnkxTtUea-s:ELBYimgQbMg:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=bnkxTtUea-s:ELBYimgQbMg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=bnkxTtUea-s:ELBYimgQbMg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=bnkxTtUea-s:ELBYimgQbMg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=bnkxTtUea-s:ELBYimgQbMg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=bnkxTtUea-s:ELBYimgQbMg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/bnkxTtUea-s" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/bnkxTtUea-s/ironruby-and-ironpython-ctps-for-net-40.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_OqCZhp9yI0Q/SuAjvpky3II/AAAAAAAAAMs/8q2A49l6gZ0/s72-c/irb-ipy-dotnet-beta2%5B8%5D.png?imgmax=800" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/10/ironruby-and-ironpython-ctps-for-net-40.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-8365420027701416090</guid><pubDate>Sun, 02 Aug 2009 00:54:00 +0000</pubDate><atom:updated>2009-08-03T13:53:45.286-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">OSCON</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">Release</category><title>IronRuby 0.9 Released!</title><description>&lt;p align="center"&gt;&lt;a href="http://lh5.ggpht.com/_OqCZhp9yI0Q/SnTjqaLzSeI/AAAAAAAAALw/bHORChmv7yk/s1600-h/ir-logo-white%5B4%5D.jpg"&gt;&lt;img style="display: inline" title="ir-logo-white" alt="ir-logo-white" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/SnTjqyQdzqI/AAAAAAAAAL0/CbgKyPqQXao/ir-logo-white_thumb%5B2%5D.jpg?imgmax=800" width="400" height="115" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;I'm pleased to announce a new release of IronRuby: 0.9!&lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="5"&gt;&lt;strong&gt;&lt;a href="http://ironruby.net/Download" target="_blank"&gt;Download IronRuby 0.9&lt;/a&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://github.com/ironruby/ironruby/zipball/v0.9.0" target="_blank"&gt;You can also get the source code for this release&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It’s been a long ride since &lt;a href="http://ironruby.net"&gt;IronRuby&lt;/a&gt; was announced at &lt;a href="http://videos.visitmix.com/MIX07/DEV02"&gt;MIX ‘07&lt;/a&gt;, but now all eyes are focused on getting it to 1.0. The &lt;a href="http://blog.jimmy.schementi.com/2009/03/ironruby-03-released.html" target="_blank"&gt;past&lt;/a&gt; &lt;a href="http://blog.jimmy.schementi.com/2009/05/ironruby-05-released.html" target="_blank"&gt;couple&lt;/a&gt; of versions &lt;a href="http://blog.jimmy.schementi.com/2009/07/ironruby-06-released.html" target="_blank"&gt;have made vast compatibility and performance improvements&lt;/a&gt;, and 0.9 marks the last set of &lt;strong&gt;major&lt;/strong&gt; features that will be added to IronRuby. From now on, all IronRuby languages will be primarily focused on bug fixing &lt;strong&gt;and&lt;/strong&gt; anything else the community deems necessary to call IronRuby a 1.0 release. These improvements be delivered as point-point releases (0.9.1, 0.9.2, etc) until &lt;strong&gt;you &lt;/strong&gt;decide it is ready to call 1.0.&lt;/p&gt;  &lt;p&gt;Though IronRuby is breaking away from it’s conference-driven development schedule, this release comes only a week after &lt;a href="http://en.oreilly.com/oscon2009" target="_blank"&gt;OSCON 2009&lt;/a&gt; where I talked about using &lt;a href="http://blog.jimmy.schementi.com/2009/07/ironruby-at-oscon-2009-mono-moonlight.html" target="_blank"&gt;IronRuby with Mono and Moonlight, and scripting open source apps&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000" size="4"&gt;What's in the Release?&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Library performance was a big focus for this release; basically going though the &lt;a href="http://github.com/acangiano/ruby-benchmark-suite" target="_blank"&gt;Ruby Benchmark suite&lt;/a&gt; and making sure any obvious slowness was fixed. As I said in &lt;a href="http://blog.jimmy.schementi.com/2009/07/ironruby-at-oscon-2009-mono-moonlight.html" target="_blank"&gt;my previous post about OSCON&lt;/a&gt;, IronRuby is approximately 2x faster than MRI when running the benchmark suite, but in the near future a complete evaluation of IronRuby’s performance will be done and published on the &lt;a href="http://ironruby.info" target="_blank"&gt;website&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;a href="http://antoniocangiano.com/" target="_blank"&gt;Antonio Cangiano&lt;/a&gt; has already published &lt;a href="http://antoniocangiano.com/2009/08/03/performance-of-ironruby-ruby-on-windows/" target="_blank"&gt;benchmark results between IronRuby 0.9 and Ruby 1.8.6, and things look really good for IronRuby&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;On the compatibility front, the &lt;a href="http://ruby-doc.org/stdlib/libdoc/win32ole/rdoc/classes/WIN32OLE.html" target="_blank"&gt;Win32OLE Ruby library&lt;/a&gt; is now &lt;a href="http://github.com/ironruby/ironruby/blob/v0.9.0/Merlin/Main/Languages/Ruby/Libs/win32ole.rb" target="_blank"&gt;available in IronRuby&lt;/a&gt;. This builds on top of IronRuby’s existing COM interop from version 0.5, letting you script any Windows component/application that exposes a &lt;a href="http://msdn.microsoft.com/en-us/library/ms877981.aspx" target="_blank"&gt;COM&lt;/a&gt; interface. Though it hasn’t been fully tested yet, this will make things like &lt;a href="http://wtr.rubyforge.org/" target="_blank"&gt;Watir&lt;/a&gt; work on IronRuby.&lt;/p&gt;  &lt;p&gt;Lastly, there have been interop improvements with .NET, most notably making Generic types more friendly to all the crazy things Ruby can do to them, and also with other DLR languages, making it really easy to call IronPython from IronRuby.&lt;/p&gt;  &lt;p&gt;For more detailed information, please see the &lt;a href="http://rubyforge.org/frs/shownotes.php?release_id=37484" target="_blank"&gt;CHANGELOG&lt;/a&gt; (which includes all commit messages for the release ... not just &amp;quot;syncing to head of tfs&amp;quot;)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;Want to find out more about the release? Read on:&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="#pytorb"&gt;Calling Python code from Ruby&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="#win32ole"&gt;Win32OLE support&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="#generics"&gt;Rubyizing Generics&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="#notable-changes"&gt;Some more notable changes&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="#bugs09"&gt;Bugs closed&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;h5&gt;&lt;a name="pytorb"&gt;&lt;/a&gt;&lt;font color="#ff8000" size="3"&gt;Calling Python code from Ruby&lt;/font&gt;&lt;/h5&gt;  &lt;p&gt;In an effort to allow Ruby to call Python code easily, IronRuby provides a way to importing files of other DLR languages, giving you access to the DLR scope. Here's a basic usage:&lt;/p&gt; &lt;script src="http://gist.github.com/159528.js"&gt;&lt;/script&gt;  &lt;p&gt;&lt;code&gt;IronRuby#require(path), load(path)&lt;/code&gt; allow you to include script files, just like &lt;code&gt;Kernel#require, #load&lt;/code&gt; except that they execute the given script against a &lt;b&gt;new&lt;/b&gt; &lt;code&gt;Scope&lt;/code&gt; and return it, instead of just returning true/false/nil. If the target is an assembly they return the loaded assembly. Keep in mind you can still use &lt;code&gt;Kernel#require, #load&lt;/code&gt; to use other language's script files, but if the language requires you obtain an object representing that file (in Python it's called a &lt;code&gt;module&lt;/code&gt;) you'll have to get it elsewhere (see below).&lt;/p&gt;  &lt;p&gt;There are other methods to help you use other languages from Ruby:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;code&gt;IronRuby#loaded_scripts&lt;/code&gt; has also been added to returns a dictionary that holds on loaded scripts and their Scopes, in-case you used &lt;code&gt;Kernel#require&lt;/code&gt; to load a script, and need its Scope at a later time. &lt;/li&gt;    &lt;li&gt;&lt;code&gt;IronRuby#loaded_assemblies&lt;/code&gt; returns an array of assemblies already loaded in the current runtime; though this isn’t needed for DLR language interop it makes sense to include along with &lt;code&gt;IronRuby#loaded_scripts&lt;/code&gt;. &lt;/li&gt;    &lt;li&gt;&lt;code&gt;IronRuby#globals&lt;/code&gt; returns the current &lt;code&gt;ScriptRuntime.Globals&lt;/code&gt; scope; this allows you to easily use Python files and work with the modules they define. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Keep in mind these concepts don’t only apply to Python; they can be used with any language that uses first-class scopes.&lt;/p&gt;  &lt;h5&gt;&lt;a name="win32ole"&gt;&lt;/a&gt;&lt;font color="#ff8000" size="3"&gt;Win32OLE support&lt;/font&gt;&lt;/h5&gt;  &lt;p&gt;Since IronRuby 0.1 was released we’ve said &lt;a href="http://ruby-doc.org/stdlib/libdoc/win32ole/rdoc/classes/WIN32OLE.html" target="_blank"&gt;Win32OLE&lt;/a&gt; was not going to be supported, due to the lack of general COM support in the &lt;a href="http://dlr.codeplex.com" target="_blank"&gt;DLR&lt;/a&gt;. However, when the DLR implemented a COM binder for the new &lt;a href="http://msdn.microsoft.com/en-us/library/dd264736(VS.100).aspx" target="_blank"&gt;dynamic feature in C# 4.0&lt;/a&gt;, this allowed IronRuby and IronPython to easily implement COM support. IronRuby 0.5 had this support, but in this release we provided win32ole.rb to implement Ruby’s Win32OLE API. Here’s a simple automation example which opens Excel, adds some data, generates a chart, and rotates the chart. taken from the &lt;a href="http://whytheluckystiff.net/ruby/pickaxe/html/win32.html" target="_blank"&gt;Ruby Pragmatic Programmer’s Guide (aka. the pickaxe book)&lt;/a&gt;, which now works in IronRuby:&lt;/p&gt; &lt;script src="http://gist.github.com/159829.js"&gt;&lt;/script&gt;  &lt;h5&gt;&lt;a name="generics"&gt;&lt;/a&gt;&lt;font color="#ff8000" size="3"&gt;Rubyizing Generics&lt;/font&gt;&lt;/h5&gt;  &lt;p&gt;&lt;em&gt;Note: this feature didn’t make it into 0.9, but it is in the &lt;a href="http://github.com/ironruby/ironruby" target="_blank"&gt;sources&lt;/a&gt; and will be part of 0.9.1&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;IronRuby has great .NET framework integration, so code written with a CLI-based language (C#, VB, F#) can be called from IronRuby, without it feeling like interop. As we work towards a stable 1.0 release and this integration continues to be polished; in this release we most notably made working with generics a bit friendlier to Ruby.&lt;/p&gt;  &lt;p&gt;The first improvement has to do with re-opening a generic class. In the past you couldn’t just re-open a generic class and assume anything you added to it would be found on other versions of that generic class (eg. adding methods to &lt;code&gt;List[]&lt;/code&gt; wouldn’t have them show up on &lt;code&gt;List[String]&lt;/code&gt; and &lt;code&gt;List[Fixnum]&lt;/code&gt;). Now the Ruby class corresponding to the CLR generic type definition is a super-class of all instantiations of that type, making this possible:&lt;/p&gt; &lt;script src="http://gist.github.com/159861.js"&gt;&lt;/script&gt;  &lt;p&gt;There's a much more usability improvements to generics and .NET interop in general in this release, so either take a look at the &lt;a href="http://rubyforge.org/frs/shownotes.php?release_id=37484" target="_blank"&gt;CHANGELOG&lt;/a&gt; or keep an eye on the &lt;a href="http://ironruby.net/Documentation/.NET" target="_blank"&gt;.NET documentation&lt;/a&gt;.&lt;/p&gt;  &lt;h5&gt;&lt;a name="notable-changes"&gt;&lt;/a&gt;&lt;font color="#ff8000" size="3"&gt;Some more notable changes:&lt;/font&gt;&lt;/h5&gt;  &lt;ul&gt;   &lt;li&gt;Fix to Module#autoload so it doesn’t squash an existing constant &lt;/li&gt;    &lt;li&gt;Fix parsing of YAML time strings &lt;/li&gt;    &lt;li&gt;Replace DLR closures by a Ruby-specific implementation for performance &lt;/li&gt;    &lt;li&gt;Implement StringIO#ungetc – used in ActiveSuppor &lt;/li&gt;    &lt;li&gt;Re-implements “tr”, “tr!”, “tr_s”, “tr_s!”. The new implementation is almost 12x faster. &lt;/li&gt;    &lt;li&gt;Reimplements “join” to achieve better perf. &lt;/li&gt;    &lt;li&gt;Change ComBinder class to internal. &lt;/li&gt;    &lt;li&gt;Improves the ExpressionVisitor API &lt;/li&gt;    &lt;li&gt;Improves implementation of RubyArray. A loop doing Array#shift is not shifting the entire array content left every iteration. &lt;/li&gt;    &lt;li&gt;Add hosting of IronPython to hosting tutorial &lt;/li&gt;    &lt;li&gt;Implements interpretation of coalescing expression &lt;/li&gt;    &lt;li&gt;Implements Kernel#rand, Kernel#srand. &lt;/li&gt;    &lt;li&gt;Improves scope allocation perf. &lt;/li&gt;    &lt;li&gt;ironruby tutorial in Silverlight &lt;/li&gt;    &lt;li&gt;More fixes to win32ole to get the ADO DBI driver working &lt;/li&gt;    &lt;li&gt;String, Array, and Bignum fixes (thanks Daniele Allessandri!) &lt;/li&gt;    &lt;li&gt;Explicit x64 support with ir64.exe, and force ir.exe to run in a 32bit process on a 64bit OS. &lt;/li&gt;    &lt;li&gt;Implements basic debug views for classes that implement IRubyObject &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;For more details, see the &lt;a href="http://rubyforge.org/frs/shownotes.php?release_id=37484" target="_blank"&gt;CHANGELOG&lt;/a&gt;.&lt;/p&gt;  &lt;h5&gt;&lt;a name="bugs09"&gt;&lt;/a&gt;&lt;font color="#ff8000" size="3"&gt;Bugs closed&lt;/font&gt;&lt;/h5&gt;  &lt;p&gt;Here are all 26 bugs closed since the last release (2009-07-02). &lt;a href="http://ironruby.codeplex.com/WorkItem/List.aspx" target="_blank"&gt;You can see more information about each one on CodePlex&lt;/a&gt;.&lt;/p&gt;  &lt;pre style="overflow: scroll"&gt;1841 	Rubygems Test Failures in 'hash'
1506 	-X:PrivateBinding does not enable referring to classes that have internal visibility
1533 	Unverifiable code generated by mspec :lang
1678 	ArgumentError when calling System.String..ctor(Char[], int, int)
1211 	Adding a random object to Time which responds to to_f
910 	YAML does not properly deserialize Time values.
1626 	Rubygems failures
964 	overriding unsafe methods
1537 	rand doesn't work collectly
468 	Better error message for running ir.exe on pre-.Net 2.0 SP1
1787 	All-caps .NET method names are mangled strangely
1521 	Access is allowed to internal fields
1502 	alias_method fails for :do
821 	File.expand_path does not support a line number after filename
1509 	Proc.to_s should include line number where the block was declared
1501 	WinForms broken
1400 	$? is not always Process::Status
1345 	load_assembly(&lt;partial_name&gt;) should work
1344 	System.Action.new does not work
1306 	Cannot call CLR constructor of builtin type
1184 	public(:foo) does not work correctly for mixed-in methods
1060 	visibility of send :define_method
917 	Passing a Ruby array to a .NET method that expects an IEnumerable derivative fails with GetEnumerator call
783 	Assert in SetMethodBasesNoLock when calling #== on Ruby class inheriting from CLR class which overrides Equals
761 	Wrong behavior when calling redefined methods on object instances
1470 	Can't call the BigIntegerOverload of a method with a DefaultProtocol Attribute on the BigInteger attribute&lt;/pre&gt;

&lt;h5&gt;&lt;font color="#ff8000" size="3"&gt;Enjoy!&lt;/font&gt;&lt;/h5&gt;

&lt;p&gt;Please test out IronRuby 0.9 and let us know if you have any issues. We hope you enjoy this release! Please &lt;a href="http://ironruby.codeplex.com/WorkItem/Create.aspx" target="_blank"&gt;submit issues to CodePlex&lt;/a&gt; and help prioritize features for 1.0.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:22650565-0430-4c01-bc82-33d6fda8be12" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/IronRuby" rel="tag"&gt;IronRuby&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Release" rel="tag"&gt;Release&lt;/a&gt;,&lt;a href="http://technorati.com/tags/OSCON" rel="tag"&gt;OSCON&lt;/a&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=_MxRB824nhs:LSwgVb2DMtU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=_MxRB824nhs:LSwgVb2DMtU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=_MxRB824nhs:LSwgVb2DMtU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=_MxRB824nhs:LSwgVb2DMtU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=_MxRB824nhs:LSwgVb2DMtU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=_MxRB824nhs:LSwgVb2DMtU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=_MxRB824nhs:LSwgVb2DMtU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/_MxRB824nhs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/_MxRB824nhs/ironruby-09-released.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_OqCZhp9yI0Q/SnTjqyQdzqI/AAAAAAAAAL0/CbgKyPqQXao/s72-c/ir-logo-white_thumb%5B2%5D.jpg?imgmax=800" height="72" width="72" /><thr:total>14</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/08/ironruby-09-released.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-7332682026707544851</guid><pubDate>Fri, 24 Jul 2009 01:08:00 +0000</pubDate><atom:updated>2009-07-23T18:13:40.130-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">OSCON</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">Mono</category><category domain="http://www.blogger.com/atom/ns#">Moonlight</category><title>IronRuby at OSCON 2009: Mono, Moonlight, and scripting open source apps</title><description>&lt;p&gt;Today I’ll be giving a talk at &lt;a href="http://en.oreilly.com/oscon2009" target="_blank"&gt;OSCON 2009&lt;/a&gt; titled “IronRuby 0.9”. For any new readers, &lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; is an Open Source implementation of the &lt;a href="http://ruby-lang.org" target="_blank"&gt;Ruby programming language&lt;/a&gt; for the &lt;a href="http://microsoft.com/NET" target="_blank"&gt;Microsoft .NET&lt;/a&gt; Framework; it brings the expressiveness of Ruby to .NET, and the capabilities of .NET to Ruby. I’ll walk you through the talk in this post:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Road to IronRuby 1.0 &lt;/li&gt;    &lt;li&gt;Running the same application on the desktop and in the browser, on most major platforms (Windows, Mac OS, Linux) and most major browsers (Firefox, Safari, Internet Explorer) &lt;/li&gt;    &lt;li&gt;Detour – Gestalt: Running Ruby and Python in the browser, again. &lt;/li&gt;    &lt;li&gt;Using code written in any C# and Python from Ruby without it feeling foreign. &lt;/li&gt;    &lt;li&gt;How IronRuby has improved in the past 6 months, and how you can help IronRuby become a 1.0 quality implementation. &lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Road to IronRuby 1.0&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;It’s been a long ride since &lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; was announced alongside &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt; at &lt;a href="http://videos.visitmix.com/MIX07/DEV02" target="_blank"&gt;MIX ‘07&lt;/a&gt;, but in a few days the 0.9 version will be available, and all eyes will be focused on getting it to 1.0. The &lt;a href="http://blog.jimmy.schementi.com/2009/03/ironruby-03-released.html" target="_blank"&gt;past&lt;/a&gt; &lt;a href="http://blog.jimmy.schementi.com/2009/05/ironruby-05-released.html" target="_blank"&gt;couple&lt;/a&gt; of versions &lt;a href="http://blog.jimmy.schementi.com/2009/07/ironruby-06-released.html" target="_blank"&gt;have made vast compatibility and performance improvements&lt;/a&gt;, and 0.9 marks the last set of major features that will be added to IronRuby. From now on, all IronRuby languages will be primarily focused on bug fixing and anything else the community deems necessary to call IronRuby a 1.0 release. These improvements be delivered as point-point releases (0.9.1, 0.9.2, etc) until &lt;strong&gt;you &lt;/strong&gt;decide it is ready to call 1.0.&lt;/p&gt;  &lt;p&gt;But we’ll dive into the numbers and metrics at the end; let’s talk about why IronRuby is useful in your toolkit.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Cross-platform, cross-browser Ruby implementation&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Whenever people hear .NET &lt;font color="#808080"&gt;[they first think about a top-level domain, but when in the context of “Microsoft”]&lt;/font&gt; they immediately think “Windows”. But &lt;a href="http://tirania.org/blog/" target="_blank"&gt;Miguel&lt;/a&gt; and the &lt;a href="http://mono-project.com/Main_Page" target="_blank"&gt;Mono&lt;/a&gt; team have shown that isn’t reality. They’ve built a open-source implementation of .NET which runs on Linux, Mac OS, and also Windows. They are also building a open-source Silverlight 2 implementation, called Moonlight, allowing Silverlight applications to run on Linux browsers supporting Mozilla’s plug-in architecture; Silverlight 2 runs on Intel Macs and Windows. Since IronRuby runs on .NET and Silverlight, it also runs on Mono and Moonlight. Let’s explore that a bit:&lt;/p&gt;  &lt;p&gt;With Microsoft.NET and Mono, IronRuby can run on Windows and Linux (anywhere Mono runs, including Mac OS).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_OqCZhp9yI0Q/SmkJfUwHRYI/AAAAAAAAALA/fgGEoGaGVaE/s1600-h/ir-mono%5B4%5D.png"&gt;&lt;img style="display: inline" title="ir-mono" alt="ir-mono" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/SmkJfxjORNI/AAAAAAAAALI/0HlD5hTs4yk/ir-mono_thumb%5B2%5D.png?imgmax=800" width="400" height="275" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You’ll notice that real Ruby code runs, it’s running on a Unix environment on Mono, and .NET types can be accessed in a Ruby-esk way, even generic types.&lt;/p&gt;  &lt;p&gt;Because IronRuby integrates directly with .NET, you can use any existing .NET code from IronRuby. This means that any frameworks, be them Windows Forms, Windows Presentation Foundation (WPF), or GTK(#), can be used from IronRuby because .NET and Mono [respectively] have CLI bindings for these frameworks. Mono even has a Windows Forms implementation that translates to GTK, so the same application can run unmodified on both implementations. Mono only supports the “Silverlight” subset of WPF, which I’ll elaborate on in a bit.&lt;/p&gt;  &lt;p&gt;There’s also a tiny subset of .NET which is part of a browser plug-in called Silverlight; Microsoft’s implementation runs on Windows and Mac, in Firefox, Safari, and Internet Explorer (though any browser which supports ActiveX, Mozilla’s, or Safari’s plug-in architecture should work fine, like Opera or Chrome).&lt;/p&gt;  &lt;p&gt;The IronRuby tutorial application runs as a WPF desktop application (on the left), as well as Silverlight application (on the right).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_OqCZhp9yI0Q/SmkJgq8i2-I/AAAAAAAAALM/h2boWHHuRPQ/s1600-h/tut-wpf-sl%5B4%5D.png"&gt;&lt;img style="display: inline" title="tut-wpf-sl" alt="tut-wpf-sl" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/SmkJhCwlSyI/AAAAAAAAALQ/vbTlFbJjlgY/tut-wpf-sl_thumb%5B2%5D.png?imgmax=800" width="400" height="250" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Also, &lt;a href="http://channel9.msdn.com/posts/mtaulty/Silverlight-3-Running-Out-Of-Browser-Apps-on-the-Macintosh/" target="_blank"&gt;Silverlight 3 supports running applications out of the browser&lt;/a&gt;, very simply on Windows and Mac OS by right-clicking on the Silverlight application and selecting “Install”.&lt;/p&gt;  &lt;p&gt;Through Moonlight the IronRuby tutorial app also runs on Linux:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_OqCZhp9yI0Q/SmkJh0YYXMI/AAAAAAAAALU/AhamxrZzaJc/s1600-h/tut-moon%5B5%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="tut-moon" border="0" alt="tut-moon" src="http://lh3.ggpht.com/_OqCZhp9yI0Q/SmkJiYWcHlI/AAAAAAAAALY/uIsilwgKEIg/tut-moon_thumb%5B6%5D.png?imgmax=800" width="404" height="281" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Mono also supports running Moonlight applications through GTK on the desktop, just as a WPF application would work. While direct support isn’t in current daily builds of Moonlight, &lt;a href="http://tirania.org/blog/archive/2009/Jul-20.html" target="_blank"&gt;Miguel shows how easy it is to make the same code target the browser with Moonlight and the Linux desktop with Mono&lt;/a&gt;, just using C# code:&lt;/p&gt; &lt;script src="http://gist.github.com/152611.js"&gt;&lt;/script&gt;  &lt;p&gt;Note: the latest Moonlight stable release will not work for IronRuby, you must install the latest Moonlight build from their build bot: &lt;a title="http://sublimeintervention.com:8123/GetFile.aspx?id=11487919" href="http://sublimeintervention.com:8123/GetFile.aspx?id=11487919"&gt;http://sublimeintervention.com:8123/GetFile.aspx?id=11487919&lt;/a&gt;&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Detour: &lt;/font&gt;&lt;a href="http://visitmix.com/Labs/gestalt/" target="_blank"&gt;&lt;font color="#ff8000"&gt;Gestalt&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff8000"&gt; –- Ruby and Python in the browser&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;My last blog-post talks about a new prototype from the &lt;a href="http://visitmix.com/Lab" target="_blank"&gt;MIX Online Lab&lt;/a&gt; called &lt;a href="http://visitmix.com/Labs/gestalt/" target="_blank"&gt;Gestalt&lt;/a&gt;, which lets you write Ruby and Python in place of JavaScript – literally in &amp;lt;script&amp;gt; tags. Here’s a very simple example:&lt;/p&gt; &lt;script src="http://gist.github.com/151756.js"&gt;&lt;/script&gt;  &lt;p&gt;It uses Silverlight to do this, so this will work in Moonlight as well.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Dynamic and Static language interop&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;IronRuby has great integration with the .NET framework APIs, so C#/VB code can be called from IronRuby without it feeling like “interop”. C# can also call IronRuby through the &lt;a href="http://dlr.codeplex.com" target="_blank"&gt;Dynamic Language Runtime&lt;/a&gt; (DLR) Hosting APIs. However, in .NET 4.0 dynamic method dispatch is part of C#, so calling IronRuby from C# is just as easy as a C# method call. Being that IronRuby is built on the DLR, it can interoperate with other DLR languages just as easily, so Python and Ruby play along nicely today, and future DLR languages as well.&lt;/p&gt;  &lt;p&gt;A simple way to show that capability is by writing a unit test for a class in .NET; let’s pick “Stack”:&lt;/p&gt; &lt;script src="http://gist.github.com/153361.js"&gt;&lt;/script&gt;  &lt;p&gt;As you can see, creating .NET types, calling methods on .NET classes, and all the other language features Ruby has work against .NET types (even re-opening .NET classes).&lt;/p&gt;  &lt;p&gt;To show the reverse, lets look at a very simple &lt;a href="http://en.wikipedia.org/wiki/REPL" target="_blank"&gt;REPL&lt;/a&gt; implementation:&lt;/p&gt; &lt;script src="http://gist.github.com/153380.js"&gt;&lt;/script&gt;  &lt;p&gt;In less than 100 lines of code, you have a program that runs arbitrary Python and Ruby code. The DLR hosting API lets you run dynamic language code from a static language just from strings.&lt;/p&gt;  &lt;p&gt;Expanding on these ideas, let us give the experience a upgrade to the 21st century. &lt;a href="http://www.iunknown.com/2009/05/dynamic-languages-at-teched-2009.html" target="_blank"&gt;John Lam has shown this before at TechEd 2009&lt;/a&gt;: an editor that can double as a REPL.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://gist.github.com/152872" target="_blank"&gt;&lt;img style="display: inline" title="repl-lib" alt="repl-lib" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/SmkJijg10GI/AAAAAAAAALc/emG_oamAfXY/repl-lib%5B5%5D.png?imgmax=800" width="339" height="490" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://github.com/jschementi/repl-lib" target="_blank"&gt;Downlaod it here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This seems like a great idea, and it is even better once you start using it. It works like a normal editor, but selecting a block of code and pressing ctrl-e will run the code, showing the output directly below selected code as a comment, and ctrl-enter runs the current line. The code that gets run gets syntax highlighted. There is no need to have up-down-cursor history, as it’s all right there in the editor. If you need to modify something you’ve already run just, just modify it in the editor and re-run it! This integrates the editor-repl experience, making it a very valuable tool. &lt;/p&gt;  &lt;p&gt;Note: this is not a new idea by any means, as &lt;a href="http://macromates.com/" target="_blank"&gt;TextMate&lt;/a&gt; does something similar, but no one seems to explain this as an upgrade to your traditional REPL.&lt;/p&gt;  &lt;p&gt;Using this editor, it can be integrated into any .NET project as a lightweight way to experiment with adding scripting support. Using the hosting ideas I presented before, an application written in C# could use IronRuby to allow users to write applications against their object model, or extend it at runtime. Here’s a small example of hosting this editor in Witty, an open-source Twitter client running on .NET:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://gist.github.com/152877"&gt;&lt;img style="display: inline" title="witty-scripting" alt="witty-scripting" src="http://lh5.ggpht.com/_OqCZhp9yI0Q/SmkJjIFLIYI/AAAAAAAAALg/5HtJOC--4ek/witty-scripting%5B5%5D.png?imgmax=800" width="400" height="202" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://github.com/jschementi/irwitty" target="_blank"&gt;You can get this version of Witty from GitHub&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;While it is great that you can so easily add scripting into a .NET application, it ends up exposing the design deficiencies in the application being scripted. In Witty’s case, the Twitter class (T) is very good, but the Window class (U) isn’t in good shape, as there are a ton of methods on the type, and it’s unclear how they should be used to drive the UI. &lt;a href="http://twitter.com/jongalloway/statuses/2774402229" target="_blank"&gt;Jon Galloway wants to merge this into Witty&lt;/a&gt;, so hopefully some of these refactorings can be made to enable scripting better.&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;I extend this offer to all open-source .NET/Mono projects – if you want to improve your architecture and add scripting support, please let me know and I’ll help out.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;It's worth noting that .NET 4.0, the next version of the .NET framework, C# supports a &amp;quot;dynamic&amp;quot; keyword which will let you call Ruby or Python (or any DLR language) just by using method calls.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Project status&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;&lt;a href="http://ironruby.info"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh6.ggpht.com/_OqCZhp9yI0Q/SmkJjpyKYmI/AAAAAAAAALk/J9Hng_e0B4I/image%5B16%5D.png?imgmax=800" width="400" height="89" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Compatibility is really good at this point. We run the &lt;a href="http://ironruby.info" target="_blank"&gt;RubySpec test suite, passing at (85%)&lt;/a&gt; and the test suites from popular Ruby frameworks, including Rails, Rake, RSpec, and RubyGems, on every check-in, and can run pretty substantial Rails applications. Increasing compatibility bugs will definitely be the focus of the point releases approaching 1.0; mainly based on what you tell us needs fixing.&lt;/p&gt;  &lt;p&gt;This upcoming version will boast support for the &lt;a href="http://github.com/shri/ironruby/commit/5fb483dd13b8c0c950627e9624973e4fa60cf784" target="_blank"&gt;Win32OLE&lt;/a&gt; library, making existing Ruby applications with interact with COM work as they do in MRI, like &lt;a href="http://wtr.rubyforge.org/" target="_blank"&gt;Watir&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_OqCZhp9yI0Q/SmkJkNq4RwI/AAAAAAAAALo/U9KruHidO7c/s1600-h/image%5B15%5D.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://lh4.ggpht.com/_OqCZhp9yI0Q/SmkJkv1QyrI/AAAAAAAAALs/AK3KLnqDduE/image_thumb%5B9%5D.png?imgmax=800" width="400" height="297" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Performance is also in a very good place. This past version has pushed on the Ruby benchmark suite, and now we are &amp;gt;= 2x better than MRI on almost all benchmarks. Those numbers will be published on http://ironruby.info around the same time IronRuby 0.9 comes out. The above image shows that IronRuby (in blue) is normally significantly faster than MRI (in red), except for a handful of cases. The is not the end-all-be-all metric to measuring performance, but it’s nice to see IronRuby continuing to improve here.&lt;/p&gt;  &lt;p&gt;In prior releases, Rails startup has gotten dramatically better, going from 80+ seconds in March to ~20 seconds now. &lt;a href="http://blog.jimmy.schementi.com/2009/07/ironruby-06-released.html" target="_blank"&gt;Read more about Rails performance is the IronRuby 0.6 release.&lt;/a&gt;&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Interesting IronRuby usages&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Now that IronRuby is approaching 1.0, we're seeing very interesting usages of Ruby with .NET:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;AutoCAD scripting -- Kean Walmsley &lt;/li&gt;    &lt;li&gt;&lt;a href="http://github.com/thbar/magic" target="_blank"&gt;magic DSL for Windows UI frameworks&lt;/a&gt; -- &lt;a href="http://github.com/thbar" target="_blank"&gt;Thibaut Barrère&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Automated conversion of an app written in an in-house language (lang runs on FORTRAN77) and MOTIF UI “to” IronRuby and WPF -- Robert Brotherus &lt;/li&gt;    &lt;li&gt;Point of Sale application based on WPF, IronRuby and FoxPro -- &lt;a href="http://twitter.com/nightshade427" target="_blank"&gt;Nick Rickets&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you know of more interesting usages, please send them my way!&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Thanks!&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Thanks for reading this far! Keep an eye out on this blog and the &lt;a href="http://ironruby.net" target="_blank"&gt;ironruby website&lt;/a&gt; for the upcoming 0.9 release.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:888f4617-ecd4-40cd-bfcb-a0fedd7808a8" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/IronRuby" rel="tag"&gt;IronRuby&lt;/a&gt;,&lt;a href="http://technorati.com/tags/OSCON" rel="tag"&gt;OSCON&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Mono" rel="tag"&gt;Mono&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Moonlight" rel="tag"&gt;Moonlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=SHl7aUzmkFI:miXlBRGY_d0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=SHl7aUzmkFI:miXlBRGY_d0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=SHl7aUzmkFI:miXlBRGY_d0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=SHl7aUzmkFI:miXlBRGY_d0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=SHl7aUzmkFI:miXlBRGY_d0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=SHl7aUzmkFI:miXlBRGY_d0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=SHl7aUzmkFI:miXlBRGY_d0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/SHl7aUzmkFI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/SHl7aUzmkFI/ironruby-at-oscon-2009-mono-moonlight.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_OqCZhp9yI0Q/SmkJfxjORNI/AAAAAAAAALI/0HlD5hTs4yk/s72-c/ir-mono_thumb%5B2%5D.png?imgmax=800" height="72" width="72" /><thr:total>5</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/07/ironruby-at-oscon-2009-mono-moonlight.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-8442058915742893952</guid><pubDate>Wed, 22 Jul 2009 03:06:00 +0000</pubDate><atom:updated>2009-07-21T20:06:15.422-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><category domain="http://www.blogger.com/atom/ns#">DLR</category><title>Gestalt: Ruby and Python in the browser, again</title><description>&lt;p&gt;Today &lt;a href="http://visitmix.com/Lab" target="_blank"&gt;Mix Online Lab&lt;/a&gt; released a prototype implementation of Ruby and Python in the browser, named &lt;a href="http://visitmix.com/Labs/gestalt/" target="_blank"&gt;Gestalt&lt;/a&gt;. Feeling a bit of de ja vu? If not, you can ignore this post and just &lt;a href="http://visitmix.com/labs/gestalt/learnmore/" target="_blank"&gt;see what it’s all about&lt;/a&gt;. Regardless, I suggest you read on.&lt;/p&gt;  &lt;p&gt;A simple Ruby-based web page using Gestalt would look like this:&lt;/p&gt; &lt;script src="http://gist.github.com/151756.js"&gt;&lt;/script&gt;  &lt;p&gt;&lt;a href="http://visitmix.com/Labs/gestalt/" target="_blank"&gt;Gestalt&lt;/a&gt; adds “ruby” and “python” to the languages supported by the &amp;lt;script&amp;gt; tag. You can also include other files rather than writing the code in the HTML page:&lt;/p&gt; &lt;script src="http://gist.github.com/151758.js"&gt;&lt;/script&gt;  &lt;p&gt;My first reactions when hearing about this project was “Holy crap, wow, they got Ruby and Python running in the browser, that’s freakin’ awesome!” But I work on the &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt; integration with &lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; and &lt;a href="http://ironpython.codeplex.com" target="_blank"&gt;IronPython&lt;/a&gt;, already letting you write Ruby and Python in the browser instead of JavaScript. Hmm. Not to my surprise, Gestalt uses IronRuby and IronPython in Silverlight to accomplish this. But damn, wouldn’t it be awesome if this is how the world worked?&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;font color="#ff8000"&gt;For any new readers, &lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; and &lt;a href="http://ironpython.codeplex.com" target="_blank"&gt;IronPython&lt;/a&gt; are implementations of Ruby and Python for the .NET Framework, utilizing the &lt;a href="http://dlr.codeplex.com" target="_blank"&gt;Dynamic Language Runtime&lt;/a&gt; (DLR).&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://visitmix.com/Labs/gestalt/" target="_blank"&gt;Gestalt&lt;/a&gt; is a effort to show what it would be like if there were other &lt;strong&gt;&lt;font color="#ff8000"&gt;standard&lt;/font&gt;&lt;/strong&gt; languages in the browser, other than just JavaScript. The Mix Online Lab focuses on using Microsoft technology in ways that make non-Microsoft developers interested, so this project is right up their alley. They wanted to showcase the DLR languages in Silverlight as a way of showing how our efforts can make the web a better place.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;So what are the difference between IronRuby and IronPython’s Silverlight integration and what Gestalt provides?&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Again, you can already make IronRuby and IronPython based applications in Silverlight; Gestalt just puts a new spin on how to do that. IronRuby and IronPython use the XAP file for the application packaging, including script files, and provides a development-tool called Chiron to auto-package the app, providing the edit-refresh experience that is familiar for a web browser app. Chiron is also used to write the package to disk so it can be deployed to any web-server. This model works great for getting new and existing Ruby and Python programs running in Silverlight, as the packaging is transparent to a developer. And it doesn’t fight Silverlight’s packaging conventions, so using Silverlight-specific features will be straight-forward from a DLR language.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://visitmix.com/Labs/gestalt/" target="_blank"&gt;Gestalt&lt;/a&gt; takes a much different approach using &amp;lt;script&amp;gt; tags, making the integration much more familiar to current JavaScript developers. They also handle all the Silverlight &amp;lt;object&amp;gt; tag stuff in gestalt.js, taking away the need to host Silverlight yourself.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Why Gestalt is interesting to me&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;The thing that I really like about Gestalt is that Chiron is not needed for development. Just edit the file and refresh the browser. No need to run something in the background generating a XAP file. Gestalt.js detects which languages the page’s &amp;lt;script&amp;gt; tags use, and picks a pre-packaged Gestalt-*.xap file, one for Ruby, one for Python, one for both, and one for none. This means your application could look something like this:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;index.html (can contain Python and/or Ruby code) &lt;/li&gt;    &lt;li&gt;gestalt/      &lt;ul&gt;       &lt;li&gt;gestalt.js &lt;/li&gt;        &lt;li&gt;gestalt-rb.xap &lt;/li&gt;        &lt;li&gt;gestalt-py.xap &lt;/li&gt;        &lt;li&gt;gestalt.xap &lt;/li&gt;        &lt;li&gt;gestalt-x.xap &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Very clean. The gestalt directory is just dropped onto your web-server (to be shared among all your applications), and gestalt.js is referenced from your HTML file, and your good to go. No running Chiron.exe, or installing Mono on the Mac to run Chiron.exe. I’m jealous.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;So what’s the catch?&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;While Gestalt is a much simpler to get started writing Ruby and Python applications in the browser, it does not support a major feature of Ruby and Python – accessing something like a file-system. For example, including other files at runtime uses the language’s underlying File access to read the file in and run it’s contents. Ruby uses “require” or “load”, and python uses “import” to do this.&lt;/p&gt;  &lt;p&gt;IronRuby and IronPython in Silverlight normally support this, as all file reads are redirected to the XAP file. Since Gestalt’s XAP files are opaque to the the developer, they do not support File access. This is only an issue when you want to use existing Ruby or Python code in the browser. For example, existing code usually has more dependencies, especially into portion of the language’s standard library which is written the language itself. Usually you’d just put these files in the folder that Chiron is auto-xapping for you, and that’s it. However, Gestalt has no way of doing this today.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Making it better&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;A possible solution is to just cache the contents of &amp;lt;script src&amp;gt; tags, and use the languages path resolution mechanism to test if those files have already been downloaded. If it finds a match, serve the file’s contents. If not, it could either fail fast and say that your missing a &amp;lt;script src&amp;gt; reference, or it &lt;em&gt;COULD &lt;/em&gt;download the file synchronously (and still cache it) and display a warning that you are missing a &amp;lt;script src&amp;gt; reference.&lt;/p&gt;  &lt;p&gt;Unfortunately, this only works for script files; what if you just want to download a txt file? Having &amp;lt;script src=”foo.txt”&amp;gt; is not going to fly. Maybe using &amp;lt;link&amp;gt; tags could work?&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff8000"&gt;&lt;strong&gt;Why can’t we just download them synchronously?&lt;/strong&gt;&lt;/font&gt; No! Though the current bits do have a synchronous downloading mode, it’s only experimental and should not be used in production. Synchronous downloads are significantly slower since only one download can occur at a time. Downloads need to be synchronous since “opening a file” is expected to block until it is complete. Also, IronRuby/IronPython do not support &lt;a href="http://en.wikipedia.org/wiki/Continuation" target="_blank"&gt;continuations&lt;/a&gt; (for good reasons), so the code cannot be “paused” while a file is downloaded, and then be “resumed” when done. And even if they did support continuations (as there is a way to get it working for the very specific case of file access), the downloads would still all occur one at a time, making the loading much slower. So &lt;font color="#ff8000"&gt;&lt;strong&gt;downloading “on-demand” for file reads is not a good solution&lt;/strong&gt;&lt;/font&gt;, and that’s precisely why the browser doesn’t do that today … so let’s not fight it.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000"&gt;Is Gestalt going to always be separate from IronRuby and IronPython?&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;No! :) While Gestalt’s first release was best to be separate, I’m very interested in merging the ideas Gestalt has back into Microsoft.Scripting.Silverlight … &lt;a href="http://lists.ironpython.com/pipermail/users-ironpython.com/2009-July/010813.html" target="_blank"&gt;in-fact discussions have already begun on the IronPython Mailing List&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In short, Ruby and Python Silverlight applications are a bit too complex, and Gestalt shows us that it doesn’t need to be that way. &lt;a href="http://github.com/jschementi/ironruby/commit/da6b54e226adfd3a18d8ad98d618c2350ebd8351" target="_blank"&gt;Work has already begun to merge Gestalt and Microsoft.Scripting.Silverlight&lt;/a&gt;, so play with Gestalt and let me know what you think!&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a1a7afdb-3168-465b-bb90-b04b0cfa1b40" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/IronRuby" rel="tag"&gt;IronRuby&lt;/a&gt;,&lt;a href="http://technorati.com/tags/IronPython" rel="tag"&gt;IronPython&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DLR" rel="tag"&gt;DLR&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Browser" rel="tag"&gt;Browser&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Ruby" rel="tag"&gt;Ruby&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Python" rel="tag"&gt;Python&lt;/a&gt;,&lt;a href="http://technorati.com/tags/dynamic+languages" rel="tag"&gt;dynamic languages&lt;/a&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=BElVOHJNip4:3VIfjNAxZHc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=BElVOHJNip4:3VIfjNAxZHc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=BElVOHJNip4:3VIfjNAxZHc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=BElVOHJNip4:3VIfjNAxZHc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=BElVOHJNip4:3VIfjNAxZHc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=BElVOHJNip4:3VIfjNAxZHc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=BElVOHJNip4:3VIfjNAxZHc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/BElVOHJNip4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/BElVOHJNip4/gestalt-ruby-and-python-in-browser.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><thr:total>8</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/07/gestalt-ruby-and-python-in-browser.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-1226883076398775337</guid><pubDate>Thu, 02 Jul 2009 19:08:00 +0000</pubDate><atom:updated>2009-07-02T12:30:57.980-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Cucumber</category><category domain="http://www.blogger.com/atom/ns#">Testing</category><category domain="http://www.blogger.com/atom/ns#">IronRuby</category><category domain="http://www.blogger.com/atom/ns#">Silverlight</category><category domain="http://www.blogger.com/atom/ns#">Release</category><category domain="http://www.blogger.com/atom/ns#">Performance</category><title>IronRuby 0.6 Released!</title><description>&lt;a href="http://chemistry.about.com/od/fireworkspyrotechnics/ig/Fireworks-Displays/Fireworks-Display.-1ce.htm" target="_blank"&gt;&lt;img src="http://www.stgabriels.co.uk/_files/images/fireworks2.jpg" width="400" height="341" /&gt;&lt;/a&gt;   &lt;p align="center"&gt;The IronRuby team is pleased to announce a new release of IronRuby: IronRuby 0.6!&lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="5"&gt;&lt;strong&gt;&lt;a href="http://ironruby.net/Download" target="_blank"&gt;Download IronRuby 0.6&lt;/a&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://github.com/ironruby/ironruby/zipball/v0.6.0" target="_blank"&gt;You can also get the source code for this release&lt;/a&gt;&lt;/p&gt;  &lt;p align="left"&gt;Staying true to our &amp;quot;Conference-driven development schedule,&amp;quot; this release is in conjunction with ... wait, there is no conference this time! Just a good ol' monthly release of &lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt;, chock full of awesomeness. And just so happens to be the 4th of July weekend, so hopefully you have some downtime this weekend and can give the new release a spin.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff8000" size="4"&gt;What's in the Release?&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Performance has been a major focus to this release, getting startup time quicker and optimizing built-in types. There has been more progress with Ruby compatibility (&lt;a href="http://github.com/aslakhellesoy/cucumber" target="_blank"&gt;Cucumber&lt;/a&gt; works!) and .NET interop. &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt; binaries are back in the release, and there are a couple of samples to help you learn IronRuby.&lt;/p&gt;  &lt;p&gt;Most of these descriptions are from &lt;a href="http://blog.tomasm.net/" target="_blank"&gt;Tomas's&lt;/a&gt; very detailed code review emails, so thanks Tomas! For more detailed information, please see the &lt;a href="http://rubyforge.org/frs/shownotes.php?group_id=4359&amp;amp;release_id=36423" target="_blank"&gt;CHANGELOG&lt;/a&gt; (which includes all commit messages for the release ... not just &amp;quot;syncing to head of tfs&amp;quot;)&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="#ir06lazymc"&gt;Lazy method compilation&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="#ir06clrmember"&gt;CLR member enumeration&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="#ir06gmpi"&gt;Generic-Method Parameter-Inference&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="#ir06cucumber"&gt;Testing C# with Cucumber&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="#ir06sl"&gt;Silverlight building and updated binaries&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="#ir06samples"&gt;Samples&lt;/li&gt; &lt;/ul&gt;  &lt;h5&gt;&lt;a name="ir06lazymc"&gt;&lt;/a&gt;&lt;font color="#ff8000" size="3"&gt;Lazy method compilation&lt;/font&gt;&lt;/h5&gt;  &lt;p&gt;Last release adaptive compilation was enabled for IronRuby, which uses a fast-to-start-up interpreter to start up the program, while code which gets run a lot is compiling on a background thread. This gave IronRuby significant performance improvements for large apps like &lt;a href="http://rubyonrails.org" target="_blank"&gt;Rails&lt;/a&gt;, &lt;font color="#ff8000"&gt;&lt;strong&gt;which has improved startup by 2.5 times&lt;/strong&gt;&lt;/font&gt;.&lt;/p&gt;  &lt;p&gt;This release we've added &amp;quot;lazy method transformation&amp;quot; to the bag of startup performance tricks. In IronRuby 0.5, a method was transformed to the DLR AST as soon as it was defined. IronRuby 0.6 postpones the transformation until the first time the method is called. This significantly improves startup time. For example (not NGEN'd):&lt;/p&gt; &lt;script src="http://gist.github.com/139394.js"&gt;&lt;/script&gt;  &lt;p&gt;This has made &lt;font color="#ff8000"&gt;&lt;strong&gt;Rails startup time 30% faster&lt;/strong&gt;&lt;/font&gt;, coming in approximately 20 seconds on my dual-core laptop running Windows 7.&lt;/p&gt;  &lt;h5&gt;&lt;a name="ir06clrmember"&gt;&lt;/a&gt;&lt;font color="#ff8000" size="3"&gt;CLR member enumeration&lt;/font&gt;&lt;/h5&gt;  &lt;p&gt;Now methods like &lt;code&gt;Module#instance_methods&lt;/code&gt;, etc, include CLR member names. Though it's a lot cooler than that. The array of methods returns contains strings for Ruby methods, and objects of type &lt;code&gt;IronRuby::Clr::Name&lt;/code&gt; to represent CLR methods that can be called by either the actual CLR name or a mangled (Ruby-esk) name. ClrName has methods &lt;code&gt;to_s&lt;/code&gt;, &lt;code&gt;to_sym&lt;/code&gt;, &lt;code&gt;to_str&lt;/code&gt;, &lt;code&gt;&amp;lt;=&amp;gt;&lt;/code&gt;, &lt;code&gt;inspect&lt;/code&gt;, and &lt;code&gt;dump&lt;/code&gt; so that it can be used wherever a string can be used. The display string for the name uses single quotes so that you can easily distinguish CLR (dual) names from regular names (plain mutable strings). CLR strings display themselves as single quoted strings, so this fits nicely.&lt;/p&gt; &lt;script src="http://gist.github.com/139395.js"&gt;&lt;/script&gt;  &lt;p&gt;Even cooler, this works well for meta-programming:&lt;/p&gt; &lt;script src="http://gist.github.com/139397.js"&gt;&lt;/script&gt;  &lt;p&gt;A new set of define_method overloads, strongly typed to &lt;code&gt;ClrName&lt;/code&gt;, have been added to enable this. They define the real method using the &lt;code&gt;ruby_name&lt;/code&gt; and alias it using the &lt;code&gt;clr_name&lt;/code&gt;. So both &lt;code&gt;CompareTo&lt;/code&gt; and &lt;code&gt;compare_to &lt;/code&gt;calls are intercepted.&lt;/p&gt;  &lt;h5&gt;&lt;a name="ir06gmpi"&gt;&lt;/a&gt;&lt;font color="#ff8000" size="3"&gt;Generic-Method Parameters-Inference&lt;/font&gt;&lt;/h5&gt;  &lt;p&gt;Thanks to some work by the IronPython team, IronRuby now has parameter inference for generic methods.&lt;/p&gt; &lt;script src="http://gist.github.com/139399.js"&gt;&lt;/script&gt;&lt;script src="http://gist.github.com/139398.js"&gt;&lt;/script&gt;  &lt;p&gt;This needs some more TLC before it works perfectly, but this lets you use simple LINQ methods from IronRuby.&lt;/p&gt; &lt;script src="http://gist.github.com/139603.js"&gt;&lt;/script&gt;  &lt;h5&gt;&lt;a name="ir06cucumber"&gt;&lt;/a&gt;&lt;font color="#ff8000" size="3"&gt;Testing C# with Cucumber&lt;/font&gt;&lt;/h5&gt;  &lt;p&gt;This release of IronRuby runs the Cucumber testing framework rather well. &lt;a href="http://wiki.github.com/aslakhellesoy/cucumber/ironruby-and-net" target="_blank"&gt;Try out Cucumber against some C# code&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Given a feature file (this being the addition.feature)&lt;/p&gt; &lt;script src="http://gist.github.com/139401.js"&gt;&lt;/script&gt;  &lt;p&gt;A step_definition file (calculator_steps.rb)&lt;/p&gt; &lt;script src="http://gist.github.com/139403.js"&gt;&lt;/script&gt;  &lt;p&gt;And a DLL:&lt;/p&gt; &lt;script src="http://gist.github.com/139405.js"&gt;&lt;/script&gt;  &lt;p&gt;Cucumber will test the addition feature:&lt;/p&gt;  &lt;pre&gt;3 scenarios (3 passed)
12 steps (12 passed)
0m0.753s&lt;/pre&gt;

&lt;h5&gt;&lt;a name="ir06sl"&gt;&lt;/a&gt;&lt;font color="#ff8000" size="3"&gt;Silverlight building and updated binaries&lt;/font&gt;&lt;/h5&gt;

&lt;p&gt;This release re-adds Silverlight binaries to IronRuby, contained in the &amp;quot;silverlight&amp;quot; directory of the release. These bits have been integrated from the &lt;a href="http://github.com/jschementi/agdlr" target="_blank"&gt;AgDLR project&lt;/a&gt;, and will be maintained in the IronRuby and IronPython source code repositories from now on. The AgDLR GitHub project will redirect to one of those for binaries for both languages in Silverlight. In addition, the &lt;a href="http://sdlsdk.codeplex.com" target="_blank"&gt;SDLSDK CodePlex site&lt;/a&gt; will be redirecting to the IronRuby and IronPython CodePlex sites, for downloads, discussion, and issue tracking. AgDLR was a little side project to add new features to DLR Silverlight applications, and play around with Git. I'm very happy to see it merged back in with the languages.&lt;/p&gt;

&lt;p&gt;Note: &lt;a href="http://ironpython.codeplex.com" target="_blank"&gt;IronPython&lt;/a&gt; Silverlight assemblies are included directly in the release. They may be moved out to the separate package that contains IronPython desktop DLLs in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://github.com/ironruby/ironruby/commit/33211840f7482ffaa4970a6e630725fad2a70f5d" target="_blank"&gt;See the integration commit for more information&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another notable change is that you can now build Silverlight binaries out of IronRuby's GitHub repository very easily. Given that you have Silverlight installed at &lt;code&gt;C:\Program Files\Microsoft Silverlight\2.0.40115.0&lt;/code&gt;, this will build IronRuby for Silverlight:&lt;/p&gt;

&lt;pre&gt;msbuild Merlin/Main/Languages/Ruby/Ruby.sln
  /p:Configuration=&amp;quot;Silverlight Release
  /p:SilverlightPath=&amp;quot;C:\Program Files\Microsoft Silverlight\2.0.40115.0&lt;/pre&gt;

&lt;p&gt;You can also build IronPython for Silverlight in a similar manner. Aliases for this will be added soon, but if you need a custom build of the DLR languages for Silverlight, this is the way to do it.&lt;/p&gt;

&lt;h5&gt;&lt;a name="ir06samples"&gt;&lt;/a&gt;&lt;font color="#ff8000" size="3"&gt;Samples&lt;/font&gt;&lt;/h5&gt;

&lt;p&gt;Six samples are included in this release. The first three are desktop samples in the “/samples” directory. The last three are Silverlight samples in the “/silverlight/samples” directory:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blog.jimmy.schementi.com/2009/06/ironruby-tutorial.html " target="_blank"&gt;&lt;strong&gt;Tutorial&lt;/strong&gt; - An interactive IronRuby tutorial&lt;/a&gt; 

  &lt;br /&gt;&lt;a title="IronRuby example - Tutorial by jschementi, on Flickr" href="http://www.flickr.com/photos/jschementi/3681583787/"&gt;&lt;img alt="IronRuby example - Tutorial" src="http://farm3.static.flickr.com/2425/3681583787_3e4deb7c3b.jpg" width="400" height="366" /&gt;&lt;/a&gt; 

  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DiskUse&lt;/strong&gt; - A small WPF application which visualizes the disk usage for a particular directory 

  &lt;br /&gt;&lt;a title="IronRuby example - Disk Usage by jschementi, on Flickr" href="http://www.flickr.com/photos/jschementi/3682397770/"&gt;&lt;img alt="IronRuby example - Disk Usage" src="http://farm3.static.flickr.com/2463/3682397770_bdb0aca262.jpg" width="400" height="230" /&gt;&lt;/a&gt; 

  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IRPowerShell&lt;/strong&gt; - a small library and sample applications showing how to interact with PowerShell from IronRuby 

  &lt;br /&gt;&lt;a title="IronRuby example - minsysreq by jschementi, on Flickr" href="http://www.flickr.com/photos/jschementi/3681583811/"&gt;&lt;img alt="IronRuby example - minsysreq" src="http://farm3.static.flickr.com/2477/3681583811_12a38ff54c.jpg" width="400" height="126" /&gt;&lt;/a&gt; 

  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clock&lt;/strong&gt; – a simple Silverlight sample 

  &lt;br /&gt;&lt;a title="IronRuby Silverlight example - Clock by jschementi, on Flickr" href="http://www.flickr.com/photos/jschementi/3681583727/"&gt;&lt;img alt="IronRuby Silverlight example - Clock" src="http://farm3.static.flickr.com/2663/3681583727_b570016904.jpg" width="400" height="402" /&gt;&lt;/a&gt; 

  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Photoviewer&lt;/strong&gt; – do AJAX programming with IronRuby (ARAX =P) 

  &lt;br /&gt;&lt;a title="IronRuby Silverlight example - photoviewer by jschementi, on Flickr" href="http://www.flickr.com/photos/jschementi/3681583659/"&gt;&lt;img alt="IronRuby Silverlight example - photoviewer" src="http://farm4.static.flickr.com/3663/3681583659_61b9c793fb.jpg" width="400" height="317" /&gt;&lt;/a&gt; 

  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;REPL&lt;/strong&gt; – Interactive console in the browser. 

  &lt;br /&gt;&lt;a title="IronRuby Silverlight example - REPL by jschementi, on Flickr" href="http://www.flickr.com/photos/jschementi/3682397706/"&gt;&lt;img alt="IronRuby Silverlight example - REPL" src="http://farm4.static.flickr.com/3652/3682397706_f0cde1f3c1.jpg" width="400" height="292" /&gt;&lt;/a&gt; 

  &lt;br /&gt;&lt;/p&gt;

&lt;h5&gt;&lt;font color="#ff8000" size="3"&gt;Some more interesting changes:&lt;/font&gt;&lt;/h5&gt;

&lt;ul&gt;
  &lt;li&gt;Improved DLR Interop: adds support for GetMember/SetMember with method_missing, Binary/Unary operators, and indexers. &lt;/li&gt;

  &lt;li&gt;Handling of CLR protected and private methods and properties &lt;/li&gt;

  &lt;li&gt;Reimplemented File.expand_path such that it does not use System.IO.Path. &lt;/li&gt;

  &lt;li&gt;This allows us to get better compatibility with MRI. The motivating reason was &lt;/li&gt;

  &lt;li&gt;that RSpec does File.expand_path(&amp;quot;filename:linenumber&amp;quot;) &lt;/li&gt;

  &lt;li&gt;Improves the implementation of singleton method dispatch. &lt;/li&gt;

  &lt;li&gt;These changes improve running time of specs significantly (2x) &lt;/li&gt;

  &lt;li&gt;Renames Method, UnboundMethod#overloads (plural) to &lt;/li&gt;

  &lt;li&gt;Method, UnboundMethod#overload (singular). &lt;/li&gt;

  &lt;li&gt;The old name is still available for now and throws an exception. &lt;/li&gt;

  &lt;li&gt;Implements adaptively compiled rules &lt;/li&gt;

  &lt;li&gt;Improves performance of Array#- from quadratic algorithm to linear. &lt;/li&gt;

  &lt;li&gt;Improves implementation of RubyArray &lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;&lt;font color="#ff8000" size="3"&gt;Bugs closed&lt;/font&gt;&lt;/h5&gt;

&lt;p&gt;Here are all 37 bugs closed since the last release (2009-05-19). &lt;a href="http://ironruby.codeplex.com/WorkItem/List.aspx" target="_blank"&gt;You can see more information about each one on CodePlex&lt;/a&gt;.&lt;/p&gt;

&lt;pre style="overflow: scroll"&gt;1521  Access is allowed to internal fields
1502  alias_method fails for :do
821   File.expand_path does not support a line number after filename
1509  Proc.to_s should include line number where the block was declared
1501  WinForms broken
1400  $? is not always Process::Status	
1345  load_assembly(&lt;partial_name&gt;) should work
1344  System.Action.new does not work
1306  Cannot call CLR constructor of builtin type
1184  public(:foo) does not work correctly for mixed-in methods
1085  Cannot call new on subtypes of builtin classes whose &amp;quot;new&amp;quot; method has optional arguments
1060  visibility of send :define_method
917   Passing a Ruby array to a .NET method that expects an IEnumerable derivative fails with GetEnumerator call
783   Assert in SetMethodBasesNoLock when calling #== on Ruby class inheriting from CLR class which overrides Equals
761   Wrong behavior when calling redefined methods on object instances
1470  Can't call the BigIntegerOverload of a method with a DefaultProtocol Attribute on the BigInteger attribute
1426  The located assembly's manifest definition does not match the assembly reference. (ctp dev10 beta1)
1441  Error with cyrillyc text in Sharepoint	
1352  Test Defects	
814   Allocator underfined for &lt;type&gt; (TypeError)
572   Error when running Cucumber examples with IronRuby
718   IronRuby ignores RUBYLIB environment variable
727   to_proc not working
1351  redist-libs should have rubygems-1.3.1	
466   ''.split(//, -1) returns [&amp;quot;&amp;quot;] instead of []	
940   Can't inherit from abstract classes	
1028  Missing conversion from Duration to Fixnum (ActiveSupport)?
374   irails Foo: undefined method for OpenSLL::Random.random_bytes
459   throw FileNotFoundException =&amp;gt; rescue Errno.NoEntryError
499   Pathname#cleanpath messes up the pathname
467   &amp;quot;igem install rails&amp;quot; fails
375   &amp;quot;ir script\server&amp;quot; causes a YAML parser error
461   Generic type conversion from Fixnum to Integer
674   autoload does not use File::SEPARATOR
1021  Time class instance
578   yield fails in eval'd code
605   Array#hash should properly handle recursive arrays&lt;/pre&gt;

&lt;h5&gt;&lt;font color="#ff8000" size="3"&gt;Enjoy!&lt;/font&gt;&lt;/h5&gt;

&lt;p&gt;Please test out IronRuby 0.6 and let us know if you have any issues. We hope you enjoy this release!&lt;/p&gt;

&lt;p&gt;-- The IronRuby team&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:2ecdd2dc-79c7-43ba-bc42-a6988ab05145" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/IronRuby" rel="tag"&gt;IronRuby&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Performance" rel="tag"&gt;Performance&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Cucumber" rel="tag"&gt;Cucumber&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Testing" rel="tag"&gt;Testing&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Release" rel="tag"&gt;Release&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Ruby" rel="tag"&gt;Ruby&lt;/a&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=8j5Hui9FE2k:v1EuFEgoZ_U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=8j5Hui9FE2k:v1EuFEgoZ_U:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=8j5Hui9FE2k:v1EuFEgoZ_U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=8j5Hui9FE2k:v1EuFEgoZ_U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=8j5Hui9FE2k:v1EuFEgoZ_U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=8j5Hui9FE2k:v1EuFEgoZ_U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=8j5Hui9FE2k:v1EuFEgoZ_U:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/8j5Hui9FE2k" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/8j5Hui9FE2k/ironruby-06-released.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm3.static.flickr.com/2425/3681583787_3e4deb7c3b_t.jpg" height="72" width="72" /><thr:total>8</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/07/ironruby-06-released.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5419182.post-1161296163964649056</guid><pubDate>Mon, 29 Jun 2009 07:55:00 +0000</pubDate><atom:updated>2009-06-29T00:55:41.455-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Testing</category><category domain="http://www.blogger.com/atom/ns#">IronPython</category><title>Simple Python testing in Silverlight with unittest</title><description>&lt;p&gt;Since doing a &lt;a href="http://blog.jimmy.schementi.com/2009/03/testing-c-silverlight-apps-with.html" target="_blank"&gt;post about Ruby testing of Silverlight applications&lt;/a&gt;, I’ve felt a bit guilty about leaving Python fans in the dark. However, like Ruby, it takes very little work to run Python unit test frameworks in &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt;, since &lt;a href="http://ironpython.codeplex.com" target="_blank"&gt;IronPython&lt;/a&gt; is a very compatible implementation of Python. Though my results aren’t as exhaustive as the &lt;a href="http://ironruby.net" target="_blank"&gt;IronRuby&lt;/a&gt; examples, here’s one simple example:&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://github.com/jschementi/europycon2009"&gt;&lt;font size="3"&gt;http://github.com/jschementi/europycon2009&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://github.com/jschementi/europycon2009/zipball/master" target="_blank"&gt;zip download&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://twitpic.com/8qp95"&gt;&lt;img style="display: inline" title="unittest-sl" alt="unittest-sl" src="http://lh4.ggpht.com/_OqCZhp9yI0Q/SkhzfAoHhgI/AAAAAAAAAK8/dtOcQGKY6tU/unittest-sl_thumb%5B3%5D.png?imgmax=800" width="400" height="205" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The original example is from the &lt;a href="http://docs.python.org/library/unittest.html#basic-example" target="_blank"&gt;Python website’s unittest documentation&lt;/a&gt;. Very little bootstrapping is required to get this running in Silverlight; this is u1.py code that is the start-script for the Silverlight app, which runs the tests:&lt;/p&gt; &lt;script src="http://gist.github.com/137516.js"&gt;&lt;/script&gt;  &lt;p&gt;I did have to make a modification to &lt;a href="http://github.com/jschementi/europycon2009/blob/aa699c185a15f383bbee68f58fb5ae002de9b49b/u1/app/Lib/unittest.py#L862" target="_blank"&gt;unittest.py&lt;/a&gt;; removing a call to sys.exit since Silverlight doesn’t support that, and just returning the exit code. &lt;/p&gt;  &lt;p&gt;There’s also a GUI test runner (&lt;a href="http://pyunit.sourceforge.net/pyunit.html#GUI"&gt;http://pyunit.sourceforge.net/pyunit.html#GUI&lt;/a&gt;), so it might be interesting to port that to Silverlight to get a nicer test run graphic along with the console, but it’s great that the REPL enables this to just work =) It also helped me find some bugs with the REPL, which will make their way to the IronPython source code shortly.&lt;/p&gt;  &lt;p&gt;Let me know how it works for you. The next step is to tackle testing Silverlight C#/VB apps with Python.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:db9ffb84-3699-472c-809f-0f696ccf3057" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/IronPython" rel="tag"&gt;IronPython&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Testing" rel="tag"&gt;Testing&lt;/a&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=RnR1tYF1sHQ:dxZCGjtMDhA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=RnR1tYF1sHQ:dxZCGjtMDhA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=RnR1tYF1sHQ:dxZCGjtMDhA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=RnR1tYF1sHQ:dxZCGjtMDhA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=RnR1tYF1sHQ:dxZCGjtMDhA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?i=RnR1tYF1sHQ:dxZCGjtMDhA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/jimmy-thinking?a=RnR1tYF1sHQ:dxZCGjtMDhA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/jimmy-thinking?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/jimmy-thinking/~4/RnR1tYF1sHQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/jimmy-thinking/~3/RnR1tYF1sHQ/simple-python-testing-in-silverlight.html</link><author>noreply@blogger.com (Jimmy Schementi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_OqCZhp9yI0Q/SkhzfAoHhgI/AAAAAAAAAK8/dtOcQGKY6tU/s72-c/unittest-sl_thumb%5B3%5D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.jimmy.schementi.com/2009/06/simple-python-testing-in-silverlight.html</feedburner:origLink></item></channel></rss>
