Forums

Running Cobra the first time

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

Running Cobra the first time

Postby Charles » Tue Jul 06, 2010 9:23 pm

mchean wrote:...I would like some kind of instructions on how to setup the Cobra env. such that one just unzips - and then is able to compile and run the Hello sample for instance. Quick and easy gratification without any in depth knowledge of the .Net and its setup.


To run the most recent release, try this:

Download the prominent .zip for Windows, or .tar.gz for other systems, at the Downloads page. Currently that is Cobra-2010-04-02

If you are on Mac or Linux, you will need to install Novell Mono if you don't have it already. If you are on Windows, you probably already have .NET 2.0 or higher.

Unzip (or untar) the file.

Change to the directory such as "cd Cobra-2010-04-02"

Examine the "read me" file and follow its directions.

Afterwards, create a new Cobra file in your own directory such as:
class MyProgram
def main
print 'Hello.'

And run with "cobra hello.cobra" at the command line.


mchean, please provide feedback on the above. Is there a step missing? Is anything unclear? We can then make these instructions more prominent on the downloads page.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Running Cobra the first time

Postby carlosqt » Wed Jul 07, 2010 1:47 am

After Unzip Cobra-2010-04-02.zip you have the following folder structure:
> Developer
> HowTo
> Reusables
> Samples
> SamplesInProgress
> Source
> Supplements
> Tests

Go to: Source

Run install-from-workspace.bat

Command line appears running scripts

The result is a new folder in C:\ root.
You can move the complete folder to another location if you want.
Assuming you did not change the folder location you have:

C:\Cobra
> bin
> Cobra-0.8.0-post
> bin <-- compiler is here (Cobra.exe)
> HowTo
> Reusables
> Samples
> Supplements

Here is what you need to start compiling: C:\Cobra\Cobra-0.8.0-post\bin

Create a hello.cobra txt file with the code mentioned by Chuck in the previous post and put it in the same bin folder:

C:\Cobra\Cobra-0.8.0-post\bin

Open a command prompt and navigate to the Bin folder where the Cobra.exe and hello.cobra are:

C:\Cobra\Cobra-0.8.0-post\bin

Run the following:

Cobra.exe hello.cobra

This creates a hello.exe and displays hello. to the console.
carlosqt
 
Posts: 17
Location: Belgium

Re: Running Cobra the first time

Postby Charles » Wed Jul 07, 2010 4:21 am

Thanks for the extra detail. Overall looks good, but I don't like cluttering up the bin\ directory with various user files. I wouldn't put anything there, not even hello.cobra.

Maybe we can move this to the wiki as InstallOnWindows and InstallOnUnix or something similar.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Running Cobra the first time

Postby mchean » Wed Jul 07, 2010 9:37 am

Hi:
It looks good after the addition of the install-from-workspace.bat instruction. That is the step I missed initially, but found the
error mentioned elsewhere in these forums.
Thanks for all the effort Chuck, this is a great language, very clear and concise.
Have you ever presented at the L.A. Python User group?
mchean
 
Posts: 4
Location: Los Angeles, CA

Re: Running Cobra the first time

Postby Charles » Wed Jul 07, 2010 10:13 am

You're welcome. Thanks for the compliment.

Yeah I presented Cobra there back in 2008. I used to attend the meetings every month but haven't been there in awhile. Still on the list.

You'll find Cobra mentioned at http://socal-piggies.org/scp/PastMeetings.
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 13 guests