Ads




Profiles

Blogroll



  • Ashish's Niti - Old Blog

Your email address:


Powered by FeedBlitz

Web/Tech

March 10, 2007

Learning Haskell

I stumbled onto Haskell around 2 months back while searching for resources on spreadsheet programming.

I wanted to do Buy vs Rent calculations before deciding to buy a house. Microsoft Excel is pretty good. However, after a while it simply did not scale up. You cannot define your own functions and there are no local variables available. It has been my experience that learning in the context of real problem is much faster and easier. This time, it launched my exploration of functional programming. Enter Haskell.

Haskell is a pure functional programming language. Transition from imperative programming to functional programming (and too a pure one) was very difficult. But slowly, I got the hang of it. I re-did Buy vs Rent calculations in Haskell (it's not complete yet).

To explore Haskell further, I decided to implement a small subset of GNU Make features in Haskell. Within a few days (1 day of "thinking" and reading, followed by a day of coding), I was able to get a working system (see make.hs). To use it, simply call 'make' function, passing it a list of rules and a target:

make [(makeCCRule "test")] "test.o"

Simple, C compilation and linking rules are included. But you can define your own rules (a tuple of dependencies, target and list of commands to run when the target is out of date with its dependencies). Haskell allows you to focus on your application logic without causing undue distractions of memory management, maintaining state or even declaring types (it provides type inferencing). It is amazing how much you can do in less than 90 lines of Haskell code (including comments and empty lines). 

I haven't tested it thoroughly and there is no error handling. The system is easy to extend with your own "definition" of what it means to have a target out of date with its dependencies. With a little bit of refactoring it won't be that hard to support pattern like rules (.c to .o, etc.). Please send me feedback on how to improve this (I would love more modularity using type classes, for example).

February 21, 2007

Virtual Gold Rush

 Via the Division of Labour, This BussinessWeek article, Innovation in the Age of Mass Collaboration, describes how a conservative mining company discovered gold by opening up its proprietary database on the Internet and offering a prize:

The contestants identified 110 targets on the Red Lake property, more than 80% of which yielded substantial quantities of gold. In fact, since the challenge was initiated, an astounding 8 million ounces of gold have been found—worth well over $3 billion. Not a bad return on a half million dollar investment.

January 16, 2007

A Good Advise on Software Schedules

This is a bit old post but nevertheless a very useful one. Joel Spolsky recommends using Microsoft Excel instead of Microsoft Project for software schedules. Among the recommendations are:

  1. Use Microsoft Excel
  2. Keep it Simple
  3. Estimates should be left to programmers
  4. Estimates should be fine-grained
  5. Debugging and Integration time for each tasks/feature should be added

January 06, 2007

Cisco Ups the Stakes in the Outsourcing Game

SAN JOSE, Calif. // Wim Elfrink's climb up the corporate ladder has taken him from Holland to France, Italy, Switzerland and the United States.
But his latest promotion will take the Dutch polyglot far from his Western comfort zone. As the chief globalization officer at Cisco Systems Inc., Elfrink is taking his wife, two daughters and the family dog from suburban Silicon Valley to Bangalore, India.

...

The 50,000-person company wants 20 percent of senior managers working at the proposed Globalization Center in Bangalore by 2010. The executives will be a mixture of rising stars from San Jose and Bangalore and talent plucked from acquisitions and competitors worldwide.

International business experts say Cisco's executive migration is a shrewd move that should give high-ranking employees critical insight into one of the world's fastest growing economies.

Source: Cisco Shifts Executives to India - baltimoresun.com

Subscribe




  • Subscribe to my RSS feed

  • Enter your Email


    Preview |

Tip Jar



  • Amazon Honor System Click Here to Pay Learn More

Ashish's shared items in Google Reader

Search


  • Google

  • Search Now:
    Amazon Logo

BookShelf - Recently Read

Recent Posts

Recent Comments

September 2007

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            
Powered by TypePad