« July 2006 | Main | September 2006 »

August 2006

August 31, 2006

Did you know that Clayton Christensen is 6'8"?

I didn’t, and that was probably the least interesting bit of information in this podcast by IT Conversations that was recorded at the 2004 Open Source Business Conference.

I’ve listened to it at twice already, and I’m absolutely stunned by the amount of insights into our industry and business in general that I was able to get (or am still trying to get since I’m listening to it over and over now). The key insight for me is the fact that disruption is not a property of technology, but instead is something that happens to the business model of the company who is threatened by an emerging growth business. This was something that Andy Grove contributed to Professor Christensen’s theory about what causes well-run, highly-profitable businesses to suddenly go out of business (witness the extinction of the entire minicomputer industry).

I can’t recommend this podcast enough. Not only will you gain some invaluable insights, you’ll also find that he’s incredibly funny with a great sense of comedic timing. The bit about what disruption against Intel’s core business and what Andy Grove should do next in his career was priceless. What are you waiting for? Download it now.

How a Harvard Ph.D. got Phished

From Josh Jones over at the Dreamhost (they host this blog), a great story of the anatomy of a phishing attack against his wife, the Harvard Ph.D. What’s even funnier about the story is how he’s seeking revenge against the phisher by spamming him :)

August 30, 2006

New RubyCLR Reflection Engine Does Something Useful! News at 11.

You know what? Generics are complicated. Like, really complicated. Like mind-bendingly insanely complicated. Either that or I’m just not all that bright.

It took me a really long time to build enough intelligence into the new low-level reflection library in RubyCLR to handle generics reasonably. I think I’ve rewritten that code 5 times in the past week and a half. Each time I thought I ‘got it’, I’d hit another corner case that would invalidate some fundamental assumption which forced yet another rewrite. Now it’s not a lot of code – maybe 300-400 lines or so all told but it’s really tricky to get right.

Why did I have to rewrite it? In existing builds of RubyCLR in the wild, it’ll handle a core case like:

list = List.of(System::String)

This is probably, what, the 80-90% case of what folks use generics for? So in that sense, people can actually get work done using that implementation. However, to get it to handle all the other cases that you might run into in the wild requires much more work. Also, the existing implementation is rather inefficient in both time and space. There were a lot of hacks I put in there to get things to work, but have to be removed to simplify the codebase and to improve overall performance.

Let’s consider slightly more complex cases:

class G1 { class N1 { } class G2 { class N2 { } } }

To get a reference to class N1, you’ll need to do this:

klass = G1.of(System::String)::N1

In C#, you’d do this:

Type klass = typeof(G1<String>.N1);

This case wasn’t all that hard to get right, but it requires that you understand just how this type comes into existence. It makes a lot more sense if we look at it this way:


Type n1 = Type.GetType("G1`1+N1");
Type n2 = n1.MakeGenericType(new Type[] { typeof(String) });
Type n3 = typeof(G1<String>.N1);
Assert.AreEqual(n3, n2);
Assert.IsTrue(n3.IsGenericType);

Type n1 is the generic type definition. You can’t create instances of these things in the wild, you first have to create a closed generic type which is what n2 is.

Now I really wish that I knew this when I first started writing this code, but I’m a user of generics-turned into a language implementor. This kind of stuff isn’t obvious at all since the C# compiler does so much for you. And who really programs this way??? But I digress.

Also, notice that type N1, which is a nested type of a generic type is considered itself to be a generic type.

Now consider the even more complex case of N2:


Type n1 = Type.GetType("G1`1+G2`1+N2");
Type n2 = n1.MakeGenericType(new Type[] { typeof(String), typeof(Int32) });
Type n3 = typeof(G1<String>.G2<Int32>.N2);
Assert.AreEqual(n3, n2);

It’s not all that hard to understand once you saw the first case. So to get a reference to N2 in Ruby, this is what you need to write:


klass = G1.of(System::String)::G2.of(System::Int32)::N2

This is a pretty natural syntax for this, right? The end result is pretty, but it took a lot of blood sweat and tears to get here. This was easily the hardest problem to solve in RubyCLR to date.

This stuff will eventually get checked in, but most of RubyCLR is broken right now on my build (although it resolves types just great!). I’ll check in once I get method invocation working using the new reflection library.

August 29, 2006

Why Scott Hanselman Rocks

Scott Hanselman never ceases to amaze me with how much he gives back into the developer community. Among his many interests is dynamic languages, and Scott has been tirelessly acting as a cheerleader for Ruby on his weekly podcast, Hanselminutes, as well as in many posts on his blog. Here are a few of the ones that I really like:

Scott also did a really nice podcast on dynamic languages in his Dynamic vs. Compiled Languages podcast. The only thing I’d take issue with is the title – it really should be Dynamic vs. Static languages, since dynamic languages can certainly be compiled. Carl Franklin does a great job in that podcast of playing the other side, and forcing Scott to articulate his points. I can see their conversation played over and over again in offices everywhere as we hit the tipping point for dynamic languages.

August 28, 2006

Programming languages are fashion statements

Dictates of Fashion

Ruby, Python, Perl, Tcl, JavaScript, Lisp, Smalltalk, PowerShell … which one do you pick? Jim Hugunin likes to describe why a programmer prefers one language over another one as a genetic trait – some are predisposed to liking Python syntax, and others aren’t.

One of the most interesting technologies to come out of Microsoft recently is PowerShell. The disruptive idea behind PowerShell is that cmdlets pipe objects around instead of text. Most of the PowerShell plumbing comes in the form of a set of static classes that ship in System.Management.Automation.dll, and they’re tied together with the PowerShell scripting language.

I’m pretty sure that I’m missing the gene that would make me like the PowerShell scripting language. It feels just too … foreign to me. This isn’t to take anything away from PowerShell itself – it’s fabulous. It’s just that I want to use Ruby (and Jim wants to use Python). One of the coolest demos at Lang .Net was Jim running PowerShell commands from an IronPython console. Here’s some PowerShell code expressed as a Python list comprehension:


[p.name for p in shell.get_process() if p.name.startswith("a")]

Here’s an example that shows piping cmdlets together using Python’s dot operator:


shell.get_service(name="a*").sort("status").convertto_html().out_file("t.html")

I could imagine the piping example expressed through Ruby as:


get_service(name="a*") | sort("status") | convertto_html() | out_file("t.html")

You can overload the | operator in both Ruby and Python, but Jim prefers to use the dot operator since it feels more natural to him.

A fashion-proof shell – let developers use the language of their choice. Kind of sounds like the CLR, right?

August 27, 2006

funtwo unmasked

This is one of my favorite videos from YouTube.

Today, Virginia Heffernan of the New York Times unmasked who funtwo is his name is Jeong-Hyun Lim.

Although I funtwo was the original, I think that Symheris does it better.

The last thing missing from my Mac experience

I can now print! While I don’t print very often anymore, it’s still very useful for reading longer essays. I finally got around to setting up Unix print sharing services on my domain controller, thanks to this really detailed set of instructions.

August 26, 2006

What a great way to spend a day

It was a fun time at BarCampEarthToronto. I had grand ambitions to be the conference photographer, but I got side-tracked by a lot of very interesting conversations. So I only shot 9 frames- the best of the lot is this photo of Sacha Chua who led a session on Networking for Introverts.

Sacha Chua

The rest of the photos from the conference are up on flickr

I did a session on evangelizing dynamic languages, where I presented a version of my VS Live keynote talk. I think I achieved my original goal of converting at least one person to dynamic languages. I also had the privilege of having Adam Growe, a real presenter observe my talk in the audience and I’m looking forward to getting his critical feedback on how I executed my presentation.

Most of the time I was an attendee in the “hallway track” where I hung out in the common area between the different conference rooms and chatted with whoever was there. For those who haven’t attended one of these, I would describe the BarCamp experience as a way to hang out with a bunch of different folks from different walks of life. Yes, we have a common binding interest in technology, but many of the people there were doing very different things. Some folks were running startup companies, other folks were thinking about doing a startup, some ran consulting shops, some were developers, others were students.

At the very end of the evening I wound up hanging out with Ryan McKegney of RedFlagDeals (where their motto is ‘Going broke saving money!’) and Seneca Cunningham over at the Linux Cafe where Seneca is a part time sysadmin for their network of computers. There, I saw the January, 1986 issue of Compute! magazine

I had a fun time taking a trip down memory lane. It’s hard to believe that issue is over 20 years old now …

August 24, 2006

Why did I wait so long?

If you have a family, you absolutely must get a telephoto zoom lens. This is what I have:

It’s a Nikon 80-200 f/2.8 lens. It’s pro glass, it’s heavy, but man does it take sharp photos:

Most of the other images that I took on my recent trip were shot using that lens as well. It also works great for candid portrait shots:

The only drawback of this lens is its size. It’s not a lot of fun to lug around. The D200 18-200 f/3.5-f/5.6 kit lens is apparently nearly as sharp:

It has image stabilization and is less than half the weight of mine. But I’m very happy with this lens for the time being, so I doubt I’ll switch.

Is Amazon EC2 + S3 a disruptive technology?

I vividly remember talking to Werner Vogels a year and a half ago when we went out for lunch when I was in Seattle for a visit. Werner’s job was to go to Amazon to enable global-scale computing. Sure, they were already doing global-scale computing for their e-commerce properties and partners but I had no idea that what he really wanted to do was enable global-scale computing for everybody!

Today, Amazon announced their Elastic Compute Cluster:

Just as Amazon Simple Storage Service (Amazon S3) enables storage in the cloud, Amazon EC2 enables “compute” in the cloud. Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment. Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change. Amazon EC2 changes the economics of computing by allowing you to pay only for capacity that you actually use.

Capacity planning and operations management are things that are often ignored at startup companies. When all of a sudden traffic spikes and you’re unable to scale until the new servers arrive next week you’re screwed. But the ability to add additional capacity in minutes is an enormous leveling force. Also, the ability to scale up and down is just as important. You can greatly reduce your operational costs by not paying for the compute power until you need it.

Makes me want to do a startup company now :)

Update: It looks like someone has already setup a public app. You can look at this really simple Rails application running live on EC2. Really, really cool.

Update2: Jon Udell has now made a screencast showing a Python application running identically on both a local machine and a machine in EC2.

Photos

  • www.flickr.com
    This is a Flickr badge showing public photos from John Lam. Make your own badge here.

Recent Comments

Recent Posts

May 2008

Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Blog powered by TypePad