Cobra (programming language from Cobra Language LLC)
| Usual file extensions | .cobra |
|---|---|
| Paradigm | Multi-paradigm: object-oriented |
| Appeared in | 2006 |
| Designed by | Chuck Esterbrook |
| Developer | Cobra Language LLC |
| Stable release | 2009-03-20 (March 20, 2009) |
| Typing discipline | strong, static, dynamic, inferred |
| Influenced by | Python, Eiffel, C#, Objective-C |
| OS | Microsoft .NET, Mono |
| License | MIT |
| Website | http://cobra-language.com/ |
Cobra is an object-oriented programming language produced by Cobra Language LLC.[1] Cobra is designed by Chuck Esterbrook, and runs on the Microsoft .NET and Mono frameworks.[2] It is strongly influenced by Python, C#, Eiffel, Objective-C and other programming languages.[3] It supports both static and dynamic typing.[4][5] It has first class support for unit tests and contracts.[4] Cobra provides both rapid development and performance in the same language.[6]
Cobra is an open-source project. It was released under the MIT open source license on February 29, 2008.[7]
A monthly update is posted to the Cobra news forum with progress on features, fixes, documentation and related projects since the last update.[8]
Features
- Object-oriented:
- Namespaces
- Classes, interfaces, structs, extensions, enumerations
- Methods, properties, indexers
- Mixins, extension methods
- Generics, attributes
- Quality control:
- Contracts, assertions
- Unit tests, docstrings
- Compile-time nil-tracking
- Expressiveness:
- Static and dynamic binding
- List, dictionary, and set literals
- in and implies operator
- for expressions
- Slicing
- Interpolated strings
- Compile-time type inference
- Lambdas and closures
- General productivity:
- Exception handling
- Postmortem exception report
- Garbage collection
- Scripting conveniences:
- Clean syntax
- Dynamic binding
- One-step run
- Shebang line (#!)
- Miscellaneous:
- Doc tool (cobra -doc)
- Syntax highlighting tool (cobra -highlight)
Examples
The following examples can be entered into a file and run using cobra <filename>.
Classic Hello world example:
<source lang="python"> class Hello
def main
print 'Hello, World'
</source>
Simple class:
<source lang="python"> class Person
var _name as String var _age as int
cue init(name as String, age as int)
_name, _age = name, age
def toString as String is override
return 'My name is [_name] and I am [_age] years old'
</source>
References
- ↑ The Cobra Programming Language home page
- ↑ The Cobra Programming Language, C. Esterbrook, Lang.NET Symposium 2008
- ↑ Cobra takes a bite at open source, Adrian Bridgwater, ZDNet UK, Mar 2008
- ↑ 4.0 4.1 Reaping the Benefits of Cobra, Ted Neward, MSDN Magazine, June 2009
- ↑ Was George Costanza a Computer Programmer?, Jonathan Erickson, Dr. Dobb's Journal, April 2008
- ↑ Cobra language slithering to open source, Paul Krill, InfoWorld, Feb 2008
- ↑ [{{Expansion depth limit exceeded||}} "The Cobra Programming Language"]. {{Expansion depth limit exceeded||}}. Retrieved 2008-02-29.
- ↑ Cobra News Forum
External links
- The Cobra Programming Language home page
- The Cobra blog by Chuck Esterbrook
- Cobra News Index
| File:HelloWorld.svg | This programming language-related article is a stub. You can help Wikipedia by expanding it. |
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...