Forums

Distractions

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

Distractions

Postby nerdzero » Tue Oct 16, 2012 6:13 pm

Look what arrived today at my house after 3 months of waiting. Now how am I supposed to get any work done on the MD addin?!

raspberry_pi.jpg
raspberry_pi.jpg (95.8 KiB) Viewed 10387 times


Now...let's get Cobra running on this bad boy 8-)
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Distractions

Postby Charles » Tue Oct 16, 2012 6:48 pm

Looks like Mono works for the most part:

http://stackoverflow.com/questions/1021 ... spberry-pi
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Distractions

Postby nerdzero » Wed Oct 17, 2012 3:30 pm

Hmm, the "for the most part" seems important. I tried it out last night. The devil is always in the details.

It looks like Mono has issues with floats on ARM when the hard-float ABI is used. The unit tests for DecimalTools fail as it appears that the square root of 1 returns 0 on Raspbian (optimized version of Debian for Raspberry Pi). I was able to reproduce this in C# by casting a decimal to a float so it's not Cobra specific.

I'm going to try regular Debian for ARM which still uses the soft-float ABI. I think I'll have better luck.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Distractions

Postby Charles » Wed Oct 17, 2012 4:15 pm

Let us know how it goes.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Distractions

Postby nerdzero » Wed Oct 17, 2012 7:11 pm

Success!

It's quite slow though. I ran it a second time with -timeit:yes. See below for results.

I'm going to play with it a bit and see if it will be suitable for the application I want to use it in. I might have to wait for a fix on Mono to run Raspbian or maybe look into overclocking.

Code: Select all
Compiling installation program...

The Cobra Programming Language
Install From Workspace

Working...

==== Print Platform Description

Platform:          Unix 3.1.9.0
Uname:             Linux raspberrypi 3.1.9+ #272 PREEMPT Tue Aug 7 22:51:44 BST 2012 armv6l GNU/Linux
Virtual Machine:   Mono
CLR Version:       v2.0.50727
Env Command Line:  /home/pi/Cobra-0.9.0/Source/InstallFromWorkspace.exe -net4 -timeit:yes
Env Current Dir:   /home/pi/Cobra-0.9.0/Source
Env OS Version:    Unix 3.1.9.0
Env System Dir:   
Env Version:       2.0.50727.1433
Mono:              Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-5) ; Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com ; TLS: __thread ; SIGSEGV: normal ; Notifications: epoll ; Architecture: armel,soft-float ; Disabled: none ; Misc: softdebug ; LLVM: supported, not enabled. ; GC: Included Boehm (with typed GC and Parallel Mark)

==== Verify running as admin user

==== Verify installation directory

found dir: /usr/local/cobra

==== Verify running in workspace

Verified.

==== .NET 4.0 Prompt

-net4 was passed on the command line

==== Verify Novell Mono version

Mono Version 2.10.8.1 (Debian 2.10.8.1-5)
Verified >= 2.10

==== Locate and test Cobra Snapshot compiler

run: Snapshot/cobra.exe -about
   : The Cobra Programming Language svn:2786 (post 0.8) / 2012-08-25
   : on Mono 2.10.8.1 CLR v2.0.50727 on Unix 3.1.9.0
   : at /home/pi/Cobra-0.9.0/Source/Snapshot/cobra.exe
   :
   : Copyright (C) 2003-2012 by Cobra Language LLC.  All Rights Reserved.
   :
   : On the web:  http://cobra-language.com/
   : Source:      http://cobra-language.com/source
   : Support:     http://cobra-language.com/support
   : License:     http://www.opensource.org/licenses/mit-license.php
   :
   : Usage:       cobra -h

==== Build new Cobra compiler

run: Snapshot/cobra.exe -compile -timeit:yes -native-compiler:/usr/bin/dmcs -turbo -ert:yes cobra.cobra -files:files-to-compile.text
   : Compilation succeeded
   : timeit compile = 00:11:58.7625825
   : 51224 lines compiled at 71.3 lines/sec
   : 148093 nodes compiled at 206.0 nodes/sec
   : 275314 tokens compiled at 383.0 tokens/sec

==== Retrieve Cobra base version number

run: cobra.exe -version
   : Cobra 0.9.0 on Mono 2.10.8.1 CLR v4.0.30319 on Unix 3.1.9.0

base version: 0.9.0

==== Build Cobra.Core library

run: cobra.exe -build-standard-library -debug -timeit:yes -native-compiler:/usr/bin/dmcs -turbo -out:Cobra.Core.dll -key-file:Cobra.Core/Cobra.Core.snk  Cobra.Core/AssemblyAttrs.cobra
   : Compilation succeeded
   : timeit compile = 00:01:38.9859062
   : 5357 lines compiled at 54.1 lines/sec
   : 11769 nodes compiled at 118.9 nodes/sec
   : 30176 tokens compiled at 304.9 tokens/sec

==== Install Cobra.Core library to the GAC

Invoking Publish.GacInstall...
Not implemented exception.
Will attempt to use gacutil.exe.
found in system PATH
run: gacutil -i Cobra.Core.dll -f
   : Installed Cobra.Core.dll into the gac (/usr/lib/mono/gac)

==== Verifying Cobra.Core.dll installed to the GAC

Skipping due to running on .NET 2, but installed for .NET 4.

==== Build Cobra.Compiler library

run: cobra.exe -c -t:lib -ert:yes -namespace:Cobra.Compiler -files:files-to-compile.text -debug -timeit:yes -native-compiler:/usr/bin/dmcs -turbo -out:Cobra.Compiler.dll -key-file:Cobra.Core/Cobra.Core.snk  cobra.cobra
   : Compilation succeeded
   : timeit compile = 00:11:07.0176574
   : 51191 lines compiled at 76.7 lines/sec
   : 147663 nodes compiled at 221.4 nodes/sec
   : 274669 tokens compiled at 411.8 tokens/sec

==== Install Cobra.Compiler library to the GAC

Invoking Publish.GacInstall...
Not implemented exception.
Will attempt to use gacutil.exe.
found in system PATH
run: gacutil -i Cobra.Compiler.dll -f
   : Installed Cobra.Compiler.dll into the gac (/usr/lib/mono/gac)

==== Verifying Cobra.Compiler.dll installed to the GAC

Skipping due to running on .NET 2, but installed for .NET 4.

==== Verify newly built Cobra compiler

run: cobra.exe -about
   : The Cobra Programming Language 0.9.0
   : on Mono 2.10.8.1 CLR v4.0.30319 on Unix 3.1.9.0
   : at /home/pi/Cobra-0.9.0/Source/cobra.exe
   :
   : Copyright (C) 2003-2012 by Cobra Language LLC.  All Rights Reserved.
   :
   : On the web:  http://cobra-language.com/
   : Source:      http://cobra-language.com/source
   : Support:     http://cobra-language.com/support
   : License:     http://www.opensource.org/licenses/mit-license.php
   :
   : Usage:       cobra -h

run: cobra.exe -ert:no hello.cobra
   : Hello, world.

run: cobra.exe hello.cobra
   : Hello, world.

run: cobra.exe -ert:yes hello.cobra
   : Hello, world.

==== Copy files to install directory

found dir: /usr/local/cobra
del dir  : /usr/local/cobra/Cobra-0.9.0
make dir : /usr/local/cobra/Cobra-0.9.0

copy from: /home/pi/Cobra-0.9.0/HowTo
       to: /usr/local/cobra/Cobra-0.9.0/HowTo
copy from: /home/pi/Cobra-0.9.0/Reusables
       to: /usr/local/cobra/Cobra-0.9.0/Reusables
copy from: /home/pi/Cobra-0.9.0/Samples
       to: /usr/local/cobra/Cobra-0.9.0/Samples
copy from: /home/pi/Cobra-0.9.0/Supplements
       to: /usr/local/cobra/Cobra-0.9.0/Supplements
make dir : /usr/local/cobra/Cobra-0.9.0/bin
copy  bin: /usr/local/cobra/Cobra-0.9.0/bin
copy from: WebAssets
       to: /usr/local/cobra/Cobra-0.9.0/bin/WebAssets
copy from: Cobra.Core
       to: /usr/local/cobra/Cobra-0.9.0/bin/Cobra.Core
found dir: /usr/local/cobra/bin
writing  : /usr/local/cobra/bin/cobra
run: chmod a+x '/usr/local/cobra/bin/cobra'

==== Verify newly installed Cobra compiler

run: /usr/local/cobra/bin/cobra -about
   : The Cobra Programming Language 0.9.0
   : on Mono 2.10.8.1 CLR v4.0.30319 on Unix 3.1.9.0
   : at /usr/local/cobra/Cobra-0.9.0/bin/cobra.exe
   :
   : Copyright (C) 2003-2012 by Cobra Language LLC.  All Rights Reserved.
   :
   : On the web:  http://cobra-language.com/
   : Source:      http://cobra-language.com/source
   : Support:     http://cobra-language.com/support
   : License:     http://www.opensource.org/licenses/mit-license.php
   :
   : Usage:       cobra -h

run: /usr/local/cobra/bin/cobra -ert:yes Misc/hello.cobra
   : Hello, world.

==== Clean up workspace

==== Install "cobra" into a system path directory

found in PATH: /usr/local/bin/cobra
copy from: /usr/local/cobra/bin/cobra
       to: /usr/local/bin/cobra

The existing "cobra" in your path at
/usr/local/bin/cobra
has been replaced with the new one.

==== Change directory instruction

Now that Cobra has been installed, pleased change out of the
current directory, such as:

cd ../..

Visit http://cobra-language.com/ for discussion, wiki, samples, irc and more.

Success!
timeit total   = 00:32:26.3712587
timeit execute = 00:30:23.1822145
timeit compile = 00:02:03.1890442
6420 lines compiled at 52.1 lines/sec
15783 nodes compiled at 128.1 nodes/sec
36413 tokens compiled at 295.6 tokens/sec
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Distractions

Postby Charles » Wed Oct 17, 2012 8:11 pm

The installer does plenty of file I/O. Depending on how slow your storage is, that might dominate the time. Of course, that could be true for your intended app as well.

Don't forget you can use -turbo (or the individual options it triggers) to improve run-time performance.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Distractions

Postby Charles » Thu Oct 18, 2012 5:20 pm

Is the storage for the Raspberry based on flash?

http://www.techspot.com/news/50428-sams ... t19-direct
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Distractions

Postby nerdzero » Thu Oct 18, 2012 5:29 pm

Yep, runs off an SD card. Haven't benchmarked it yet to see what kind of I/O speeds I'm getting. Also, for compiling the compiler, I am betting it had to use swap space.

Interesting link btw.
nerdzero
 
Posts: 286
Location: Chicago, IL


Return to Discussion

Who is online

Users browsing this forum: No registered users and 96 guests

cron