Quick facts about Cobra
Posted: 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!
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!