Archive for April, 2006

Exploring SICP

Sunday, April 30th, 2006

This book totally rocks. And it kinda makes me depressed. Some exercises are really tough, and it’s putting me through all kinds of grief. But heck, I’m getting a kick out of learning this stuff. Kinda like going back to college and getting all the stuff right. But you need to have a lot of patience. You need to unlearn some concepts. Anyways, to console myself, I have done one of the easier exercises (1.8). Here’s how you calculate a cube root (apologies to non-geeks – the posts in the coming days/weeks would be full of this):

(define (cuberoot-iter guess x)
  (if (good-enough? guess x)
      guess
      (cuberoot-iter (improve guess x)
             x)))

(define (improve guess x)
  (/ (+ (/ x (square guess)) (* 2 guess)) 3))

(define (good-enough? guess x)
  (< (abs (- (cubed guess) x)) 0.001))

(define (cubed x)
  (* x (* x x)))

(define (cuberoot x)
  (cuberoot-iter 1.0 x))

Evals to (using mit-scheme):

(cuberoot 27)
;Value: 3.0000005410641766

The birth of a language geek

Sunday, April 30th, 2006

I think it had to happen, sooner or later. It’s just that I was not counting on it. Lately, after learning Ruby, I began to take a shine to other languages out there that I might be missing. I started reading up on Io, Lua and Haskell. Finally, I thought I should learn Lisp.

Why? I don’t know. I just wanted to learn it. I was looking for choices, and Rajesh who is doing this stuff for a while, pointed me to Practical Common Lisp. It looked like a good book, with a Jolt award to boot. But I was worried that I didn’t have exercises, so that I can see if I’m getting ahead. Finally, I settled on SICP . It’s one of those seminal books in computer science, which every engineer learns. Or is supposed to. It uses Scheme, a dialect of Lisp, to teach fundamental CS concepts. I thought I should give it a shot. So here I am, working through SICP. The exercises are really fun, some of them will make you really think. My first serious scheme code:

(define (goobledy a b c)
  (if (> a b)
      (if (< b c) (sum-of-squares a c) (sum-of-squares a b))
      (if (< c b) (sum-of-squares a b) (sum-of-squares b c))))

What does it do? It just takes three numbers, prints out the sum of squares of the highest two. This solution doesn’t look all that DRY to me. I have to give it one more shot.

Would you work on the Death Star?

Saturday, April 15th, 2006

Well, if you guys are rails fans, you must’ve already read this. At first, I thought I understood it, guessing DHH is comparing WS- frameworks as something that never gets completed, and as unweildy as building a Death Star. Not so. The explanation, is the title, and if that doesn’t make any sense, you should read this story.

Yes. If you don’t adapt to new things and you get steamrolled in the process, it’s nobody’s fault. You knew the risks. Just because the going is good, doesn’t mean that all’s well. Infact, if you ask me, you should be the most careful when the going is good. As they say, it sure is a long way down…

Chennai BarCamp: What an experience!

Wednesday, April 12th, 2006

Whoever thought Chennai would host such fantastic meetups. Chennai BarCamp which took place on 8th and 9th of April, was a boatload of fun and information. The meet started off informally, as is the custom with BarCamps, and the schedule was completely rejigged to adjust speakers present and not present.

What followed was some times impromptu and well-prepared talks by entreprenuers and geeks on their pet projects, new ventures, and of course, lots of networking. Kiruba started off the event with a bang, it pretty much kept the pace for the two days.

Got to hear nice talks on Web 2.0 by Narain, SEO talk by Ganesh, Project InfraNet by Vijay Anand (this was seriously impressive – in scope and potential of change) and lots lots more. The surprise talk was Atul’s talk on mobile computing. He did a very good justification of how the future of computing is moving towards mobile.

Maybe the best part was, I got some really good response for my Ruby on Rails talk. Looking at the small amount of audience (most of them left to listen to talks like VC funding and other stuff) I doubted there would be much response. Well, it was a complete surprise that I got some good reviews.

Perhaps more important, I secured a good meeting place for Chennai.rb. Mr. Udayan Banerjee of NIIT has graciously offered us their conference room for our monthly meets. Simply awesome.

I hope such events happen more and more, and will continue to rock Chennai. Three cheers for Chennai BarCamp!