Forums

New to the Cobra

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

Re: New to the Cobra

Postby DelphiGuy » Tue Apr 17, 2012 4:34 am

Thanks. I guess there should be an unwritten rule that software tool developers have to check the marketplace before inadvertently re-using the same name as another tool! :-)

http://www.cs.washington.edu/research/projects/cecil/

Since Cobra was developed there is a more mature alternative called Cecil that could be suitable, but swapping out the back-end (~5000 raw lines of Cobra) is a bigger project than making other kinds of improvements.


Sorry, I missed this. "Suitable" for what, please?

-Paul
DelphiGuy
 
Posts: 116

Re: New to the Cobra

Postby Charles » Tue Apr 17, 2012 7:59 am

Suitable for generating the .NET bytecode that implements the semantics of Cobra declarations and statements. I think it would be faster than the current C# back-end.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: New to the Cobra

Postby DelphiGuy » Tue Apr 17, 2012 11:11 am

OK, attached below is tech support Joseph Hill from Monotouch writing to me. Based on what they're saying, should Cobra work ok in theory? Thanks for your patience on this subject, Charles.

-Paul

^^^^^^^^^^^^^^^^^^^^^^^^^^^

Joseph Hill

APR 17, 2012 | 11:06AM EDT

Hello Paul
Our tooling is all very C# focused, and we only officially support this language today. That said, it should possible to use any language that can output Portable Class Libraries by simply referencing the compiled library in your MonoTouch project:
http://msdn.microsoft.com/en-us/library/gg597391.aspx

Beyond that, it is possible to make other .NET languages work with our tooling, because the MonoTouch SDK exposes its cross-compiler, which can compile .NET assemblies to native iOS ARM executables. You can see, for instance, the work the Delphi Prism guys have done to enable the Delphi language to work with MonoTouch.

I'm not familiar with Cobra, but it is probably worth nothing that any language that depends on generating code at runtime (i.e., dynamic languages or languages that make heavy use of Reflection.Emit) will not work on iOS, since the iOS kernel will not disallows execution of writeable memory on device.

Hope that helps. Please let us know if you have any additional questions.

Thank you
Joseph
DelphiGuy
 
Posts: 116

Re: New to the Cobra

Postby Charles » Wed Apr 18, 2012 10:29 am

Yes, Cobra does not rely on Reflection.Emit at run-time, so you should be good. If you bump into any problems or questions while attempting this, let me know.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: New to the Cobra

Postby DelphiGuy » Wed Apr 18, 2012 7:10 pm

Does Cobra output Portable Class Libraries?
DelphiGuy
 
Posts: 116

Re: New to the Cobra

Postby Charles » Wed Apr 18, 2012 10:55 pm

I haven't studied these yet. They are described here:
http://msdn.microsoft.com/en-us/library/gg597391.aspx

If it's a matter of some build flags passed to the C# compiler, then it should be fairly easy. Maybe someone here can volunteer to research this.

I have some patches to apply and bugs to fix.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: New to the Cobra

Postby DelphiGuy » Fri Apr 20, 2012 9:23 pm

you asked for my impressions. well, here are my first impressions:

aside from the frustration with the install process, and wishing that cobra was more mature with a swarm of fanatical brainiac volunteers having paved the way for me with a simple installer and an elegant IDE, while i reclined on a sofa, i had the following reaction to the actual language...

my first thought in trying to write a few lines of cobra was "why on earth do other langs use curly braces and begin/end?" as you said, charles, we've got to indent anyway, so what useful function does all of the additional bracing of code blocks serve? it's about half the energy to merely line up the indentations, rather than also have to line up all the braces.

honestly, i can't imagine why other langs haven't dispensed with that over-elaboration long ago.

-paul
DelphiGuy
 
Posts: 116

Re: New to the Cobra

Postby Charles » Sat Apr 21, 2012 12:01 pm

I don't know why other languages persist with curlies either. It was after some years of writing mounds of Objective-C in the 90's that I literally stopped upon typing '}' and wondered why I had to keep doing that. It wasn't the essence of my code/software/solution, and I was indenting anyway. Why doesn't the compiler just figure it out? I later found out that Python was already there and consequently had proven in the field that braces (or begin/end) were superfluous to getting the job done.

Some years ago, I participated in a debate on a local linux mailing list about which approach was better. Those who were against the indentation approach could not get it out of their heads that somehow the code would be ambiguous, or hard to read or that some disaster would befall them when modifying it. Anyone with experience in Python or Cobra knows better. It's an example of "experience informs".

Regarding progress, there is a reason why things slowed down this past year and why they will pick back up. I'll post on that in a separate thread.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: New to the Cobra

Postby DelphiGuy » Sun Apr 22, 2012 6:36 am

charles:

some miscellaneous comments, in no particular order...

1) is it possible for these discussion threads to be presented in reverse order, with the most recent "reply" showing first, rather than last? it's a pain to have to manually select the last page of the conversation thread in order to read the most recent comment.

2) similarly, is it possible to have the overall list of discussion topics presented in reverse date (of most recent reply or posting) order, instead of statically in their assigned order, so that recent posts bubble to the top of the list so that reader's can simply check the top of the list if they want to see activity on the board?

3) i've been reading the cobra tutorial, in order, and love the language and completely grasp that you're an ergonomics fanatic and that any rational programmer should probably favor cobra as his/her general development language. i'd guess that the main obstacle to radically increasing cobra popularity, is the lack of complete support for it by at least one of the popular IDEs. easy for me to say that, because i'm frankly not competent enough as a programmer to step up to the plate and help you accomplish that task.

4) i was surprised to read about cobra's multiple assignment feature. do any of the C variants or other popular gen'l development langs do that? i don't remember ever seeing it before. it's amazingly elegant that the cobra compiler not only allows multiple assignments to be done on one line for the sake of code brevity, but also assign them all simultaneously, rather than left-to-right sequentially. this is really a clever insight into how to offload work (and specifically, to entirely avoid the manual creation of some awkward temporary variables) from the programmer onto the compiler. which lang did you borrow this idea from, please? just curious.

5) thanks for this public gift. my intention, if at all possible, is to move my programming life entirely to this new lang and write a comm'l application with it, including targeting iOS. i suspect that if a major coding-intensive company hired you to develop cobra as their in-house programming language, they'd see a return on their investment in coding productivity.

-paul
DelphiGuy
 
Posts: 116

Re: New to the Cobra

Postby DelphiGuy » Sun Apr 22, 2012 12:15 pm

ah, i figured out how to accomplish request #1 from my previous email, by setting my preferences in the user "Control Panel".
DelphiGuy
 
Posts: 116

PreviousNext

Return to Discussion

Who is online

Users browsing this forum: No registered users and 14 guests