Cobra language gets major update(cobra-language.com) Currently for .NET, JVM in the pipeline. |
Cobra language gets major update(cobra-language.com) Currently for .NET, JVM in the pipeline. |
Why Cobra? http://webcache.googleusercontent.com/search?q=cache:A7djdaz...
and
Cobra compared to Python: http://webcache.googleusercontent.com/search?q=cache:GmrbTK9...
It sounds like basically the adoption strategy is to sell people coming from .NET on a Python-like language with binary compatibility, rather than to sell people coming from Python on a statically typed, compiled language with source compatibility. So, not as much for me as a Python person, until the ecosystem evolves. Too bad, because it doesn't seem like there was much of a win from giving up forward compatibility. But maybe a cool thing for .NET people?
EDIT: Apparently Boo hasn't been updated for almost a year.. sad. Oh well, that leaves two choices then.
That means when the interest in the language drops to near zero again... I don't know, maybe the authors or maintainers of a web page should be warned before posting the link on Hacker News? I'm angry, because I find Cobra to be one of very nice languages that I'd like to see used more - and hn'ed site does not do any good on that front :/
I was playing with Cobra about a year ago and it was promising then - now it looks like it's almost ready for prime time. I think I'll try to use it for my next project.
#from the website, because it seems to be down for many right now.
class SmallSample
var _random = Random()
def randomString(length as int, alphabet as String) as String
require
length > 0
alphabet <> ''
ensure
result.length == length
test
utils = SmallSample()
assert utils.randomString(5, 'ab').length == 5
s = utils.randomString(1000, 'a')
for c in s, assert c == 'a'
body
sb = StringBuilder()
for i in length
c = alphabet[_random.next(alphabet.length)]
sb.append(c)
return sb.toStringSeems that doesn't use explicit variable declaration. Supporting that would be a great improvement over Python.
You often won't see this for the sake of succinctness. I might have misunderstood what you were saying but thought I'd mention that.
There have been a few attempts to hack (design by) contracts into Perl. Here are some which can be found on CPAN:
* Class::Agreement - https://metacpan.org/module/Class::Agreement
* Class::Contract - https://metacpan.org/module/Class::Contract
* Sub::Contract - https://metacpan.org/module/Sub::Contract
Sub::Contract is my favourite because it's lightweight, pragmatic & with a more Perlish implementation.
From what I can tell, Cobra adds compile-time nil tracking (nice!) and contracts. I'd be extremely interested in this if I was still doing anything in .NET.
Selfishly, I wish the JVM was its primary target and not .NET.
Seems quite nice.
If you need Python on .NET there always is IronPython, which is quite well supported. I think Cobra was made incompatible with Python syntax to emphasize that it is not Python, it has different aims and philosophy - but I can be dead wrong on this, maybe it's just because author liked some syntax better...
That being said I really don't think syntax matters that much, even if it's very similar (or very different) to something you know already. I learned and use CoffeeScript with pleasure even though it's syntax is similar - but not compatible - with Python's. Given a good syntax highlighting plugin for Vim, which I use as my editor, I have almost no problem at all with switching from Python to Coffee mode - when I end an if statement with ":" it gets highlighted as an object literal and then I instantly know it's wrong. On the other hand I use OCaml and Racket for some of my side-projects and similarly I don't miss much of Python's constructs. I think it is more important for syntax to be consistent than to be familiar or similar to something. I just don't understand marketing languages as "similar to C" in syntax, who cares?
Just because it is a nice excuse to use it on work projects, otherwise I am bound to the languages required for the project.