Monday, August 01, 2005

I just finished reading Erik Meijer and Peter Drayton’s work-in-progress paper on programming languages and type systems. The paper as correctly noted in the beginning is written-to-provoke and I think this line of work is required today when technologies like .Net and the JVM have opened up possibilities of experimenting with languages and language systems and potentially reduced barriers for acceptance of new languages. The value proposition the expressiveness of a new language provides can be more readily accepted today in frameworks like .Net where a programmers existing knowledge/use of an API and an existing code base will not be lost by switching over to the new language.

 

The paper touches a large variety of topics and is more in brain dump of thoughts around the general area of type systems in dynamic and static languages. They also have some very interesting pointers and references.

 

The papers discusses type inference, programming by contract as opposed to having the type system as the only means of contract, subtyping and potentially expressing subtyping as programming by contract, type-directed lifting in Cw and how that can be used as opposed to non-intuitive reflective code.

 

The paper talks mentions the SqlDataReader – even if you don’t grok anything else in the paper, try and understand this part and try and see the need to a better programming language model – especially if you have ever worked on the data tier or business logic tier of an n-tier data centric application.

 

The paper also mentions lazy evaluation and about potentially deprecating the need for using eval if you have a better system in place for most of the common uses of eval.

 

On the whole it’s a paper that worth your time if you have started thinking about why when using C++ its so damn hard to get anything right, why C# cant be a little more flexible when handling collections, XML like or SQL like data and why languages like your pet python or ruby don’t make the mainstream.

 

http://pico.vub.ac.be/~wdmeuter/RDL04/papers/Meijer.pdf

Monday, August 01, 2005 2:30:34 PM (Eastern Standard Time, UTC-05:00)  #    Comments [3]  | 

I had been to my native place at Pala and Karimanoor this weekend. It was a nice drive along hilly country with lots of heavy downpour to give us company. The country side in Kerala is beautiful. It is probably one of the most abundant states in India with respect to flora and fauna.

 

Here is the gallery:

Gallery\Kerala1

 

 

I am beginning to get an edgy feel about this whole photo gallery business. It doesn’t scale too well, wrt managing lots of galleries over time and I am not classifying the pictures well enough. Hmm…
Monday, August 01, 2005 11:15:19 AM (Eastern Standard Time, UTC-05:00)  #    Comments [7]  | 
 Tuesday, July 26, 2005

Tried my hand at creating some sort of a photo gallery today. I updated the old image resizing progie so that it can draw borders and respect proportion when resizing images. I also wrote a ruby script that can generate an html gallery when it is pointed at a folder that has images and a description text file.

 

Download the updated image-resizing program, source code and ruby script here. The binary is .Net 2.0 Beta2. This is the previous blog entry about the image-resizing program.

 

That said here are two galleries I have uploaded:

Marine Drive, Cochin

Golconda Fort, Hyderabad

 

It’s fun to be blogging again and its fun to have access to your machine and the web at night. I also realize that if I keep at this I am going to run out of space with my ISP and others at TMS aren’t going to be happy. I will need to solve the web space problem…
Tuesday, July 26, 2005 2:00:16 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]  | 
 Monday, July 25, 2005

Now that I am at home I needed to start cataloging my data and getting things in order before I move on. I spent some time yesterday writing a small app to help catalog my CDs. I had a look around but most CD cataloging apps I could find were paid apps.

 

cdScan.jpg

 

CdScan scans the CDs and lets you do a simple substring search (a little like the old Winamp J option) and also gives you an explorer kind of view of your CDs.

 

Its got a nifty little auto-scan option where you can simply set it to autoscan and keep changing CDs in your drive.

 

There are a whole host of features I can think of adding, but you might want to grab hold of it and use it to catalog your Cds and maybe add a feature or two (since I am giving away source code).

 

Download Binary: cdscan_binary.zip (250.75 KB)

Download Source Code: cdscan_source.zip (268.43 KB)

This is written using .Net 2.0 Beta 2, so you need at least the Beta2 runtime to get the binary to work.

 

Here are a lot of things I can think of adding, maybe you can add them for me –

-          wildcard and regex based searching

-          a more flexible explorer view

-          save more data for an item (EXIF data, Thumbnails, Text index)

-          more intuitive UI, with some helpful text messages…

Monday, July 25, 2005 8:45:48 AM (Eastern Standard Time, UTC-05:00)  #    Comments [5]  | 
 Sunday, July 24, 2005

As of 20 July 2004, I no longer work for Microsoft.

 

You are not going to be seeing any leaving Microsoft letters of the sort you may have seen from some ex-microsofties. I am going back to college. Over the years, I figured I don’t understand computer science very well. I figured I lack some fundamental things in my understanding of the way this science works. I love computer science and the only way I am going to be able to good enough to quit the field and probably go sell airplane rides for a living, is if I understand it better. So I am going to college.

 

I am joining Indiana University this fall for my Masters in Computer Science. I am navigating primarily by instinct right now, so I don’t have clear answers to ‘What next Rosh?’

 

I left Microsoft with very good opinions about the company. Easily the best company I worked for – for the quality of the work they do, for the quality of the people, for the culture and the spirit. I wish it was a much braver company with respect to taking risks, and boldly chasing after the next step in the everyday computing. I wish it leveraged its people better, I wish it was more about blood and genius and less about schedules and numbers. But it is easily better than most places that I have had the opportunity of knowing.

 

I am going to be thinking about a different class of problems for the next few years - problems about nature of computation, logic and mathematics.

 

The weekend I left Hyderabad I got to visit Golconda once more –

 golconda1.jpg

Golconda Fort, Hyderabad

 

I am now back at home, in beautiful Cochin –

 

Cruise boats at Marine drive, Cochin

Sunday, July 24, 2005 11:50:11 AM (Eastern Standard Time, UTC-05:00)  #    Comments [6]  | 
 Wednesday, July 13, 2005

After several months, and several ISPs, TMS is back up and stable. Which means that our blogs are live again.
Thanks Pandu

:)

Wednesday, July 13, 2005 1:03:15 AM (Eastern Standard Time, UTC-05:00)  #    Comments [9]  | 
 Friday, May 27, 2005

sky5.jpg

"I am not sure I want to be perfect and finished. Talk about boredom..."
"Look at the sky," Don said.
"Well, it is always a perfect sky, Don."
"Are you telling me that even though it's changing every second, the sky is always a perfect sky?"

sky1.jpg

sky3.jpg

sky4.jpg

Friday, May 27, 2005 12:28:11 AM (Eastern Standard Time, UTC-05:00)  #    Comments [5]  | 
 Saturday, May 07, 2005

For a long time I have been using this little program misnamed netshortcut. It’s a little command line that pops when you press a key-combination; commands that it supports are configured into a rules file using a rudimentary declarative language that evolved ‘as-appropriate’. Read more about it here

http://www.thinkingms.com/pensieve/homepage/work/netshortcut/netshortcut.htm

 

While I had been using NS for a while, there was this growing frustration that it could be made to do more things – if it had a better designed language underlying it. This frustration continued for a long time, until sometime early last year I got to working it out. I had lots of help from Sid, against whom I would bounce the creations of my genius.

 

Today the notebook in which we had worked out our plans resurfaced after a year. I didn’t want to loose this stuff again, though it was going to be an embarrassment for the future – and hence this blog entry.

 

I remember Sid saying that is some south american there are a sort of monkeys that have really long tails that hang down branches when they sit. And I say “so?”. And he says ‘So maybe you can use that idea in your language’. I ponder that for a while and then figure that I won’t be so useful. I hindsight, maybe Sid was right after all…

 

So here is the language, in wonderfully non formal description -

 

<pattern> {

      do ( <args> ) { <code> }

      is { <value> }

 

      comment <string>

 

      def <ident> {

            render <password | list | text>

            include <filename>

            alias <pattern> <name>

            code { <code> }

            <one or more pattern blocks>

           

}

}

 

That’s it. All programs have to begin in some scope, so this language’s global scope is same as the scope that corresponding to the inside of an def <ident> { <this is the global scope> }.

 

Remember that this language is fundamentally declarative is used primarily as metdata for a command line. The standing idea was the code blocks inside do() {} and is {} would be handled by a regular programming language that allowed interpreter hosting – the idea was to go with ruby then.

 

There is also the notion that braces can be eliminated except for do and is blocks. If a var does not have a do or is block is its value is simple returned back up the tree.

 

Here is a definition for supporting invoking the browser to do a google search. The user at the NS command line would type something like this –

gg <what to search for>

 

Imagine we have a file called library.rb that has

def browser(url)

      # invoke browser with specified url

end

def urlEncode(value)

      #return a urlEncoded version of value

end

 

This will be the NS rules file –

 

include “library.rb”

 

gg {

       do (arg ) { browser(“www.google.com?q=#{arg}”) }

       comment “Search Google”

       def arg {

              * {

                     is { urlEncode(value) }

              }

}

}

 

Note that ‘value’ that is passed to the urlEncode() is a special variable that holds the value of the current match (* matches to anything).

 

Now this does look a little clunky (and yes unintuitive) but with the defaults and with some braces reduction it would look like this –

 

include “library.rb”

 

gg do(arg){ browser(“www.google.com?q=#{urlEncode(arg)}”) } comment “Search Google”

 

Neat?

 

The language actually allows for a LOT of flexibility for controlling what gets executed for what the user types, what comments are displayed, how the UI gets rendered etc. I cant really describel all of that here, but this is the essence -

-          The lowest do() {} block that is satisfied is executed wrt a command.

-          The is{} block at any level computes a value that may serve as a argument value to a do block higher up the tree.

-          The code {} blocks are executed in pre-order (when going down the tree)

-          The do(){} and is{} blocks are executed in post-order after the command is completed.

-          Any {} other than for do, is and code can be skipped. Doing so reduces the rest of the line to the scope of the starting instruction’s block.

 

The new NS is also to support a notion of setting scope. You use

@ <rest of command here>

to set scope. For example, if you are going to be doing a lot of google searches, you do a

@ gg

And from that point on whatever you type at the command line will the value of the arg parameter of the do(){} of the gg pattern.

 

I have not really go down to implementing this yet.

Someday…

Saturday, May 07, 2005 12:32:28 PM (Eastern Standard Time, UTC-05:00)  #    Comments [9]  |