On the Civility of Feeding Trolls

Posted by Rick DeNatale Fri, 21 Nov 2008 20:44:00 GMT

_Why speaks on recent adventures in the Ruby community. Well worth the read


Alan Kay, Super Hero

Posted by Rick DeNatale Fri, 21 Nov 2008 05:03:00 GMT

Via Boing-Boing, Business week has just put a comic strip on their web site, which tells the story of how Alan Kay, inspired by a visit to Seymour Papert seeded the idea of portable computers.

Long term readers of this blog no doubt know that I hold Alan Kay in high regard. I got to meet him several times, first I think at an internal IBM conference on Object Oriented Programming in the mid 1980s, Another time was at a Digitalk developers conference, where I obtained a prize possession. At the time I was the IBM technical liaison with Digitalk. They released a new version of Smalltalk/V PM at this particular conference, and I was presented a copy of the supplemental manual for the release signed by all of the Digitalk developers, and also by Alan Kay, who wrote something like “to the most non-IBM like IBMer I’ve ever met.”

Reading the business week strip, I was reminded of an even earlier personal connection with Kay and Smalltalk. A year or so before I really got into Objects, I was working on IBM Mainframe software in Poughkeepsie, NY. One summer the project got an intern, named Radia Perlman, who was in graduate school at M.I.T. And is now known as the “mother of the internet” for her invention of spanning-tree protocol. It was only later that I learned that she was one of Papert’s students working on Logo and seeing how kids learned programming with Logo, and if I recall correctly she also visited Xerox PARC, and was involved in porting the concept of the Logo turtle model of graphics to Smalltalk, where it became the Pen object.

What a long strange trip it is!


In Ruby Globals, Aren't Always Global

Posted by Rick DeNatale Mon, 17 Nov 2008 20:00:00 GMT

Ola Bini, just wrote about how he’s planning to have a special variable to expose the result of a regular expression match in his new language Ioke.

The idea is to introduce a special variable called it, which holds the result of the conditional expression in an if or unless statement, or method in Ioke’s case. Ola says that this is different from the special Ruby globals like $~ because For one, it’s not a global variable. It’s only available inside the lexical context if an ‘if’ or ‘unless’ method. It’s also a lexical variable, meaning it can be captured by a closure. And finally, it’s a general solution to more things than the regular expression problem.

As it turns out, I learned at RubyConf that the Ruby ‘globals’ which give access to the results of the last regular expression match, aren’t really globals at all. This came up in a conversation after the MagLev presentation, when Charlie Nutter asked Allen Otis of Gemstone how they were handling those variables, since they are really frame locals. Matz was standing there and quickly confirmed Charlies observation.

So $~ and it’s friends, like $1, are really more like special names for local variables. Other than the lexical ‘look’ they behave more like locals than globals.

I just concocted a completely bogus Ruby program to demonstrate this.

def lambdas(str, re)
   re.match(str)
   [lambda {$~}, lambda {|str| re.match(str)}]
end
   

m_lambda, match_lambda = *lambdas("this", /(this|that)/)
puts "(m_lambda.call)[1] is #{(m_lambda.call)[1].inspect}"
/(foo)/.match("foo")
puts "$~[1] is #{$~[1].inspect}"
puts "m_lambda still is #{(m_lambda.call)[1].inspect}"
match_lambda.call('that')
puts "now m_lambda is #{(m_lambda.call)[1].inspect}"
puts "$~[1] is still #{$~[1].inspect}"

The lambdas method returns two lambdas, the first simply returns the current value of $~ when evaluated, the second does
a match against the regular expression passed into the lambdas method with a new string, on demand.

When run this produces the following output:

(m_lambda.call)[1] is "this"
$~[1] is "foo"
m_lambda still is "this"
now m_lambda is "that"
$~[1] is still "foo"

Note that $~ in the outer context is a different variable than $~ in the context of the invocation of the lambdas method.
Let’s call these the outer and inner $~ variables respectively.
Doing a regular expression match in the outer context leaves the inner $~ unchanged, while calling the second lambda affects the value of the inner $~ but leaves the outer $~ unchanged.

As they say, you learn something new every day.


Jam Session at RubyConf 2008

Posted by Rick DeNatale Sun, 16 Nov 2008 23:00:00 GMT


Chad Woolley sent a link to this video. That’s yours truly on the right, next to David Chelimsky. Jim Weirich has his back to the camera. Doug Alcorn is sitting on the table. I’m sorry but I don’t know the names of the other two.


Chad also sent a link to a set of photos he took.


Update


Jim Weirich commented “The guitarist in front of me in the orange tie-dye shirt is Corey Haines.” Unfortunately, I was too quick on my spam filtering and deleted his comment before I noticed it among all the drug spam posts. After a period which was relatively blog-spam free, the spam posts have started to appear again. Perhaps this is driving the e-mail spammers to blog-spam!?


A Personal RubyConf 2008 Recap

Posted by Rick DeNatale Tue, 11 Nov 2008 01:11:00 GMT

RubyConf 2008 has come and gone. It was a great opportunity to meet Ruby friends and make new ones.

I think that my talk on Friday afternoon went well. It’s amazing how your perception of the conference changes
when you shift from fretting about your upcoming talk, to relief once it’s done. I don’t know how many times
I’ve given talks to similar audiences, but the butterflies never seem to stay away, and I think that it’s a good thing
since it keeps you on your toes. If you are going to be in western Michigan on the evening of November 25th, I’ll be reprising
this talk at XP West Michigan.

A Quick Sample of RubyConf 2008 Speakers

Greg Pollack has put up a preview of his upcoming “RubyConf Trailer”
RubyConf in 90 Seconds.
As he did earlier for this year’s RailsConf
Gregg did brief video interviews of as many conference speakers as he could. He’s planning to edit these together,
and provide them as kind of a video “Table of contents” to the full talk videos which will be appearing on
the Confreaks web-site. Coby Randquist of Confreaks told me that he expected
all the videos to be available by a week from today.

A Walk Down Memory Lane

Josh Susser, who is another Rubyist with a background in Smalltalk, tweeted
during my talk, that I was “taking a walk down memory lane.” In a way, RubyConf 2008 was very much a walk down memory
lane for me.
Not only did I reminisce in my talk, but I got to see some old familiar faces from the early days of OOPSLA in the 1980s and 1990s.
Allen Otis, who served as the technical half of the team from GemStone presenting MagLev was one. Another was Monty Williams, also
of GemStone. I had a very nice lunch with Monty and his wife on Saturday, along with another more guy who had recently joined GemStone
to work on MagLev, who we probably bored with old war stories.

Things I learned at RubyConf 2008

In no particular order:


  • Werewolf fever seems to have died off. As far as I could tell, no werewolf games materialized. The two main instigators weren’t there.
    Marcel Molina, apparently never was coming, and Chad Fowler, unfortunately, had to stay away due to the sudden death of his father-in-law.
    On the other hand, the musicians, some of them former werewolves, were there in force, leading to an enjoyable jam session.

  • Jim Weirich and I established that I’ve got a year or two on him, although my hair has retained a bit more of its color.

  • I also found that I wasn’t the oldest attendee, but I won’t reveal his or her identity.

  • “PragDave” Thomas gave a great talk, challenging the community to “fork Ruby”, that is to spawn some incubator branches of the language
    to experiment with new ideas without delaying or derailing the main Ruby language. If some of these forks produced value, they might
    have their ideas merged back. Some of his ideas for forks were Ruby-lite, which had lots of cruft which is not often used removed.
    Another was Otuby (for optionally typed Ruby), which was different from Charlie Nutter’s Duby

    I thought that the most interesting was probably Cluby, or Ruby with Closures. By making some lexical changes to the language, Dave
    suggested that Cluby could allow blocks to always be lambda literals, and to allow blocks to be used in many more places, such as
    for ANY argument to a method. This would allow control flow to be implemented by methods, for example an if method which took an
    argument to be tested, and one or two blocks, to be executed depending on the truthiness of the first argument, or a looping method which
    evaluated it’s second block argument as long at the first block argument evaluated to a truthy value.
    He also did away with grammar for both method definitions and class/instance variables. Methods would
    simply be blocks which would be called when the object received the corresponding method selector in a message.

    He acknowledged, that “Smalltalk had already done this.” Which is half-true. Smalltalk alows arbitrary block closures as arguments,
    but you need to look at a language like self for the unification of methods and attributes.

  • There are some talented musicians in the Ruby community. This wasn’t surprising since there seems to be a positive correlation
    between talent for programming and talent for music. Jim Weirich is an avid, and accomplished guitarist, and David Chelimsky and Diego Scataglini
    blew me away with a cool acoustic jazz guitar duet! I gotta give those guys, some RSpec!

  • Appropriately enough, since we were so close to Epcot, once again I learned that “it’s a small world after all.” My wife was along
    with me, although she didn’t hang out at the conference. On Saturday evening, Deborah and I tagged along with a group which included
    Matz and the members of his team who were there as well as a few of us gai-jin. Deborah is half-Japanese, an Air Force brat who spent
    a couple of tours of duty in Tokyo during her formative years. She sat next to Matz and they talked a lot in both Japanese and English.
    At one point Deborah was telling Matz about some of our Japanese IBM/ex-IBM friends. When she mentioned Kuse-san, who had visited with us
    several times when he was here on business, Matz said “I know Kuse-san!” In retrospect this isn’t surprising, since Kuse-san, now the
    director of IBM’s Tokyo Research Lab, has a background in object oriented languages.

And to put a cap on a week full of personal memories, Deb and I flew back home on Sunday for an evening from the 1960s with Ed Sullivan, old VW ads, and the “Beatles.”