Showing newest posts with label F#. Show older posts
Showing newest posts with label F#. Show older posts

Saturday, February 9, 2008

Your next Language++

Was in a discussion with a couple of technology consultants for the implementation of an upcoming software product, the discussion soon turned into a heated debate over the technology stack to be implemented, the debate soon moved over to choosing a language for implementation (technology consultants can get awfully spirited in these discussions :) ). No prize for guessing - the debate was between choosing .NET+C# vs. Ruby on Rails. I admit I appreciate the Rails framework and often wish we had similar capabilities in C#/VB.NET. Ruby and other dynamic languages like Python can be used to build applications that are incredibly dynamic in terms of runtime polymorphism however it comes at a price – performance.

The real question is if you are already proficient in a software language be it Java/C#/VB.NET etc (and hopefully not extremely religious about it) what would be the other language you need to pick up? Ruby seems to be on every ones radar. Is it the obvious choice for your next language?

Lets take a step back and look at languages in general. Languages can be split into 3 broad categories
- Object Oriented Languages
- Functional Programming Languages
- Procedural Languages

The vast majority of all the software built today are developed using general purpose object oriented languages like Java and C#. Ruby is still a general purpose object oriented language with dynamic/runtime capabilities. Several of these capabilities are now being introduced in the C# language (will reserve that for another post). So that’s the story on the object oriented language side. Nothing significant seems to be happening on the procedural language. But there is some excitement brewing up in the functional programming world.
Why consider a functional programming language? Interestingly some of the new features bleeding into the C# languages such as LINQ, type inferencing (ie using var in C#) etc is heavily influenced by functional programming. OO languages basically focus on state and behavior where as FP minimize or avoids (particularly in case of purely FP languages) state and mutability of data - due to the way FP handle mutability of data via functional operations it FP suitable to execute tasks in parallel thus providing a highly scalable solution to problems that are iterative in nature, Functional programming languages are especially suited for multi-core systems . Companies such as Google have I implemented their search infrastructure on top of FP. A full description of FP is beyond the scope of this blog entry however FPs has its place and in some scenarios may be optimal for use. The question now is which FP language to learn? Microsoft has been working on F# which is a FP language and is also a multi-paradigm language – ie it has implemented several features that are common to both functional languages (largely influenced by ML and OCaml languages) as well as object oriented languages (LISP for instance is also multi paradigm in nature). F# is a good choice since it implemented on the .NET framework. I.e. we can build components that are easily modeled using functional programming style in F# and import those components in C# and vice versa. F#s integration into VS.NET 2005 is a strong indication of Microsofts commitment to the language (unfortunately the addin for VS2008 is still not available).In the future we should can see wide spread adoption of Microsofts TPL and FPX frameworks along with F# libraries.

Will FP finally move from academic circles to commerical application? And how will F# fare ?Only time will tell. Meanwhile I put my bet on F#.

What do you think? What will be your next Language++?