matsmcfly
Posts: 3
Joined: Mon Apr 16, 2012 2:08 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Mon Apr 16, 2012 3:13 pm

Hi guys,  I am looking to try and learn a useful programming language of some sort for work purposes (running calculations and the like).  When looking for helpful information on the net, thats when I read about the raspberry pi and I am very interested in the product and the concept.

My question is do you think the pi would be a good way of me getting into programming and learning a useful language?  Also, is there a programming language that is better suited to writing programs for calculations and is there scope that the pi could run the required software etc.

Cheers in advance

cjdelphi
Posts: 19
Joined: Mon Apr 16, 2012 12:03 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Mon Apr 16, 2012 3:22 pm

I'm curious, programming by nature is simply a step of instructions, eg when you buy furniture that comes in a flat box, you have all the instructions to build it, all you need to do is follow those instructions to make that table, chair, cabinet..

well computers unlike humans not only follow those instructions but will do so perfectly everytime, you want to learn how to program, you can, you don't "need" anything the mere fact you were able to post to this website means you have a computer with a browser chances are you could install a compiler right now even if you posted from your mobile phone.. it's not crazy it's been done.

just use a search engine, look at a variety of languages, C, Pascal, BASIC, Assembly, shrugs... Fortran, Cobol, ... just stick with C or BASIC to begin with, you'll soon find out if you want to look at something else...  there's plenty plenty of options for any desktop computer / laptop even phone, not even mentioned Java or .NET yet..

when you find a language you like learn it, you'll be able to apply your new found skills to any microprocessor that has a compiler that supports your language of choice and for that reason alone, you can't go too far wrong with plain old C... and work on up until you find something that suits you...

while you learn, you can wait for your rasberry pi to arrive lol

matsmcfly
Posts: 3
Joined: Mon Apr 16, 2012 2:08 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Mon Apr 16, 2012 3:30 pm

Cheers for that reply.

I guess I am big kid at heart and just like the idea of using learning a language as an excuse to buy a board when it arrives lol.

I have played around with fortran in the past so am somewhat familiar with it.  I suppose I am seeking advice from people that know several languages and can recommend what they would choose to use for number crunching rather than me having a go a several and finding out months down the line that there are more efficient and 'user friendly' (note I use this term loosely :p ).

Currently, my plan would be to plug away with FORTRAN and/or some C++ for no other reason than I have a few books laying around on the languages.

Cheers again for your reply

rmm200
Posts: 259
Joined: Sat Mar 03, 2012 10:25 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Mon Apr 16, 2012 3:47 pm

Pi was designed as an educational tool. It will be as good as any laptop for learning any non-windows specific languages. Just have internet access available; there is a lot you will want to download.

cjdelphi
Posts: 19
Joined: Mon Apr 16, 2012 12:03 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Mon Apr 16, 2012 4:09 pm

then sure... buy one but you're still going to have to compile your code be on Linux or Windows or anything else ...

I'll be honest if it's mainly math, pick any language you want they're all surprisingly similar, eg in C, (n = 10) n = n +1;  in pascal it's n:=n+1; in BASIC n = n + 1 (i think, been years since i touched BASIC).. assembly... add n,1;  you should look at a few bits of code from any language that takes your fancy, if it turns out it's supported on a Rpi ie you can compile and run your programs... language means little for math .

p.s BASIC is an acronym, Beginners All Purpose Symbolic Instruction Code..

it does not mean the language is "basic" no wonder it got such a bad reputation lol, i wonder how much support for scripted languages, interpreted, i'll find out tomorrow

User avatar
[email protected]
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Mon Apr 16, 2012 5:03 pm

matsmcfly said:


Hi guys,  I am looking to try and learn a useful programming language of some sort for work purposes (running calculations and the like).  When looking for helpful information on the net, thats when I read about the raspberry pi and I am very interested in the product and the concept.

My question is do you think the pi would be a good way of me getting into programming and learning a useful language?  Also, is there a programming language that is better suited to writing programs for calculations and is there scope that the pi could run the required software etc.


I'd be wondering if what you need to run calculations is a ... calculator... Possibly a spreadsheet calculator, which I'm sure you have in the guise of MS Office/Excel or Libreoffice/Calc...

Or for calculations of a more scientific nature then there's other packages such as mathlab, or for stats, "R", and so on.

But if you want to write your own programs, then you just need a platform that your comfortable with. Do you have  a PC running windows or Linux already? If-so, then you can start right away. FORTRAN is the "classic" scientific/engineering language for heavy duty maths (it can handle complex numbers) but there are many others. It all depends on your needs.. If I was doing number crunding involving complex numbers then I'd look at FORTRAN myself (probably), otherwise C (not c++) but only as I've been programming in C for 30 years...

Gordon
--
Gordons projects: https://projects.drogon.net/

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Mon Apr 16, 2012 5:58 pm

If you"re wanting to do serious math, you might want to look at http://www.gnu.org/software/octave/ - it"s the free "equivalent" of matlab. I haven"t used it much myself, and I"m not sure about stability on ARM, but might be worth a try.

Simon

spurious
Posts: 343
Joined: Mon Nov 21, 2011 9:29 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Mon Apr 16, 2012 6:21 pm

simple answer to your question. yes

what sort of calculations are you wanting to make?

Purely out of curiosity  :)

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Mon Apr 16, 2012 9:22 pm

This book may be especially relevant to you:

Python for Informatics

It starts at the real beginner level and works up to data analysis.

It depends what your computational needs are. If you want to crunch some numbers, then Python would do the job as well as any others that have been mentioned. If you want to crunch a huge amount of numbers, then concentrate on compiled languages and forget the RaspPi; it's slow. (Not that slow, but a 2GHz quad-core is probably ten times faster.)

Nr90
Posts: 216
Joined: Sat Nov 26, 2011 12:39 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Mon Apr 16, 2012 11:02 pm

I have used octave for the stanford machine learning online class. Worked like a charm. It"s very similar to Matlab (which I use at my university).
If the goal is pure math things I"d go with Matlab, Octave or R. They have very extensive libraries build for math and are fast enough for many applications.

Of course C and others can do most things that the above can do, however because they are more general purpose they are a bit harder to use IMO.

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Mon Apr 16, 2012 11:22 pm

If you already have access to a computer, you don't need an extra one just to learn programming. Just install whatever programming tools you need on the one you already have. If you really want to segregate things, you can install a free VM and run your programming tools inside of it.

If you don't have access to a computer, the Pi will be an OK choice at some point in the future. Carefully look at total costs though, you can probably get used PCs/laptops on ebay for less once you tally in the cost for a screen, storage... and laptops will let you run pretty much any OS and tools, right now.

Eros
Posts: 26
Joined: Tue Feb 28, 2012 5:16 am

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Tue Apr 17, 2012 2:37 am

You could also get the ROOT analysis framework http://root.cern.ch/drupal/ Not sure if it compiles out of the box on ARM, but i guess it should. (Id try 5v28 if any, seems to be one iv had the most general success with on mac and linux)

Just a bunch of libraries that allow you to do things like, plotting, analysis, fitting etc to datasets either via compiled C/C++ code or using its included C interpreter (which is dirty and nasty) but still is useful sometimes for playing with code.

matsmcfly
Posts: 3
Joined: Mon Apr 16, 2012 2:08 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Tue Apr 17, 2012 9:11 am

WOW thanks for the plentiful replies.

For those interested I would mostly (at this moment in time) be using the program(s) to run complex numerical intergrations, I would also be keen on writing code for analysis of ascii output files.  I am a PhD student studying crystal nucleation and when it comes to getting a handle on values of certain factors it is an absolute nightmare number crunching these manually.

OK so the general consensus is to knock the pi on the head (for now ) and concentrate on learning a language first.  The language in question being one of FORTRAN, BASIC, Python or C?

Thanks again folks

Chris.Rowland
Posts: 239
Joined: Thu Jan 12, 2012 5:45 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Tue Apr 17, 2012 9:35 am

If you are doing complex numerical computation then you will almost certainly need more processing power than the Pi can deliver - and that probably means some sort of personal computer. They deliver a lot of performance very cheaply.

I think that when learning something new it's best to minimise the amount of newness so stick to a system that's as familiar as possible. If you're used to Windows use that, if Linux that and so on.

I can't speak for Linux or Mac but on a Windows system you might consider C#.  The development environment is good and there's a free version.

Whatever you use, get some experience using the language before doing anything that matters.

mdewey
Posts: 37
Joined: Wed Dec 07, 2011 10:47 am
Location: UK

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Tue Apr 17, 2012 12:26 pm

matsmcfly said:


For those interested I would mostly (at this moment in time) be using the program(s) to run complex numerical intergrations, I would also be keen on writing code for analysis of ascii output files.  I am a PhD student studying crystal nucleation and when it comes to getting a handle on values of certain factors it is an absolute nightmare number crunching these manually.


In that case would it not be sensible to choose a language which other people in your lab use so you can get local support in the early stages?

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Worthwhile me buying a pi? Want to learn a language for running calculations ...

Tue Apr 17, 2012 12:35 pm

Please note that the RPi is not suitable for heavy calculations. As a guideline, have a look at http://www.bit-tech.net/hardwa.....i-review/4

On this page you will see the time needed to calculate a series of prime numbers. A standard 2-core PC is about 150 times faster than the RPi.

Return to “General discussion”