Live data from Hacker News

Cobra language gets major update

cobra-language.com

21–24 of 24 posts

Re: Cobra language gets major update

#21
post #16

Earlier quoted context omitted.

I did check out the list of features, and it sounds very cool. I like the first-class support for contracts and testing. But it's like, if I have to learn new language quirks and find new libraries to do everything and so on, I could also spend time learning rpython, or go, or any number of other very cool projects with more established ecosystems. Cobra syntax looks so close to Python syntax that it might as well be…

As I understand it Cobra wants to take advantage of .NET ecosystem, it's libraries and all. If you are not into .NET then I guess you are right, but if you are willing to learn .NET or are already familiar with it, then Cobra may be a nice tool. I recently had to write a small library for .NET and used F# for this (I don't like C# and didn't want to use IronPython), but Cobra could be even better fit for what I neede…

F# took over Python, when I am doing scripting on Windows.

Just because it is a nice excuse to use it on work projects, otherwise I am bound to the languages required for the project.

Re: Cobra language gets major update

#22
post #7

This looks promising. Nothing that has never been done before, but I really like the support for baked in doctests and contracts. This kind of sugar can make a real difference in terms of quality and readability #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…

On that example, the syntax looks like Python with a bit of BASIC (the type declarations). That "StringBuilder" object reminds me of Java, I would prefer a concatenation operator. Seems that doesn't use explicit variable declaration. Supporting that would be a great improvement over Python.

It has explicit variable declaration. You can always do: varname as Type = expression

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.

Re: Cobra language gets major update

#23
post #21

Earlier quoted context omitted.

As I understand it Cobra wants to take advantage of .NET ecosystem, it's libraries and all. If you are not into .NET then I guess you are right, but if you are willing to learn .NET or are already familiar with it, then Cobra may be a nice tool. I recently had to write a small library for .NET and used F# for this (I don't like C# and didn't want to use IronPython), but Cobra could be even better fit for what I neede…

F# took over Python, when I am doing scripting on Windows. Just because it is a nice excuse to use it on work projects, otherwise I am bound to the languages required for the project.

That's true, it's hard to use something different at work and F# seems plausible as a tool enough to use it without risk :)

Re: Cobra language gets major update

#24
post #12
post #7

This looks promising. Nothing that has never been done before, but I really like the support for baked in doctests and contracts. This kind of sugar can make a real difference in terms of quality and readability #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…

I've always wanted to work with a language that supports contracts (originally Eiffel I guess). Would love to see this hacked into Go. Or maybe I shouldn't turn this into a Go thread and start using Cobra.

If you work with .net, the code contracts project[1] is halfway there: It's quite ugly and they made some design decisions I don't agree with (for the wrong reasons, i guess...), but it has had a tremendous impact on the quality of my code.

http://research.microsoft.com/en-us/projects/contracts/

Post reply on HN