Forums

Quick facts about Cobra

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

Quick facts about Cobra

Postby Charles » Thu Nov 06, 2008 11:19 pm

I was thinking about making a list of quick facts about Cobra prominent on the web site. Here is what I have so far. Feedback is welcome. (The real version will have the appropriate links.)

Quick Facts About Cobra

Cobra is a general purpose, object-oriented programming language.

Cobra is open source under the MIT license and can be used on open source, public domain, commerical and private projects at no charge.

Cobra's main aim is developer productivity across a wide range of application domains. Cobra codes fast and runs fast.

Cobra releases are packaged and tested for Microsoft Windows, Apple Mac OS X and Linux. The Mac OS X and Linux package are the same .tgz package (containing bash install script) which will also work on other systems such as BSD and Solaris.

Cobra currently runs on Microsoft .NET and Novell Mono. Work has begun towards a JVM backend with the intent that both versions become fully supported peers.

Cobra classes can be naturally consumed by C# and Visual Basic developers because Cobra outputs standard types and uses standard collections for lists and dictionaries. Cobra can naturally use the .NET libraries with no bridging or overhead of any kind.

Cobra's syntax is based on Python, but not religiously so. That means code blocks are done via indentation. It does *not* mean that whitespace is significant: "6 * 7" and "6*7" are both "42".

The syntax has support for lists, dictionaries, sets, their operations, list comprehensions, assert, doc strings, slicing, tuple assignment, interpolated strings and more.

Although the syntax is very similar to Pythn, Cobra does not intend to be compatible with Python as it has its distinct goals and design.

Cobra has solid run-time performance similar to C# and Java.

Cobra detects many errors at compile-time to avoid needless round-trips to run-time.

Cobra has support for both static and dynamic typing (a la the Objective-C programming language).

Cobra has language level support for syntax-light, inline unit tests (a la the D programming language).

Cobra has contracts (a la the Eiffel programming language). These include preconditions, postconditions and invariants.

Cobra treats "nullability" uniformly across all types (String vs. String?, int vs. int?) and detects many "null reference exceptions" at compile-time.

Cobra supports signed and unsigned integers in sizes 8-bit through 64-bit, float32, float64 and decimal.

Cobra supports generic types such as List<of Shape> and Dictionary<of String, Customer>. Using these can improve readability, compile-time error checking, run-time error checking and run-time performance.

To the extent that static types are used in code, Cobra programs will reduce down to native machine code (through the virtual machine's facilities for this) and execute at native speeds. You're still free to use dynamic typing whereever you like for increased flexibility traded against performance.

Despite being a compiled language, Cobra provides scripting conveniences such as running a program in one command ("cobra MyProgram.cobra"), a #! line for Mac/Linux/Unix systems, clean synax and dynamic binding.

The languages with the largest influence on Cobra's feature set have been Python, Objective-C, Eiffel and Java+C#.

Cobra was created with test driven development. All features and bug fixes are locked in with automated regression tests, now numbering over 700.

The Cobra compiler is implemented in Cobra as a testament to its capabilities and performance. Also, this enables the compiler maintainers to take advantage of Cobra's productive feature set.

Cobra includes sample programs and "How To"s which can be used to quickly learn the language.

The Cobra web site features an active discussion forum, public wiki and public ticket system (via Trac).

Requests for help on the discussion forums are usually responded to in 24 hours or less.

Cobra can be easily installed from a Subversion workspace using the install-from-workspace script. Combined with the test driven development, you can easily and safely use the very latest Cobra. Use the Subversion revision number, you can install the exact same version of Cobra on other machines.

To get started with Cobra:

* Get a copy of the Source
* Run the install-from-workspace
* Browse the How-To's and Samples
* Check out "How to learn Cobra"
* Visit the forums
* Write some fantastic code!
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Quick facts about Cobra

Postby Charles » Sat Dec 20, 2008 1:23 am

Plenty of views, but no responses... Is this a good idea or bad idea in your opinion?

Other than some minor edits, I plan on calling it "Quick Points".
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Quick facts about Cobra

Postby hopscc » Sat Dec 20, 2008 3:39 am

Good idea
Could call it 'The elevator pitch'
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Quick facts about Cobra

Postby pchapin » Sat Dec 20, 2008 7:00 am

It all sounds good to me! You listed the reasons that got me interested in Corba ("Code for Quality" issues).

Chuck wrote:Cobra's syntax is based on Python, but not religiously so. That means code blocks are done via indentation. It does *not* mean that whitespace is significant: "6 * 7" and "6*7" are both "42".


This makes it sound like "6 * 7" and "6*7" are different in Python. However, I don't think that's true (or is it?).
pchapin
 
Posts: 46
Location: Vermont, USA

Re: Quick facts about Cobra

Postby Charles » Sat Dec 20, 2008 2:03 pm

Hmmm I was trying to point out that they are *not* different by stating that they both are 42. How could I reword to make it more clear?
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Quick facts about Cobra

Postby pchapin » Sat Dec 20, 2008 4:55 pm

How about something like,

"Cobra's syntax is based on Python, but not religiously so. Code blocks are done via indentation, and whitespace is not significant. For example, "6 * 7" and "6*7" are both "42". However... [some aspect of Cobra syntax that is different than Python's]"

The confusing thing was that the first sentence contains two aspects. One one hand it says that Cobra's syntax is like Python's, but it also says that it's not exactly like Python's. The second sentence also had two aspects, but both of those aspects were in support of the first point in the first sentence. To round things out, it would help to have a sentence that supports the second point of the first sentence.
pchapin
 
Posts: 46
Location: Vermont, USA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 76 guests