Tuesday, May 19, 2009

Cobra -- Next Big Thing (in a few years time)

Thanks to Simon Wittber for alerting me to this language via his blog post, "Cobra vs Python".

The Cobra homepage is available here.
The Cobra v Python overview is available here.

I'm going to make the ludicrously early call that this language will be the next big thing, eventually. I will not be moving away from Python any time soon, since (a) my job depends on it, and (b) it's fully operational now. However, I really do think that Cobra is, if not simply 'better', an important step forward in the evolution of dynamic language generally. Watching Cobra develop will provide insights for all languages, I have no doubt!

It has the features that make Python great, plus important features from other languages which will make it even more popular and even more palatable. It allows the kind of productivity you can only get from being able to 'throw something together' using elegant syntax and high-level semantics with dynamic typing, but then it *also* allows optional static typing to get the most out of compile-time checking to provide early-warning of type errors and an extra layer of guarantee of program functionality. It also includes contracts, which, while they could in general terms be implemented in any language using a lot of assert statements, are supported by Cobra with a neat syntax which will encourage their use. I can well imagine using this as a strong argument in its favour -- developers could prototype a system or server using dynamic typing, then go back and tighten up the screws with static typing as appropriate and the introduction of contracts.

It deploys to all major platforms, including .NET.

For me personally, the best features are:
* Decimal arithmetic by default (i.e. the literal 5 will become a decimal, not a float)
* Optional static typing
* Contracts
* That all the best features (for me) of Python are included



  1. What about not being able to change things like class structure at runtime? I think that ability allows you to do many powerful things that you can't do in other more statically structured languages.

  2. As much as I dislike being morbid, I believe it will go the same path as Plan 9. While better, python is good enough and most of its features can be added to python with little language changes.

  3. A very nice language. For me, it is better than Boo. Too bad the lastest seems to have better support in Mono :/

  4. It does not seem to be open source, nor does it seem to say anything about licensing, or even licensing of the programs that you write with the language.

    until that is clarified I would hold back my enthusiasm

  5. about the licence: it's MIT, see

  6. static typing and type annotation in Corba looks similar to the use in cython, which compiles python to C, if you need the speed.

    And interfacing to c instead of .net has the huge advantage of using available extensions for number crunching, and it is really cross platform.

    So, I don't think Corba will be any competition for python, maybe for languages in the market for .net scripting.

    Similar to what Lucian said, for a (maybe) small language improvement, we don't throw out all our batteries. Especially, if we already have packages that cover the same area.

  7. Hi, I'm the author of Cobra which is open source under the MIT license and can be used on any kind of project.

    .NET has plenty of batteries included. There are also plenty of 3rd party libraries such as SDL that have .NET bindings.

    Furthermore, Cobra is being ported to the JVM so that it will be multi-platform and have access to additional libraries and tools.

    The value of Cobra includes better error checking, contracts, unit tests and optional static types--all in one language with one slick syntax. And you don't have to give up performance.

    Re: cython, pyrex, rpython, etc. they seem to be dialects that don't port between each other or back to standard Python. The plan for Cobra is that its feature set remains intact as we add backends (JVM, ObjC, etc.)

    I improve Cobra every month and almost every week since early 2006. It's not going away.

    So I hope you'll give it a fair shake! Thanks.