Forums

MonoDevelop Cobra add-in

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

MonoDevelop Cobra add-in

Postby Charles » Sat Jul 28, 2012 3:23 pm

I thought I would start a new thread for this topic.

We have a wiki page here where we can put some notes and tips.
http://cobra-language.com/trac/cobra/wiki/MonoDevelop

But in particular, it then points to the github page hosting the Cobra add-in which currently works with MonoDevelop 2.8 including syntax highlighting, compilation and interactive debugging. User nerdzero got this going.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: MonoDevelop Cobra add-in

Postby Charles » Sat Jul 28, 2012 3:25 pm

Feedback. In the add-in implementation, this code here:
Code: Select all
   if (_isWindows) {
      //gross, you probably also have to run MonoDevelop as admin
      proc.StartInfo.FileName = "c:\\cobra\\bin\\cobra.bat";
   }
   else {
      proc.StartInfo.FileName = "cobra";
   }

Could first check for an env var called COBRA_EXE and if not null, not blank and not missing, use that. In this way, people can dictate the Cobra compiler the add-in uses through an env var. README.md would mention it.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: MonoDevelop Cobra add-in

Postby Charles » Sat Jul 28, 2012 3:43 pm

Feedback. I would suggest a slightly beefier Console program template:
class MyProgram

def main
# Hello
msg = 'Hello, ' + 'world.'
assert msg == 'Hello, world.'
trace msg
print
print msg
# @help msg

This introduces the newbie to comments, string concatenation, assert, trace, print and @help. And it's still easy to gut for any purpose as it's only 6 extra lines.

Also, MonoDevelop's own C# project templates use tabs for indentation. The Cobra compiler, samples and how-to's also use tabs. I would prefer if the Cobra project templates do as well for consistency. Of course, the user can always edit the templates if they want, and down the road we could even have a command to switch them back and forth to make it easy. But in the mean time, I think they should be congruent with the Cobra project and the MonoDevelop C# templates.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: MonoDevelop Cobra add-in

Postby nerdzero » Sun Jul 29, 2012 11:01 am

All good ideas. What about including a doc string in the template as well?
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: MonoDevelop Cobra add-in

Postby nerdzero » Sun Jul 29, 2012 12:35 pm

What about this idea: We keep the Console Project template simple but add a new project template called something like "Cobra Tutorial". This project could then include a lot more sample code to demonstrate asserts, traces, contracts and tests, expression substitution in strings, etc.

So, the console project template would be pretty straight forward like the other console templates for C# and VB.NET

"""
Replace this text with a description of your program.
"""

class MyProgram

def main
print 'Hello, world.'


but the tutorial template would then be more comprehensive and showcase a lot of Cobra's features. What do you think?
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: MonoDevelop Cobra add-in

Postby Charles » Sun Jul 29, 2012 3:58 pm

A doc string is a good idea.

"Console Tutorial" and "Console" project templates sounds like a great idea. It also paves the way for things like "GTK#" and "GTK# Tutorial" tempates.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: MonoDevelop Cobra add-in

Postby nerdzero » Mon Jul 30, 2012 11:29 pm

Support for package references has been added and also a basic Gtk# project template has been added. When I get a chance, I will work on solution/project references next, then tutorial templates, then really dig into supporting MonoDevelop 3.0.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: MonoDevelop Cobra add-in

Postby Charles » Tue Jul 31, 2012 12:58 am

Sounds great.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: MonoDevelop Cobra add-in

Postby DelphiGuy » Wed Aug 01, 2012 10:32 am

this (monodevelop being supported for cobra) is truly wonderful news. thank you.

i'm running win 7 and have MD 3.0xxx installed. i assume you're using MD 2.8xxx?

i found this 2.8xxx alpha trunk build: http://monodevelop.com/Download/Trunk_Builds and installed it, but it immediately wanted some updates from the web. when i said "yes", it updated itself to 3.0xxx . {sigh}

would you please confirm that that trunk build, if i don't fall for the same trick again, is possibly my best bet toward getting your MD stuff to run? i realize that you don't personally Q&A every MD build on every platform, but what i mean is: is there any general likely relationship between that build and whatever version you're running on.

by the way, nerdzero, i am willing to give you some help toward supporting MD 3.0xxx. as i discussed with charles previously, i'm a pretty rotten programmer -- there's many OOP and .Net concepts that elude me. but if there's something a chimpanzee with a typewriter could do, i'd be willing to try to give you some time to help get cobra/MD3 up and running completely. let me know.

-paul
DelphiGuy
 
Posts: 116

Re: MonoDevelop Cobra add-in

Postby Charles » Wed Aug 01, 2012 11:16 am

@DelphiGuy, if you could do searches on the add-in API differences between MonoDevelop 2.8 and 3.0 for language bindings, that could help accelerate supporting 3.0. Both nerdzero and myself are interested in supporting 3.0, it's just that 2.8 comes on Ubuntu with no effort so that's where it was started.

Places to search could include:
- google
- monodevelop dev discussion archives
- irc logs
- stackoverflow

If you don't find anything, you could post a question to stackoverflow.

This should be an approachable task.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Next

Return to Discussion

Who is online

Users browsing this forum: No registered users and 3 guests