Cobra vs. Boo?

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Cobra vs. Boo?

Postby johnwyand » Fri Feb 08, 2008 10:18 pm

I heard about Cobra recently and found it interesting, but I have a couple questions. How is Cobra different than Boo? Also, why would someone want to use Cobra instead of Boo? Its just that these two languages seem very similar as they both have a syntax based on Python's and both target .NET.
Posts: 1

Re: Cobra vs. Boo?

Postby Charles » Fri Feb 08, 2008 10:21 pm

Others have asked the same as it's a natural question.

That's going to be a long post. Let me get the next bug fix release out first and then I'll reply in this thread.
Posts: 2515
Location: Los Angeles, CA

Re: Cobra vs. Boo?

Postby Charles » Sun Feb 10, 2008 3:09 pm

I was going to post details about the history of Cobra, my brief involvement with the Boo community, my decision to strike out on my own (I used to use Boo), etc. But it's a long story and I realize now that was a big part of why I wasn't getting around to posting about "Cobra vs. Boo".

We're all short on time. I'll skip to the end which is still a big post. :-)

Cobra and Boo have much in common including a syntax derived from Python and an object model derived from C#. They both target .NET and Mono. Boo is open source and Cobra will be as well no later than Feb 29th.

I'll skip minor details about syntactical differences. I'll also skip the details of maturity issues. Suffice it to say that Boo is less mature than C# and VB because it's younger and has an ambitious feature set. Consequently, you'll see people posting problems on their discussion list that don't exist in Microsoft C# and VB. Likewise, Cobra is a young ambitious language and it's going through growing pains as well. With enough unit tests and elbow grease we'll both eventually have high quality products.

Some have speculated that Cobra will get there first because it's self-hosted. Others could speculate that Boo has a head start. Please realize I don't care and the Boo folks probably don't either. We'll both be pushing our languages forward regardless of who else is doing what.

So now for differences. Cobra emphasizes:
  • Compile-time null tracking
  • First class support for contracts
  • First class support for unit tests
  • Using C# for the backend to get various benefits will I'll post about later
  • Favoring accurate, decimal math over inaccurate binary floating point
  • Being .NET-centric ([1, 2] is a .NET List<of int>, not a CobraList)
  • Being self-hosted / self-implemented

Some of this is covered in Coding for Quality. You might tease out other details in Comparison to Python.

Boo emphasizes:
  • Compiler extensibility
  • Macros

I didn't mention things they both emphasize like type inference, support for both static and dynamic typing, etc.

There could be things I'm missing for Boo that Cobra does not or will not have. I'm not a Boo expert, but I did skim over their features list.

So if you give me the opportunity, I will talk your ear off about coding for quality and self-hosted compilers. I think they're important. The Boo people love to talk about compiler extensibility and macros. So while many things are important to both of us (clean syntax, performance, type inference, etc.) you can then see our different mindsets through what we've focused on providing.

Will Cobra ever have macros? Possibly, but if so, it will be much later. I think macros are a tricky topic and I'm well aware that's lots of Python and C# projects are doing fine without them. And I don't mind letting the Boo guys explore this area in public. Even Microsoft could end up exploring this area and it would be interesting to see what they come up with.

I'm sure both languages are here to stay. They are both free and open source, so feel free to check them both out.

Posts: 2515
Location: Los Angeles, CA

Return to Discussion

Who is online

Users browsing this forum: No registered users and 5 guests