Wednesday, May 26, 2010

Becoming popular

There is an excellent article titled How to design a popular programming language. The whole formula is very simple:
1. Find a new platform that will be a huge success in a few years.
2. Make your language the default way to program on that platform.
3. Wait.

I can't agree more with the author, excluding language enthusiasts and religious zealots, programming languages are mere tools that enable the programmers to write software that (usually) solves some problem . So nobody gives a damn does a language has tail recursion, multiple inheritance or monads. I mean those who know about such things would whine for some time, sometimes even for a long time, but you could safely ignore them as in the end the problem will be solved with either simple workaround or using a different approach, this is guaranteed if the language is Turing complete.

However the author is quoting two languages as exceptions (Java and Python) to this rule. But these two languages only make his definition of a platform oversimplified. To counter with an oversimplification of my own the platform can be seen as nothing more then a market. From this point of view both exceptions aren't exceptions at all, rather a fine examples of riding a platform. Java's platform is writing cross platform enterprise applications, the whole promise of "Write once, run, anywhere" enabled the programmers to rely on JVM being able to run their code across plethora of operating systems. On the other hand if your market is productive language fallowing There's Only One Way To Do It and batteries included philosophies there is no other choice but Python. To conclude anything could be defined as a platform, but most platform aren't economically viable.

If you understood the value of platform then what choice is left for the unpopular languages. Alessio Stala half jokingly suggested that: all that great but unpopular language has to do to in order to gain popularity is to deeply integrate with a popular platform and make it easy and convenient to use pre-existing libraries written in other languages for that platform.

My humble opinion is that this wont work for two reasons:

First reason is that if the platform is already popular that means that there is at least one standard language for programming in that platform and its impossible to dislodge it, unless it shoot itself in the head and alienates its users. So the only way for the language to become THE language for that platform is to become one before the platform becomes popular.

But why couldn't the new, shiny, perfectly designed language dislodge the old, rusty, haphazardly bundled language? The newcomer will better at everything. Better libraries, better tools, better books, better ...

This concept is best described by the book Crossing the chasm (*). The short story is that life cycle of adopting a new technology starts with early adapters fallowed by a huge ditch called chasm which you need to cross in order to reach the pragmatists which we usually call mainstream. The early adapters are easy to get, you just need to have something interesting, those are the people that want to tinker. The pragmatists are the tough ones. They are hard to get but very loyal once won. They want proven technologies, vendors with credentials and most of all standards. They want to buy from the market leader and you ain't one. Pragmatists control most of the money and are the ones that are fallowed by Conservatives. Try to make problems by disturbing existing market and they will cut your throat.

But what about Clojure or Scala? Bear with me for a while.
The only way for a new language to succeed is to dominate a viable platform. What is the Clojure biggest selling point? Is it Macros? Lisp and Scheme have them for decades. What about interoperability with existing Java libraries? ABCL, Jython should I say more etc. The only killing feature of Clojure is concurrency. In order to successfully cross the chasm you need a pragmatist in pain. Pragmatist that suffers from writing concurrent code in Java so much that he is willing to give a chance to a fledgling newcomer like Clojure. Don't get me wrong aforementioned features help a lot, especially backward compatibility, but if processors were still single core and we all enjoyed the free lunch of increasing gigahertz-es nobody would give a damn about some weird functional language with immutable data structures. Clojure has no chance to dislodge Java as premier language for writing enterprise applications, but it could win as the language for writing concurrent applications. That is Clojure platform.

The second reason why this corollary wouldn't work is because integrating in some platform requires the language to change.But mature languages can't change easily if at all. This situation is described in theory of frozen evolution. Basically the evolution of language is similar of the evolution of a new specie. Evolution happens in short burst when the new language(specie) is created. In this period language design is plastic, there are few if any users, little amount of code and libraries and the community consists of enthusiasts. This short period of plasticity is fallowed by a long period of stability. The evolution of the language is frozen. There are few tweaks here and there but nothing radical. And nobody , not even the original creator could change that. Just imagine if Bjarne Stroustrup says to ANSI C++ committee that he wants to adapt post fix syntax, they would laugh at him just before they send him to mental institution to see what's wrong with his nerves. On the other hand Hickey , Tarver and Pestov could redesign their languages when new opportunity arise, but a new standard for Common Lisp is nothing but a dream.

(*) Eric Sink has a very nice article describing Geoffrey Moore ideas, where I shamelessly hot linked the bell curve image.

2 comments:

  1. First: a newcomer language on a certain platform will hardly ever become THE standard language to program the platform without the platform vendor pushing it hard (e.g. C#). However, easiness to work with/run on a popular platform will undoubtedly benefit a language's popularity, and inability to do so will certainly damage it. That's why Lisps have FFIs, and that's one of the reasons Python succeeded - it made so simple to glue together C modules. In my corollary I was provocatively pushing this to the extreme - "it is sufficient to interoperate well with a popular platform in order to become popular" - more realistically that should read "it is *necessary* to interoperate...". That is, if you make it hard to interoperate, you will never succeed. If you make it easy, you have a chance.
    Btw, the JVM did not succeed for the write once, run everywhere motto or the garbage collection or the OOP. Lisp, or Smalltalk for example, had all those and more way before Java. Java succeeded because it targeted the right market niche at the right time - enterprise, web-enabled applications. In every other area where Java has been used - applets, desktop apps, RIAs - it has failed, not because it's technically worse than its affirmed competitors, but because it didn't interoperate well with the preexisting non-Java platforms. That's why Flash and JavaScript are more successful on the client side of Web applications and C++/C#/Objective-C are more successful on the desktop.

    Second: it's not true that running on a platform requires a language change. It's a matter of trade-offs. Clojure is heavily influenced by the JVM/Java mindset and thus makes integrating with Java extremely easy - it has special syntax for Java interaction, some of its core concepts (e.g. exceptions, namespaces/packages) are directly mutuated from Java, etc. ABCL is a Common Lisp, and so it has to do some things the Common Lisp way rather than the Java way. However, it tries to provide nice integration with Java: its Java FFI is quite simple (you can optionally provide less verbose type information at the cost of a higher runtime performance impact), Java classes have been partially integrated with CLOS, Java exceptions can be remapped to CL conditions, etc. One could say that Clojure could be a better language if its design wasn't hampered by features they copied from Java. I maintain the somewhat extreme position that Clojure should not even be a language at all, but just a library of immutable data structures and concurrency constructs, for ABCL or some JVM Scheme.
    Also, sometimes languages influence the platform, too. The rise of many dynamic and functional languages on the JVM (and the CLR) are making those platforms adopt more and more features to better support those languages. Why? Because a) everyone thinks that heavily parallel applications are the Next Big Thing (I disagree), and b) functional languages tackle the concurrency problem better than imperative languages (I agree). The market (concurrent apps) is shaping the platform (JVM) and making functional languages (relatively) popular.

    So what is my point? I believe that a language has a solid design (like CL) and has a good implementation that runs on a popular platform (ABCL could become that implementation) and follows the developments occurring on that platform, making sure they all get integrated into the language (even as implementation-specific extensions), then on the long run that language will be ahead of the competition, because it will have the same features as its competitors but it will also have a superior design. That requires a lot of effort and does not automatically imply becoming popular - far from it. However - it is a chance.

    ReplyDelete
  2. Hi Slobodan,

    thanks for the opportunity to entertain this interesting discussion! :)

    First, I completely agree on your view on the importance of the market. I'm convinced that people do not specifically care for the platform; what most people - and especially most pragmatists - ultimately care about is how to better reach a certain market niche. They will look for the most well-established platform that targets that market, accept whatever language is dominant to program on that platform, and use that. Examples:

    - desktop programming -> Windows -> C++ (and more recently .Net -> C#)
    - desktop programming, Apple variant -> Mac OS X -> Objective-C
    - network services -> *NIX -> C, and more recently Perl/Python
    - interactive web apps, client side -> browsers -> JavaScript (and to a minor extent Flash)
    - web, server-side enterprise applications -> JVM (and application servers such as JBoss) -> Java
    - high-reliability concurrent telecom apps -> Erlang

    So in a sense, languages become popular thanks to the platform they run on, but the platform itself becomes popular thanks to the problems it solves (or creates :D).

    That said, I don't completely agree to your two points.

    (continues)

    ReplyDelete

Note: Only a member of this blog may post a comment.