Nick Sieger: Tag rubyconf2006 http://blog.nicksieger.com/articles/tag/rubyconf2006?tag=rubyconf2006 en-us 40 RubyConf: Graphics with Ruby <p>Geoff Grosenbach is waxing on pagefuls of numbers condensed into a small, tidy graph that increases the amount of information you can communicate on a page&#46;</p> <p><a href="http://www.flickr.com/photos/nicksieger/279242427/" title="Photo Sharing"><img src="http://static.flickr.com/107/279242427_32770c5081_m.jpg" width="240" height="160" alt="Topfunky fox" /></a><br/> <em>The cartoon fox makes his second appearance of the day in one of Geoff&#8217;s sparklines</em></p> <p>It is in our hands, the hands of the programmer, to show designers what the range of visual representation capabilities are&#46;</p> <h2>Libraries</h2> <ul> <li>Scruffy &#45;&#45; SVG graphs, no dependencies (i&#46;e&#46;, RMagick)</li> <li>GNUPlot &#45;&#45; the old standby</li> <li>MRPlot &#45;&#45; scientific plots</li> <li>PNG &#45;&#45; line and font drawing in pure ruby from Seattle&#46;rb</li> <li>Gruff &#45;&#45; depends on RMagick</li> <li>Sparklines &#45;&#45; depends on RMagick</li> <li>[Ploticus and RRD were mentioned during the talk as well]</li> </ul> <h2>Applications</h2> <ul> <li>Automatically generating image mastheads with a font mask, a gradient and a cloud image showing through the mask</li> <li>UrbanDrinks&#46;com &#45;&#45; plotting bars on a timeline showing happy hours in Portland</li> <li>&#8220;Scene graph&#8221; &#45;&#45; rendering multiple layers of images/icons on the filesystem into a composite graphics &#8220;scene&#8221;</li> <li>BillMonk&#46;com &#45;&#45; rendered image with multiple components that allows you to circumvent cross&#45;site or crippled javascript issues</li> <li>In a Rails controller: <ul> <li>Generate and cache (with <code>caches_page</code>) an image with text</li> <li>Register a new mime type and use <code>responds_to {|type| type.jpg { ... } }</code></li> </ul></li> <li>Requisite reference to Edward Tufte</li> </ul> <h2>Techniques</h2> <ul> <li>Comparisons &#45;&#45; show two competing trendlines on a graph</li> <li>Multivariate analysis &#45;&#45; stockhive&#46;com stock chart rendering</li> <li>Content is king &#45;&#45; be judicious</li> </ul> Fri, 20 Oct 2006 20:18:00 +0000 urn:uuid:c4cb7cde-ff0f-4760-aefe-71d6461b89b3 Nick Sieger http://blog.nicksieger.com/articles/2006/10/20/rubyconf-graphics-with-ruby ruby rubyconf rubyconf2006 http://blog.nicksieger.com/articles/trackback/77 RubyConf: Matz Roundtable <p><em>An annual tradition at RubyConf is the &#8220;Roundtable&#8221;, where any member of the audience can come up and ask Matz any question&#46; Transcript follows with partial paraphrasing&#46;</em></p> <p><em>Q&#46; Will Ruby ever get the features of <code>evil</code> built in? Will we get <code>become</code>?</em> No&#46;</p> <p><em>Q&#46; If Symbol is a &#8220;frozen&#8221; String, why do we need Symbol?</em> I don&#8217;t have a complete answer to that question &#45;&#45; following tradition&#46;</p> <p><em>Q&#46; What&#8217;s the most unusual architecture Ruby has ever run on?</em> Ruby&#46;&#46;&#46;I can&#8217;t think of one&#46;&#46;&#46;JRuby? Some guys ran compiled Ruby on the NECS supercomputer&#46; [From the audience] Symbian&#46;</p> <p><em>Q&#46; As Ruby gains acceptance, it becomes more resistance to change&#46; How do you keep agile while gaining momentum?</em> We have forked off 1&#46;8, so if you want stable, use Ruby 1&#46;8 forever&#46;</p> <p><em>Q&#46; The array patch &#45;&#45; is there any chance of a backport for those of us who want 1&#46;8 forever?</em> Could be, but the current patch has a bug in 1&#46;9&#46;</p> <p><em>Q&#46; Why isn&#8217;t YARV the only VM for 1&#46;9? [Comment about register&#45;based VM]</em> I&#8217;m not sure whether stack&#45;based or register&#45;based VMs are better&#46;&#46;&#46;[THAT GUY!]&#46;&#46;&#46;[Given the hook]</p> <p><em>Q&#46; It seems like momentum is based on strong metaprogramming facilities&#46; With 1&#46;9 there are more user&#45;friendly features&#46; Will code eventually be data, or are we just patching on techniques on a tool that is being used more heavily?</em> An extreme way to do metaprogramming is to use Lisp, but for practicality we have to start somewhere&#46; I&#8217;m not sure that s&#45;expressions are the way to go&#46; We&#8217;re not going to have macros&#46; It will remain similar to what we have in 1&#46;9&#46; <em>The ability to serialize code would be really powerful &#45;&#45; will that happen?</em> Disclosing internal state is tricky because it changes&#46; It could be a platform&#45;specific feature&#46;</p> <p><em>Q&#46; Recently for 1&#46;9, there was a patch for Array and String to be in the object header&#46; Was this profiled? It seems like it would be an incredible performance problem&#46;</em> It was done for slowness of malloc and gc&#46; In some cases it could run slower, but it benchmarked at about 5% faster&#46; It should be tested thoroughly&#46;</p> <p><em>Q&#46; Ruby 2&#46;0 will not have green threads or continuations, correct? Are there specific reasons for that decision?</em> It is difficult to implement green threads in YARV&#46;</p> <p><em>Q&#46; People want to see development move quickly, but may not be able to contribute code&#46; Can you suggest ways for those programmers to contribute?</em> Submit patches to the list&#46; What is the obstacle to joining us? [Question restated] Submit testing, submit documentation&#46; Contribute to RubyCentral? (looks at Chad Fowler)</p> <p><em>Q&#46; The CSV library is useful, but slow&#46; Can we see FasterCSV in stdlib?</em> It&#8217;s ok to replace the csv library with FasterCSV, as long as the compatibility issues are resolved&#46;</p> <p><em>Q&#46; I want to thank you because I love writing in Ruby every day&#46; I tried to write Python first&#46; Recently an unrelated upgrade broke my Python apps&#46; Will we be able to manage multiple versions of Ruby?</em> You&#8217;ll have to have two versions, 1&#46;8, and future ones&#46;</p> <p><em>Q&#46; What would you say is the most important feature of your personality that has given you success?</em> Endurance? <em>Can you elaborate?</em> It&#8217;s easy to design a language, many of them disappear in a year or two&#46; I&#8217;ve been working on Ruby for 13 years&#46;</p> <p><em>Q&#46; I wanted to see in IRB how the class was implemented at runtime&#46; (He means an uneval feature)</em> [Audience member (Eric Hodel?) mentioned ParseTree]</p> <p><em>Q&#46; If there wasn&#8217;t Ruby, what would you be programming in?</em> Some language of my own not named Ruby&#46;</p> <p><em>Q&#46; Do you still look at RCRchive?</em> Yes&#46; I&#8217;ll talk about it in the keynote&#46;</p> <p><em>Q&#46; I would like a feature abstraction that would allow Ruby to fork itself rather than actually forking&#46; Can you see this added to core?</em> We have to define the behavior of that feature&#46; We have to have a good name for the method&#46; Then there will be no problem to add it to core&#46;</p> <p><em>Q&#46; Why do you need to bind methods to an object of the same original module?</em> If you bind a method taken from String class to Array class, it will crash, and we need to prevent it&#46;</p> <p><em>Q&#46; What do you think of Ruby&#46;NET?</em> I&#8217;m pretty open to new implementations&#46; <em>Should there be a standard (language specs) that other projects should follow?</em> <a href="http://headius.blogspot.com">Charles</a> started work for a <a href="http://www.headius.com/rubyspec/">written 1&#46;8 spec</a>, and I&#8217;ll help him with that if I have time&#46;</p> Sat, 21 Oct 2006 02:59:38 +0000 urn:uuid:4056b0d7-7b02-4fae-b5b7-536b0cfa5b76 Nick Sieger http://blog.nicksieger.com/articles/2006/10/21/rubyconf-matz-roundtable rubyconf rubyconf2006 http://blog.nicksieger.com/articles/trackback/83 Rubyconf Wrap-Up <p>Whew! Back home from my first RubyConf, it&#8217;s taken me a couple days to collect some parting thoughts&#46; As you might have noticed, I was <a href="/articles/tag/rubyconf2006">pretty busy last weekend</a>&#46;</p> <p>First of all, what an awesome and welcoming community&#46; It&#8217;s going to sound clich&eacute;, but there are so many intelligent and motivated people walking around that you can&#8217;t help but be inspired to roll up your sleeves and get your hands dirty&#46;</p> <p>There were definitely some high points for me&#46; The beauty and power of the language, even after using it for almost two years, still amazes me&#46; Pretty much every piece of code I saw, whether in a presentation or looking over someone&#8217;s shoulder, had a clear purpose and communicated its intent better than any general&#45;purpose machine language I have seen&#46; The simplicity of Evan&#8217;s new <a href="/articles/2006/10/20/rubyconf-sydney-and-rubinius">Ruby&#45;in&#45;ruby VM</a>, the syntax integration tricks of John&#8217;s <a href="/articles/2006/10/23/rubyconf-your-ruby-in-my-clr">RubyCLR</a> project, the forthcoming <a href="/articles/2006/10/21/rubyconf-mac-os-x-and-ruby">RubyOSA</a> APIs, and Geoffrey&#8217;s <a href="/articles/2006/10/20/rubyconf-graphics-with-ruby">graphics programs</a>, are all great testaments to Ruby&#8217;s power&#46;</p> <p>There was an implementer&#8217;s summit on Friday night, which I attended (see also coverage <a href="http://tbray.org/ongoing/When/200x/2006/10/20/RubyConf">here</a> and <a href="http://on-ruby.blogspot.com/2006/10/rubyconf-2006-implementers-summit.html">here</a>)&#46; There are now at least 8 active implementations of Ruby (<a href="http://www.ruby-lang.org/">Ruby</a>, <a href="http://www.atdot.net/yarv/">Yarv</a>, <a href="http://www.jruby.org/">JRuby</a>, <a href="http://on-ruby.blogspot.com/2006/09/ruby-hacker-interview-kevin-tew.html">Cardinal</a>, <a href="http://blog.fallingsnow.net/rubinius/">Rubinius</a>, <a href="http://www.zenspider.com/Languages/Ruby/MetaRuby.html">MetaRuby</a>, <a href="http://plas.fit.qut.edu.au/Ruby.NET/">Ruby&#46;NET</a>, <a href="http://wilcoding.xs4all.nl/wilco/IronRuby.aspx">IronRuby</a>), and two interop bridges (<a href="http://www.rubyclr.com/">RubyCLR</a> and <a href="http://www.rubycocoa.com/">RubyCocoa</a>)! The biggest news was that there are plans to revive the <a href="http://rubyforge.org/projects/rubytests">Ruby testing</a> project (formerly the Rubicon) and share as many tests as possible among the implementations&#46;</p> <p><a href="http://www.forbiddenweb.org/topic/126213/index.html">RejectConf</a> was a huge success, due largely to the indefatigable <a href="http://nubyonrails.com/articles/2006/10/24/adam-keys-ussruby-sketch-from-rubyconf-2006">Adam</a> <a href="http://youtube.com/results?search_query=adamkeys&amp;search=Search">Keys</a>&#46; <a href="http://blog.tewk.com/?p=88">Kevin Tew</a> has a decent wrap&#45;up of the talks that occurred&#46; <a href="http://headius.blogspot.com/">Charlie&#8217;s</a> demo of NetBeans in&#45;place refactoring feature drew a couple oohs and ahs and even one f&#45;bomb&#46; <a href="http://blog.zenspider.com/archives/2006/10/heckle_another_rubyconf_hack.html">Heckle</a>, in time, should be an awesome tool as well&#46; Big thanks to <a href="http://www.zenspider.com/">zenspider</a> for coordinating it&#46; It&#8217;s destined to become an annual tradition&#46; Perhaps the organizers of future RubyConfs could account for it in the budget?</p> <p>On a lighter note, there were quite a few humorous moments that kept popping up&#46; A <a href="http://ni.hili.st/posts/pages/16">summary may read like a list</a> of inside jokes, so here&#8217;s some context&#46; <strong>THAT GUY</strong> is a reference to a disclaimer in <a href="/articles/2006/10/21/rubyconf-zed-shaw-fuzzing">Zed&#8217;s talk</a> about the <a href="http://perl.plover.com/yak/presentation/samples/slide027.html">know&#45;it&#45;all guy who always pipes up during your talk</a> with skepticism&#46; THAT GUY kept getting called out during the rest of the conference&#46; Ani, the developer evangelist from Microsoft was pretty thick&#45;skinned&#46; She was heckled constantly about MS, Vista, and everything else, and still kept a smile on her face&#46; And of course you already watched Adam&#8217;s one&#45;act play, right?</p> <p>My note&#45;taking streak wasn&#8217;t quite perfect; I didn&#8217;t take notes Kevin&#8217;s mkmf talk nor Rich&#8217;s talk about indi, and I slept in and missed Justin&#8217;s Streamlined talk&#46; Also, the beer was flowing for RejectConf, and despite the quality summer of code talks, I was spent&#46; Fortunately, you can fill in the blanks by following along with <a href="http://www.oreillynet.com/ruby/blog/2006/10/blogging_about_rubyconf_2006.html">Curt Hibbs</a> and the <a href="http://technorati.com/tags/rubyconf2006">rest of the blogosphere</a>&#46; Thanks for tuning in, and I hope you got something worthwhile here&#46; See you next year!</p> Tue, 24 Oct 2006 22:51:55 +0000 urn:uuid:0b5efe1d-0753-4dff-8919-0727d6672893 Nick Sieger http://blog.nicksieger.com/articles/2006/10/24/rubyconf-wrap-up rubyconf rubyconf2006 http://blog.nicksieger.com/articles/trackback/106 RubyConf: Rinda in the Real World <p><em>Speaker: <a href="http://www.vanderburg.org/">Glenn Vanderburg</a></em></p> <p>Rinda is a distributed coordination system, by Masatoshi SEKI, based on work by David Gelernter (called Linda)&#46; It&#8217;s similar to JavaSpaces, but more in the Ruby spirit&#46; It uses DRb for communication (also by Seki&#45;san)&#46;</p> <p>There are several existing tutorials on Rinda, but none with a broad, real&#45;world applicability&#46; As Glenn started to go deeper with Rinda, flaws began to be exposed&#46;</p> <h2>Rinda Basics</h2> <ul> <li>The <strong>TupleSpace</strong> is in the conceptual middle, as a bag of tuples &#8220;arrays&#8221;&#46; Participants can write tuples into the space, or take them out (usually according to a set of conditions)&#46;</li> <li><strong>Tuples</strong> are usually requests to do some work by some unknown requester, or responses to that work&#46;</li> <li>A <strong>RingServer</strong> is a broadcast/multicast lookup service for finding Rinda tuplespaces&#46;</li> <li><strong>Templates</strong> are used to find tuples to take&#46; <code>Template#match</code> requires that the tuples have the same length, and that all the non&#45;nil elements are triple&#45;equal (<code>===</code>)&#46;</li> <li>In practice arrays are always used in the <code>#take</code> and <code>#write</code> methods, and they&#8217;re implicitly converted to the appropriate object&#46;</li> </ul> <h2>Protocol design</h2> <p>When you&#8217;re deciding what to store/read in the tuples, you&#8217;re essentially designing a communication protocol&#46; So you need to take the extra precautions required as you would when designing any API or protocol, including documentation, evolution of changes, process workflow, etc&#46;</p> <ul> <li><em>Parts of tuples:</em> command/request, identifiers, and associated parameters/data&#46; Usually templates will match on the command, sometimes on the ID, but never on the data&#46; </li> <li>Strings work well in tuples, because you can use Regexps to select them&#46;</li> <li>Numbers work well, because you can match them with Ranges</li> <li>Symbols don&#8217;t work so well (at least until <a href="http://redhanded.hobix.com/inspect/SymbolIs_aString.html"><code>Symbol &lt; String</code></a>)</li> <li>Communication patterns &#45;&#45; synchronous communication is not a good fit for a Rinda architecture (e&#46;g&#46;, a request for status)</li> </ul> <h2>Deployment</h2> <p>DRb does not marshal code/behavior (unlike Java and RMI)&#46; This is a limitation that forces you to consider how to use custom objects in the tuples, because the code must be shared (and thus jointly upgraded) across all participants&#46;</p> <p>Multiple processes are probably more reliable for the various components of the architecture (RingServer, TupleSpace, clients) rather than using green threads, although this is just a hypothesis&#46;</p> <p>The TupleSpace is the single point of failure &#45;&#45; if the process with it crashes, when it starts back up, it&#8217;s likely to have a new DRb URL, so it&#8217;s helpful to have a proxy around the tuple space in clients that can rediscover it if it crashes&#46;</p> <p>Be wary of multiple ring servers on the same subnet! Behavior may be unexpected&#46; You may notbe using the tuple space that you wanted, and when the other ring server goes away, so does your tuple space&#46;</p> <p>DRb does not have any security built into it, such as unforgeable object IDs, encrypted transport, authentication, etc&#46; This can be a problem in some situations&#46;</p> <p>There is no persistence by default, so consider adding some for crash resistance, or deal with occasional loss of tuples&#46;</p> <p>There are no transactions, so the requester will never know if it still processing or was lost&#46;</p> <p>As Ruby matures and gains exposure, some libraries that have been good enough for a while may need reconsideration&#46; As a case in point, Rinda and DRb haven&#8217;t been updated since February of 2004&#46;</p> <h2>Q &amp; A</h2> <p><em>Q&#46; Are write/take atomic?</em> Yes, if you timeout, the tuple will still be there&#46; Two workers cannot get the same tuple&#46;</p> <p><em>Q&#46; Where would you use this instead of traditional message queues (reinvent the wheel)?</em> There&#8217;s more flexibility in this architecture&#46; (Justin Gehtland) In this particular case, they have a JMS backend, but the Ruby code could not assume connectivity to that backend&#46;</p> <p><em>Q&#46; Is there a common correlator design pattern?</em> Tie response types to request types to limit the pool of potential matches&#46; In the situation where there is a single requester, it&#8217;s simple to just generate sequential numbers&#46; In a P2P situation, you may need to use a hostname or PID to help distinguish&#46; [Sounds like a GUID/UUID system to me&#46;]</p> <p><em>Q&#46; Have you used expiry dates to grab abandoned tuples?</em> No, sounds like an interesting possibility&#46;</p> Sat, 21 Oct 2006 19:01:35 +0000 urn:uuid:ec8eface-3fb9-477d-8ad8-e91e4c5c9a1d Nick Sieger http://blog.nicksieger.com/articles/2006/10/21/rubyconf-rinda-in-the-real-world rubyconf rubyconf2006 http://blog.nicksieger.com/articles/trackback/89 RubyConf: Your Ruby in My CLR <p><strong>John Lam</strong> wanted to build a photo&#45;flash&#45;card application using Avalon and Indigo and Flickr, but also using Ruby as the implementation language&#46; So along the way he decided to build an interop layer (a bridge) between Ruby and the CLR to do it&#46;</p> <p>Now that John has <a href="http://www.iunknown.com/articles/2006/10/20/dynamic-languages-microsoft-and-me">joined Microsoft</a>, his new mission (bigger picture) is to further dynamic language implementations on the CLR&#46;</p> <h2>Bridging type systems</h2> <ul> <li><p>Dynamic methods in the CLR allow you to do better than simply invoking the reflection API&#46;</p> <pre><code>Ruby | C | CLR ============================================ shadow class | dynamic method | instance </code></pre></li> <li><p>Polymorphic inline caching &#45;&#45; caching method dispatches on different call sites based on the assumption that types don&#8217;t change that often</p></li> <li>Generate shadow classes and method stubs using <code>const_missing</code> and <code>method_missing</code></li> <li>Overload resolution happens in the method shims (a one time cost) to choose, e&#46;g&#46;, which constructor to use for <code>System::Collections::ArrayList.new</code></li> <li>Integration is done to make the CLR feel more Rubyish</li> </ul> <h2>Implementation</h2> <ul> <li><p>This changes identity (proxied object):</p> <pre><code>ArrayList.new.as(IEnumerable) </code></pre></li> <li><p>This is less Rubyish, but identity is preserved:</p> <pre><code>IEnumerable.get_enumerator(ArrayList.new) </code></pre></li> </ul> <p>There are trade&#45;offs and warts to a bridge approach to Ruby integration on top of a platform such as the CLR: there is a need to inject artificial type information occasionally to be able to construct CLR objects (e&#46;g&#46;, arrays &#45;&#45; <code>Array.of(Int32).new(3)</code>)&#46; Generics are evil! Simple stuff doesn&#8217;t seem so bad: <code>List.of(Int32).new</code>, but there&#8217;s more pain to be had (see John for details)&#46; John also built a RubyInline&#45;like implementation for the CLR languages too, to allow for getting things done (even if it&#8217;s dirty)&#46; Finally, method overloading is a problem, especially when there is no equivalent Ruby type &#45;&#45; this gave way to <code>instance_shim</code> which is a sort of aliasing method that mixes in type metadata for use by the interop layer&#46;</p> <p>On the other hand, there are many places where Ruby (even in bridged mode) can make the experience of developing on the CLR better&#46; Implementing CLR interfaces is a feature that allows Ruby objects to cross to the CLR side, (e&#46;g&#46;, adding IEnumerable to Ruby Array)&#46; Performance across the CLR boundary (marshalling data) is ~100 times slower than C#, but still fast (3 million calls/second)&#46; Huge benefits are gained from using DSLs in Ruby to help with the implementation of the interop layer&#46; Also, RubyCLR allows mixing in methods into CLR types, so we can re&#45;skin APIs that feel clunky in Ruby&#46; This is really leveraging the power of Ruby in the best possible way&#46;</p> <p>My take is that it looks like the RubyCLR project will probably not be seeing much further development, unless John finds a willing maintainer &#45;&#45; but this is speculation, I haven&#8217;t confirmed with John&#46; Yet, the problem of impedance matching between type systems is a recurring theme in the dynamic language arena, and so John&#8217;s work is valuable in helping us to understand this issue&#46;</p> <h2>More Info</h2> <ul> <li><a href="http://www.rubyclr.com/">http://www&#46;rubyclr&#46;com/</a></li> <li><a href="http://www.iunknown.com/">http://www&#46;iunknown&#46;com/</a></li> </ul> Mon, 23 Oct 2006 14:16:00 +0000 urn:uuid:b565842e-e6dc-4ddf-bc06-69de35a90870 Nick Sieger http://blog.nicksieger.com/articles/2006/10/23/rubyconf-your-ruby-in-my-clr ruby rubyconf rubyconf2006 http://blog.nicksieger.com/articles/trackback/97 RubyConf 2006 Begins <p>The RubyConf room is filling up this morning&#46; I&#8217;ll be doing my best to live&#45;blog the conference here so stay tuned!</p> <p><a href="http://www.flickr.com/photos/nicksieger/274770531/" title="Photo Sharing"><img src="http://static.flickr.com/110/274770531_01f9ba4a44_m.jpg" width="240" height="160" alt="DSCF4909.JPG" /></a></p> <p><a href="http://www.flickr.com/photos/nicksieger/274770462/" title="Photo Sharing"><img src="http://static.flickr.com/79/274770462_957803fcd8_m.jpg" width="240" height="160" alt="DSCF4908.JPG" /></a></p> Fri, 20 Oct 2006 19:04:00 +0000 urn:uuid:0de6115d-57e6-482e-9c45-964a94088b5b Nick Sieger http://blog.nicksieger.com/articles/2006/10/20/rubyconf-2006-begins ruby rubyconf rubyconf2006 ruby http://blog.nicksieger.com/articles/trackback/74 RubyConf: History of Ruby <p>Takahashi&#45;san is here to present on the history of Ruby, an apparently thankless task, because none of the other original Rubyists are historians&#46; Takahashi is the co&#45;author of two Japanese books on Ruby, <em>Enjoy Ruby</em> and <em>Ruby Recipe Book</em>&#46; He also has the &#8220;Takahashi method&#8221; of presentation named after him&#46; His talk presented an informative timeline of Ruby, the details of which were a bit tricky to capture&#46; If I transcribed anything erroneously, please let me know&#46;</p> <h2>Pre&#45;history age</h2> <ul> <li>Born 24th of February 1993&#46; Without code! </li> <li>Matz and Keiju&#45;san proposed the name first&#46;</li> <li>Thus one of the philosophies of Ruby came to be &#45;&#45; that the name of things matters&#46; Matz: &#8220;I guess Ruby is cool&#8221;&#46; Keiju: &#8220;I also like coral&#8221;&#46; Matz: &#8220;oops&#8221;&#46;</li> </ul> <h2>Ancient age</h2> <ul> <li>Ruby is in public &#45;&#45; release 21 December 1995 &#45;&#45; ruby&#45;0&#46;95&#46;</li> <li>ruby&#45;list ML was launched&#46; First mail: ruby&#45;0&#46;95 test failed&#46; Subsequently 3 versions of Ruby were released in two days&#46;</li> <li>No CVS repository at the time&#46; Anonymous CVS was to come in 1999&#46;</li> <li>25 December 1996 &#45;&#45; Ruby 1&#46;0 released&#46;</li> <li>1 July 1997: Matz announces that Netlab hired him to be a full&#45;time Ruby developer&#46;</li> <li>22 Septempber 1997: an article was published on Ruby &#45;&#45; the first article on the web about Ruby&#46;</li> <li>15 May 1998: RAA launched, maintained manually by Matz&#46;</li> <li>7 December 1998: Ruby home page was in English, but very simple&#46;</li> </ul> <h2>Middle</h2> <ul> <li>Ruby is spreading in Japan during this time&#46; The community is growing around Japanese programming language designers and programmers who do not understand English&#46; Finally they have a tool that they can embrace and establish their own opinions and choices&#46;</li> <li>27 October 1999: Matz and Keiju&#8217;s book is published, the first Ruby book</li> <li>More Ruby books would follow in 2001&#45;2002 (~20 books &#45;&#45; a bubble)&#46; But the bubble popped in 2003&#46;</li> <li>4 November 1999: Ruby workshop</li> <li>There were some Perl and Ruby/Perl conferences during this time also&#46;</li> <li>26 May 2001: YARPC &#45;&#45; Yet Another Ruby and Perl Conference</li> <li>9 August 2003: Lightweight language (LL) &#45;&#45; lightweight language workshop (LL Saturday) in 2003&#46; PHP, Perl, Ruby and Python were present&#46; LL Weekend, LL Day and Night, and LL Ring would follow in 2004&#45;2006&#46;</li> <li>LL Ring: 300 attendees talking about LLs in a real boxing ring&#46;</li> </ul> <h2>Modern</h2> <ul> <li>Ruby spreads outside of Japan</li> <li>16 Feb 2002 &#45;&#45; ruby&#45;talk ML surpasses ruby&#45;list ML&#46; </li> <li>ruby&#45;talk was started in December of 1998, but the first posts are almost all Japanese authors writing in English&#46;</li> <li>SunWorld in Februrary 1999 has an article entitled &#8220;New choices for scripting&#8221; including Ruby&#46;</li> <li>February 2000: IBM Developerworks article on the &#8220;latest open source gem from Japan&#8221;&#46;</li> <li>InformIT article by Matz also in 2000&#46;</li> <li>15 December 2001: Programming Ruby by the Pragprogs (1st edition of the Pickaxe)&#46;</li> <li>RubyConf&#46;new(2001)</li> <li>Ruby Kaigi &#45;&#45; first Japanese Ruby conference didn&#8217;t happen until 2006, it turns out only because of a dinner of Japanese rubyists at RubyConf 2005 decided that it would be fun&#46;</li> </ul> <h2>Contemporary</h2> <ul> <li>Rails age &#45;&#45; the killer application for Ruby</li> <li>We all know what happened, so we&#8217;ll skip this part&#46;</li> </ul> Fri, 20 Oct 2006 19:06:00 +0000 urn:uuid:ef58cdca-f7a4-49f2-b428-968f05a58130 Nick Sieger http://blog.nicksieger.com/articles/2006/10/20/rubyconf-history-of-ruby ruby rubyconf rubyconf2006 http://blog.nicksieger.com/articles/trackback/75 RubyConf: Sydney and Rubinius <p><em>Update: Evan has posted code and has <a href="http://blog.fallingsnow.net/rubinius/">a page set up for the project</a>&#46;</em> </p> <p>Evan Phoenix (nee Webb), of Seattle&#46;rb, is presenting on Sydney and Rubinius, an experiment in improving the ruby interpreter&#46; Sydney has died, and Rubinius has risen from its ashes, appropriately&#46;</p> <h2>Why</h2> <ul> <li>Why would you write a new Ruby interpreter? It&#8217;s fun, it&#8217;s a good challenge&#46;</li> <li>What&#8217;s wrong with the existing interpreter &#45;&#45; are you hating on Matz? Of course not&#46;</li> </ul> <p>Today&#8217;s Ruby interpreter is like a big dump truck &#45;&#45; sometimes a little slow, but it works for us&#46; YARV is like the red, shiny fire truck&#46; Both big and complex&#46; Rubinius, by comparison, is like a dune buggy&#46; Fast, light, but you&#8217;re going to get sand in your eyes if you drive it a lot&#46;</p> <p>The project, admittedly, is naive&#46;</p> <ul> <li>Simple architecture and implementation&#46;</li> <li>As little background magic as possible</li> <li>No opaque C backend</li> <li>Leverage axiom of simple == powerful</li> <li>Less magic means more introspection <ul> <li>More control for the developer</li> <li>Richer introspection: Backtrace, MethodTable objects</li> </ul></li> </ul> <h2>What was Sydney?</h2> <ul> <li>Giant patch to 1&#46;8&#46;2 that included reentrancy and thread&#45;safety</li> <li>Turned out to be a major PITA</li> <li>CRuby uses a large number of C globals, references to which had to be tracked and fixed</li> </ul> <h2>Transition to Rubinius</h2> <ul> <li>Ruby borrowed a lot from Smalltalk, so why not try an implementation based on the same concepts?</li> <li>Prototype A ported the blue&#45;book implementation to Ruby</li> <li>It worked and validated the basic concept and approach</li> <li>Prototype B took ideas from A but implemented a bytecode interpreter and compiler&#46; Used RubyInline to access raw memory operations&#46;</li> <li>At this time the goal emerged to have a translator which could take a prototype and bootstrap itself into C code&#46;</li> <li>Prototype S was a manual translation of Prototype B into C code to make the implementation quicker&#46;</li> <li>Prototype W was created to translate parts of Prototype B so that there is a maintainable core in Ruby code itself&#46;</li> </ul> <h2>Questions</h2> <p><em>Q&#46; Since you were starting over, could you use a platform&#45;independent library to ease the process, such as APR?</em> Yes &#45;&#45; currently using String and PointerArray from glib&#46;</p> <p><em>Q&#46; How is performance?</em> Too early to tell &#45;&#45; I hope to know by the end of the conference&#46; Prototype S became runnable and usable on the plane here&#46;</p> <p><em>Q&#46; Can you clarify the goal?</em> To create a Ruby interpreter in Ruby that can translate itself out into a C interpreter&#46;</p> <p><em>Q&#46; Have you figured out how to link in external libraries in a platform independent way?</em> No&#46; My hope is that the decision will be made to write a common framework for translating to system calls, e&#46;g&#46;, SWT&#46;</p> <p><em>Q&#46; Have you looked at PyPy? (similar project for Python)</em> Yes, and it&#8217;s f&#45;in complicated&#46; It worries me actually&#46;</p> <p><em>Q&#46; Could you have it generate backend code in another language/platform (Java bytecode, CLR)?</em> Yes, I certainly hope so, otherwise I&#8217;m wasting my time&#46;</p> <p><em>Q&#46; How will you add native thread support in a cross&#45;platform way?</em> I hope I won&#8217;t have to, by leveraging external tools&#46;</p> <p><em>Q&#46; If you&#8217;re building a Ruby&#45;to&#45;C translator, why write a Ruby interpreter at all?</em> If I didn&#8217;t, what would I translate? You still need some core engine to translate&#46; <em>Would it be a subset of Ruby?</em> Yes&#46;</p> <p><em>Q&#46; Looks very similar to Squeak, have you looked at Squeak code and talked to Squeak people?</em> Looked at code a lot, I&#8217;ve really stolen all of their ideas&#46; I haven&#8217;t talked to the folks yet because I&#8217;m afraid they might laugh at me&#46;</p> <h2>Resulting Works</h2> <ul> <li>SydneyParser: Used parser from Sydney and stole ParseTree&#8217;s algorithm for generating a sexp that represents the Ruby code&#46;</li> <li>SegfaultProtection: detects a segfault in an extension, saves the Ruby interpreter, and raises a memory fault exception instead&#46;</li> </ul> <h2>The Nitty Gritty (Red Pill)</h2> <ul> <li>All components separated by APIs for swappability</li> <li>Garbage collector: baker two&#45;space copy collector, and a train GC</li> <li>Bytecode interpreter: small set of instructions driven by tests and need, so there are no extraneous operations</li> <li>Compiler: written completely in Ruby, using ParseTree and SexpProcessor&#46; Intended to compile itself to be used as a base compiler for Prototype S&#46;</li> </ul> <h2>Future</h2> <ul> <li>Other backends &#45;&#45; Java, Smalltalk</li> </ul> <h2>More questions</h2> <p><em>Q&#46; Worried about fragmentation?</em> Yes, but I really want to make it as compatible as possible with the current interpreter&#46;</p> <p><em>Q&#46; Rubinius bytecode compatibile with YARV?</em> No, but I hope to be able to write a bridge to YARV in Rubinius&#46;</p> <p><em>Q&#46; Have you looked at Valgrind for the C code?</em> Yes, I have&#46; Good possibility for future direction&#46;</p> <p><em>Q&#46; Can you demo some code?</em> They&#8217;re incredibly boring&#46; &#8220;Look I got a MethodTable object, I asked for one&#46;&#8221;</p> Fri, 20 Oct 2006 19:07:00 +0000 urn:uuid:9785ffcc-1680-492c-8b42-6e9111cc85aa Nick Sieger http://blog.nicksieger.com/articles/2006/10/20/rubyconf-sydney-and-rubinius ruby rubyconf rubyconf2006 ruby http://blog.nicksieger.com/articles/trackback/76 RubyConf: Zed Shaw: Fuzzing <h2>What is Fuzzing?</h2> <ul> <li>Throw random stuff at an app until it breaks, with maliciously crafted inputs&#46; It&#8217;s the randomness, stupid&#46;</li> <li>Creating a model for an attack</li> <li>Sampling, survival analysis and mean&#45;time&#45;between&#45;failures (MTBF)</li> </ul> <h2>Limitations</h2> <ul> <li>Shallow &#45;&#45; errors come right away, but then few and far between</li> <li>Not smart</li> <li>Not always needed</li> </ul> <h2>Disadvantages</h2> <ul> <li>Destructive &#45;&#45; don&#8217;t do it against your production system!</li> <li>Potentially expensive</li> </ul> <h2>Advantages</h2> <ul> <li>Fun making developers go insane</li> <li>Finds bugs even in closed source software</li> <li>Easy to do when you have the right tools</li> <li>Excellent for regression/load/DDOS/pen testing</li> <li>Large existing base of tools (links from Zed&#8217;s site)</li> </ul> <h2>Demo/Usage</h2> <ul> <li>Designed to be a simple data container for all the HTTP objects, so you can easily store and replay requests</li> <li>Randomness engine (RC4 cipher) generates random bytes, numbers, chars, base64, etc&#46;</li> <li>Data collection (ten runs of ten samples, spits out &#46;csv files)</li> <li>Session management (dump cookie management)</li> <li>Rails security test (see also <a href="/articles/2006/08/15/security-threat-last-week">my post on this subject</a>)</li> <li>Chunked encoding test</li> <li>Mongrel test suite &#45;&#45; test GET vs&#46; PUT to see if there is any difference in performance between the two methods</li> </ul> <h2>Other Ideas</h2> <ul> <li>Random ruby scripts from a grammar</li> <li>Automatic random AR fixtures</li> <li>Thrash functions for unit tests</li> <li>Random thrashing of other protocols</li> <li>Release RFuzz&#8217;s HTTP client separately as an alternative to <code>net/http</code></li> <li>Hpricot and RWB inclusion</li> <li><a href="http://utu.devjavu.com/">Utu</a> &#45;&#45; HCI research to see if it&#8217;s possible to measure how programmers interact</li> </ul> Sat, 21 Oct 2006 02:51:38 +0000 urn:uuid:14460f4d-1fbb-4a14-b91b-7ed22d4e7973 Nick Sieger http://blog.nicksieger.com/articles/2006/10/21/rubyconf-zed-shaw-fuzzing rubyconf rubyconf2006 http://blog.nicksieger.com/articles/trackback/81 RubyConf: John Long: Radiant CMS <h2>What is Radiant?</h2> <ul> <li>No&#45;fluff, lightweight CMS for small teams</li> <li>Simplicity over features</li> <li>A little more than a blogging engine</li> <li>Made for designers and programmers (techies)</li> <li>Tag&#45;based template language</li> <li>Total control over output</li> <li>Plugin extension mechanism under development</li> <li>Content sites, not portal software</li> </ul> <h2>Getting Started</h2> <ul> <li>Install: <code>gem install radiant</code></li> <li>Generate a new application: <code>mkdir demo &amp;&amp; cd demo &amp;&amp; radiant .</code></li> <li>Configure database: <code>cp config/database.sqlite.yml config/database.yml</code></li> </ul> <h2>Installation types</h2> <ul> <li>Instance mode vs&#46; application mode (whether or not you have Rails source present)&#46; Instance mode also makes it possible to clone and share customize Radiant applications&#46;</li> <li>Base application includes an admin interface</li> </ul> <h2>Pages, Snippets and Layouts</h2> <ul> <li>Hierarchical page management</li> <li>Create page in several states (draft, reviewed, published) in Textile or Markdown with slug, breadcrumb, and layout</li> <li>Snippets are small chunks of content that can be shared between pages (to DRY up your content)</li> <li>Layouts that can be broken down into components of the layout (sidebar, etc&#46;)</li> </ul> <h2>Tags</h2> <ul> <li><a href="http://radius.rubyforge.org/">Radius</a></li> <li><code>&lt;r:title/&gt;</code>, <code>&lt;r:content part="sidebar" inherit="true"/&gt;</code>, <code>&lt;r:snippet name="footer"/&gt;</code>, <code>&lt;r:if_content part="extended"&gt;...&lt;/r:if_content&gt;</code>, <code>&lt;r:children:each limit="5" order="desc"&gt;...&lt;/r:children:each&gt;</code></li> <li>Tags can be embedded anywhere, not just in the layout</li> <li>Tags are contextual &#45;&#45; e&#46;g&#46;, <code>&lt;r:title/&gt;</code> picks the correct title even if it is embedded within a snippet within multiple pages</li> <li>Custom tags possible with &#8220;behavior&#8221;</li> </ul> <h2>Text Filters</h2> <ul> <li>Textile (RedCloth), Markdown (BlueCloth), SmartyPants</li> <li>Vanilla HTML (no filtering)</li> <li>Custom filters possible&#46; [This is my own example below, not John&#8217;s&#46;] <div class="typocode"><pre><code class="typocode_ruby "> <span class="keyword">class </span><span class="class">MyFilter</span> <span class="punct">&lt;</span> <span class="constant">TextFilter</span><span class="punct">::</span><span class="constant">Base</span> <span class="ident">register</span> <span class="punct">'</span><span class="string">profanity filter</span><span class="punct">'</span> <span class="keyword">def </span><span class="method">filter</span><span class="punct">(</span><span class="ident">txt</span><span class="punct">)</span> <span class="ident">txt</span><span class="punct">.</span><span class="ident">gsub</span><span class="punct">(/</span><span class="regex">(damn|ass|shit)</span><span class="punct">/</span><span class="ident">i</span><span class="punct">,</span> <span class="punct">'</span><span class="string">####</span><span class="punct">')</span> <span class="keyword">end</span> <span class="keyword">end</span> </code></pre></div></li> </ul> <p>Radiant is powering the new <a href="http://www.ruby-lang.org/">ruby&#45;lang&#46;org</a> site&#46; Overall, a slick, well&#45;thought out, polished, extendable CMS done very much in the philosophy of Ruby and Rails&#46; Check it out!</p> Sat, 21 Oct 2006 02:54:00 +0000 urn:uuid:c4baea74-8073-49c0-be1e-97919ce5fb65 Nick Sieger http://blog.nicksieger.com/articles/2006/10/21/rubyconf-john-long-radiant-cms ruby rails rubyconf rubyconf2006 http://blog.nicksieger.com/articles/trackback/82