[Melbourne-pm] Three Projects

Toby Corkindale toby.corkindale at strategicdata.com.au
Thu Apr 12 18:19:31 PDT 2012


On 12/04/12 10:13, Scott Penrose wrote:
> Hi Melbourne Team
>
> I am working on three Perl projects at the moment, and was wondering if
> anyone was interested, and specifically interested in helping out.
>
> PerlBone
>
> The Beagle Board and Beagle Bone have been very popular devices. I think
> the new Beagle Bone at US$89 is really a fantastic device. Yes a
> Raspberry Pi is cheaper, but it is more about graphics, BeagleBone is
> more about IO, devices etc. My opinion. The news has been about
> BoneScript, which is NodeJS but looks like Arduino C code (e.g.
> digitalWrite(3, HIGH)). Many of the examples sites talk about BoneScript
> and the Python. And it got me thinking about Perl. Guess what, Perl is
> already installed and fully running. So I wrote PerlBone.
>
> http://scott.dd.com.au/wiki/PerlBone
>
> It doesn't do all that much. But it compiles and runs fast, takes up
> small memory. It works, flashes LEDs etc. My intention is to make it
> work like Arduino, OR in a Perl OO mode, which then allows you to just
> use bits - e.g. my $bone = PerlBone->new(); $bone->digitalWrite(3,
> $bone->HIGH); or similar. FYI - like the Python and BoneScript (NodeJS)
> this uses the GPIO Kernel module via file system. That is something I
> would like to look at, as it is a very slow way to operate - especially
> with multiple IOs. There should be way to use direct kernel calls


Cool -- the BeagleBone looks pretty nifty.
I've played around with one of Jon Oxer's LeoSticks a bit, and 
programming via C wasn't a problem for me..
But some of the stuff I was trying to do really pushed the processor a 
bit hard.. Ended up with a lot of 8-bit-integer math in order to run 
fast enough, but that introduced rounding errors like crazy.

In other words, more power would be great, and the 'Bone looks like it 
offers that.


As far as the Perl library goes.. I was wondering if a blessed object is 
actually appropriate, or not?
Since you only have one instance of the device available to a program, 
wouldn't a singleton object be a closer match to the hardware?

I mean, it's not like you can do this:
   use PerlBone;
   my $bone = PerlBone->new(...);
   my $otherbone = PerlBone->new(...);

In which case, how about class methods?
   use PerlBone qw(:DEFINES)
   PerlBone->digitalWrite(13, PB_HIGH);

Or perhaps optionally export non-class variants even, which would make 
it easier for people used to Arduino, or just lazy people :)
   use PerlBone qw(digitalWrite :DEFINES);
   digitalWrite(13, PB_HIGH);


> Cloud9
>
> With regards to PerlBone, the nice integration of BoneScript is that the
> distributors have Cloud9 installed on the board. So you can edit and
> execute code on the system. Someone has put some effort into run and
> debug of NodeJS apps. There is some work on a Python plugin to run, and
> I started playing with a Perl version - unsuccessfully so far, but
> should be at least possible to do some basic run, compile checks etc.

I hadn't actually heard of Cloud9.
Their website says they support Perl? Or is that just meaning they do 
syntax highlighting?


> http://scott.dd.com.au/wiki/PerlBone
>
>
> Julia vs PDL
>
> Anyone use PDL?


No, but it's one of those things I keep thinking I should learn.
Also "R".


> I love being able to type: $x = rcols ('out/spec_anal.out'); line $x;
> and see a pretty chart. Or better when we use the 3D ones. Also matrix
> calculations are pretty amazing.
> http://julialang.org/ has come out recently, and does a nice set of
> comparisons to other languages, mostly for speed, but also for
> programmability comparison. It includes javascript, Python (with NumPy)
> etc. So I tried some PDL. In the two examples I wrote, it was plane that
> I am not good enough to write the code, but they performed about the
> same as Python. Since Julia already uses Perl in the build scripts, and
> to do the calculations of the performance stats, I thought it would be
> good to have Perl (using PDL) in the list.
>
>
> So... some new projects I would like to complete. Thought you might be
> interested.

Thanks Scott!

Toby


More information about the Melbourne-pm mailing list