Pages

Showing posts with label start. Show all posts
Showing posts with label start. Show all posts

Sunday, 7 October 2012

The debate over Functional Programming

Yesterday, I attended the "Centenary of Turing Talks" Talk[4] at Persistent/Pune. After introducing Robert Milner's work, the objective was to decide whether _every_ programmer should learn functional programming. The debate, as with all human debates, digressed quite a bit. However the question remained unanswered. I am just giving an ardent attempt to answer this.

Details of the event are available at the following link:
http://www.persistentsys.com/About/Turing100.aspx

Summarizing the discussion and the points that were raised:
  1. Functional programming is a better abstraction and helps in thinking more about what 'needs to be' or what will be 'what is' ('is-ness' as Prof.Modi mentioned.)
  2. The best place to start learning Functional Programming would be Erlang or Haskell'98 (as Dr.Anuradha mentioned.)
  3. Starting out with monads and trying to run away from 'typed' variants is not recommended for those who are first stepping out into functional programming. (Dr. Anuradha) - (I have done this mistake, so I know this is true.)
  4. You could opt to write 'C Programs' with functional abstractions and Object-Oriented concepts like polymorphism. You could even do this with Assembly language - but that would be too cumbersome if a functional programming language already exists. (Prof. Modi) 

Everyone on the panel or otherwise knew functional programming and also knew that it doesn't get used in production.
  1. The reason functional programming gets lesser attention is the lack of digital infrastructure to support it.
  2. The "Harvard Architecture" in the market essentially assumes sequential code execution, thanks to Alan Turing's early papers. Hence concurrency is also another blocker as the architecture hasn't been rewritten to help that happen - not entirely mathematically despite the fact we have parallel processing, multicore computing happening.
  3. People start learning an "Imperative" language like "C" or "Pascal" or "Fortran" to begin with. Hence they get fewer opportunities that coax them to try out or spend time on functional programming.
  4. The switch usually has to be made at the cost of non-office times for a professional programmer, which leaves a shorter percent of time allocated towards it which is another factor that discourages people.
  5. Most people without a strong theoretical background in computer-science find it difficult to understand Object-Oriented Programming ... making Functional Programming more fringe. 
  6. Deterministic problems are seldom solved (in general practice) with functional programming as Structured programs are easier to verify and prove to be theoretically correct.

Thanks to more discouraging infrastructure factors to the more recent ideas of Functional Programming, Object-Orientation fused with Functional Programming; the 1967 creation of K&R lives on even today in production.

Recommended Reading

For Programmers you can find companies like:
http://www.janestreet.com/
http://www.helpshift.com/
who have a motto to do all their work exclusively on functional programming.

Wednesday, 1 February 2012

Early Morning Photography

Punch Doggy

Here's an early morning photograph, with my favorite German Shepherd. I have done some post work without messing up with the lighting. Just click through for the high resolution version. This was done without a D-SLR. I like that fact a lot. We call him 'Punch' (after Punch and Jody), and yes there's Judy girl who is tougher to photograph, but will probably make it to my album soon enough.

Saturday, 29 January 2011

The Patriot's Paradox

I had to wait a while ( just 3000 seconds . I love waits (they're wondrous, sometimes they get me wild enough to leave immediately and save my day) before the Guest turned up. The welcome programme began with the right rhythm - welcoming, keynote, honouring (the Chief Guest.) The next item was "Chief Guest's Address," given the absence of a schedule, my narrative should do insofar. The event started just an hour late. Punctuality is to be suffered by the few who choose it.

The Chief Guest took to the lectern, and opened out what seemed to a long written speech. He is a Software Developer whose entire career has been between a Large Township supporting a Factory and Academic updates at a Regional Educational Institution. Until then, he had not spoken a word, and we looked at him with reverence.

The floodgates of callous, anachronic, disconnected sentences poured open the most obnoxious speech, I have ever heard of my Nation. "India is a nation that has always been and continues to be slaves. We have been and ever will be slaves to technology, except for the happenings of the past 3 decades where some hope has dawned." he began, shocking though as it was. This was the moment, the idiom "empty vessels make more noise," had waited for. He went on, "Alexander, the Great (Alexandros Megasthenos) defeated an Indian warlord Purushottam because they had superior technological advantage in cavalry. Purushottam (or Porus,) was defeated by the supreme army because he had slow moving elephants, while Alexander's cavalry were swift and made quick work of Porus' defeat." According to the Chief Guest, this was a great historical example of how Indian technology has never developed and bowed down to western greatness.

Insulting the people who lived in that time (c. 326 BC) and attributing a reason out of nowhere, while giving the keynote address of a Scientific Paper Presentation discourse. He seems to have forgotten that Elephant formations used cavalry for protection. Agile archers wearing no armour using the thick forest covers easily ambushed him. Given the genius of Alexander the Great, he defeated Porus with fair strategy. For a strange reason, he let him live, and also let Seleucus Nicator venture South Westward to establish the later Seleucid empire. Alexander's battle troops were too tired to be trained for better tactics to face interior India. The Kingdom of Porus is within the territory of present day Afghanistan. Accounts cite that Porus, grieved at the loss of his son, surrendered but refused to accept Alexander as his Emperor. Alexander's teacher Aristotle once quipped, "The east has a way of swallowing its enemies." The visit proved that to be true.

Did he know that the Greeks rode all the way down across Persia, with a cavalry, riding bareback on horses that did not have a saddle? Did he know that the Indian cavalry of Porus had saddles, and armory for the horse?

More words, now came, in torrents with confidence on a subject with minimalist knowledge.
"Babur invaded India somewhere in 500 AD, or something. He had superior artillery power which gave him full advantage and some other King in India, who had not invested time nor effort to build technology. That is why we (Indians) are slaves to technology."

This was Babur's special mention in historical annals. A force of 10,000 defeated Ibrahim Lodi's stronger force of 110,000 (arithmetically equivalent to 1 averaging 110 kills.) Ibrahim Lodi, despite strategic advantage lost. Wait, where and how did Lodi come from? At least at that time, Lodi wasn't considered a native Indian, but a descendant of recent migrants. The battle also took place in 1526 AD (a frequent one in 'are you smarter than a fifth grader?' [India]) We have forgotten that this is one migrant attempting to thwart another.

Emperor Ashok became King in 274 BC and held what is probably the largest Indian empire for another 8 centuries. Let's ignore him, his technology, the Arthashastra. Politics is misunderstood as history. It is also recorded that Ashok was one of the earliest monarchs to have passed an edict that outlawed slavery. Most battles are won or lost the moment planning is done, execution at every level has its surprises, but the political gameplay controls (almost) everything. India had advances in politics and diplomacy at that time.

He continues to drum on, while I reined in my eagerness to chip in. He then went on to say, "SAP started in 1973, with founders who had left IBM. They believed in a new model, but held their resolve for two decades, only to reap one of the largest market rates in 1993. We, Indians are not resilient, and therefore do not achieve."

SAP, as a company has a history, quite unlike the garage startups which originated from the Silicon Valley. Was SAP too slow to deploy? Did they find too early a solution? In today's market no one can be resilient? If they had started two decades later, we wouldn't be referring t them here.

Are Indians Resilient? Historically, we have always shown great resolve. All cultures who invaded us, we have assimilated. India: "Resistance is futile, you will be assimilated." The ancient lifestyle is recorded in many books including the Arthashastra for a period 300 BC. After 12th Century AD, we have several documented examples to refer to and show our resilience. Indian software developers tend to develop a culture of sticking to a mother ship, rather than hitch hiking the galaxy on space trawlers. Yet, we are not slow, we are big, huge, larger than imagination might yield.

He tried his hand at humour, but that comedy is subject for another post.

He continued, "We Indians are still having the slave mentality. All the global companies I had worked with used to state that we are a nation of snake charmers. We do not want to start our own companies or build our own Intellectual property [snip] Indian Infotech professionals create IP and sell it cheap to big clients who make millions, if not trillions of dollars We are not patenting or creating new ideas and intellectual property. We must start creating at least now and not continue to slave and make products for big companies elsewhere in the globe."

Interestingly, he seems to forget that IP is not only created and monetized in India, but is protected by networks of law firms for the geographic region. Vinod Dham or Sabeer Bhatia probably aren't counted as Indians. All the technocrats who originated from here, what happens to them. India now has a TIE chapter (pun intended), several meets where VCs and Investors meet Sponsors. Entrepeneurship, IP creation, Originality, it's all here. Brand "Bangalore" has been made. No longer is India a land of Snake Charmers.

Can inventing, creating be given enough focus in college curriculum or should curriculum be shortened to teach essentials, allowing inventions and creativity to follow through in extended apprenticeships? That is food for thought. If what we are creating is invisible to the eye and intangible, and yet, we continue reaping fruits of our labour, we are creating, competing and getting better. Who owns land or the intangible is always debatable under legal jurisdictions.

Note to self: Next time you go to a function, take the last seat. If you are disinterested, leave the hall pretending to take a photograph. Run for some sanity cover.

Wednesday, 15 April 2009

Startups, Open Source and Revenue - Myth vs Truth

Many believe that if you release your software product with the source open, any customer can procure it, better it and sell it thereby eliminating you in the market outright. This is one of the frequent arguments against opening source code and therefore to "Open Source" that many businesses quote.

I believe they will need to cite a case here. Buy Product Once, Get Source and Kill; sounds too easy to be true.

Actually I have source code of some game engines released by id software, and I know gaming companies who compete who have this, yet, I don't see anyone killing "id". I also have pieces of OpenSolaris and OpenStorage from SUN. IBM shouldn't have even made that $7b bid after expressing interest in OpenStorage among other areas from Sun.

I could even do this with "proprietary software" where source is offered whenever I pay (a much smaller sum than net worth of a company.) There are tons of companies who are willing to part with source for higher costs.

Sun wouldn't have "bought out" Virtual Box and MySQL if they could just use the source instead. Buying Out is one of the available "exit strategies" for a cash-strapped startup.

Clearly someone has to prove that Redhat's profits have dropped because Canonical and almost everyone else who has taken on pieces of code has cut into a static pie of consumer market. The truth is software markets are closely linked to a lot of other markets including service markets. These markets grow or shrink dynamically. The whole pie however depends on user base which has been constantly expanding.

For OpenOffice, I think resurrection of Lotus with the OpenOffice source is proof enough that an entirely different company used this. Transgaming's Wine is open-source except for a portion of the DirectX (not all of it) libraries. You could potentially run your own company and beat them, or a "Giant" can have them without buying source. Transgaming emulates Windows libraries on Unixes (starting with Linux and now on Mac OS X.) Does an Apple certified vendor or Apple actually sell proprietary Microsoft Windows Games support? (Not to my knowledge.)

Revenues: Eric Raymond probably has a few tips. Product Engineering outfits do widget frosting, the model that's simple to understand. Some "violate" Open Source citing that they cannot make profits; on similar arguments raised here. Savings as revenue is an oft cited case. Today it is far more relevant. If your cost to create something is potentially reduced you can reduce the price a customer has to pay while you still make a profit.

My former employer did buy software for incorporating into products. My former employer is a profitable product company. However, because we could not modify one small piece of the bought-in black box (with no possibilities to acquire source at any cost) we just had a 25% increase in development life-cycle. That was "Loss." We decided never again to consume anything from "closed source" companies as it potentially created black boxes of uncertainty within our own products.

Open Source is not Free(dom) Software always nor is it Free (Beer.)

Source code (which is open,) is a more primitive formal expression of the binary format of the product which is re-usable and easier to modify than the binary format of the product.

The binary format (executable files) of many products can also be reverse engineered. (Remember Borland!? They did not advocate Open Source but where caught up with Sidekick.) This is also easy for a heavy-weight as opposed to a smaller group.

Myth: "Open Source makes a startup vulnerable to acquisition."
Truth: "Low on Cash makes anything vulnerable to acquisition."

Myth: "Open Source companies suffer a handicap while trying to make revenue."
Truth: "Companies unprepared to serve their customers suffer a handicap while trying to make revenue."

Time, the press stopped incorrect interpretation of Open Source as non Revenue Generating.

Watch this video (at youtube) for Guy Kawasaki's take on "Revenue from Open Source" and "Open Source enabling Startups."

Tuesday, 27 November 2007

A Personal Blog at Last!

After quite a bit of thinking, I thought it would be nice to jot down everyday thoughts that crept in my mind. I already have another blog that I haven't been updating in a while. This would have lighter writing and be more a personal window.