PDA

View Full Version : Choosing a Programming Language



max1e6
November 7th, 2007, 01:29 AM
I have a multiprocessor system (4-AMD Opteron Processors) and I am considering the Ubuntu 64 OS. With this OS I will need a compiler (i.e. an interpreted language will not do) preferably C++, C# or Fortran 90. If possible a “Visual Type” GUI would also be nice.

But most of all I need to be able to fully utilize all the processors in this system through both auto-parallel processing and controlled affinity. I see Intel has a couple of products which may fit the bill. Are there others? What about this Mono C# item?

Can anyone share their experience, strength and hope with me?

slavik
November 7th, 2007, 01:43 AM
learn pthreads and learn it well. :)

NotTheMessiah
November 7th, 2007, 01:46 AM
'Visual' is coming for MONO

http://www.mono-project.com/VisualBasic.NET_support

bruce89
November 7th, 2007, 02:16 AM
'Visual' is coming for MONO

http://www.mono-project.com/VisualBasic.NET_support

Dear God no.

C or something similar would make sense here, C# is sort of interpreted.

NotTheMessiah
November 7th, 2007, 06:20 AM
Dear God no.

C or something similar would make sense here, C# is sort of interpreted.

C# is from the C-C++ family tree and visual basic is from the Basic language tree

AlexThomson_NZ
November 7th, 2007, 08:46 AM
Learn C/C++ with pthreads- scales to use all CPUs automatically. Quite easy to learn the basics too (I learnt using just web tutorials)

Glade is a good tool for GUI design, using libglade makes it easy to connect the GUI to the code. Not quite 'visual' level of ease, but quite elegant once you get used to it.

pmasiar
November 7th, 2007, 02:06 PM
You may want to check threads about C# and Mono for last month for discussion about why not C#. I don't care to repeat it again here.

Care to explain why you need the speed so desperately? Many professionals realized recently that with mixing Python and C, they can have both: Python for rapid app development, and reimplamenting bottleneck code in C gives them almost all the speed, but for the fraction of the cost.

max1e6
November 7th, 2007, 04:20 PM
First of all, thanks everyone. I think I'll probably go ahead and try the Intel C++ or Fortran. I have seen where some people here have had install problems but it seems they have also worked those problems out.
The system is dedicated to matrix computations, wavelet transforms, Fourier transforms, etc. My interest in Linux is to explore computational efficiency vs. that with the Windows overhead.

ankursethi
November 7th, 2007, 06:24 PM
So you want :
1. Multi threading support.
2. Mathematical tools.
3. Efficiency.

There's a perfect fit for you. The language is called Haskell. It's very close to math, since it's a functional language and is influenced heavily by lambda calculus. It can either be interpreted, or compiled. Functional languages have always been better at multi threading than imperative languages.

There's a very comprehensive Wikibook on Haskell at http://en.wikibooks.org
Official website : http://www.haskell.org

The Grand Glasgow Haskell Compiler (GHC) is available in the Ubuntu repositories. When compiled to native code, the speed of Haskell code is comparable to code generated by GCC/G++.

If Haskell doesn't suit you, you might try other functional languages such as Lisp (I don't see it being used much), Scheme (widely used in teaching) or O'Caml (I think it's speed is comparable to Haskell).

Practical Common Lisp and Practical O'Caml are extremely nice books to begin with these two languages. Practical Common Lisp is freely available, too. You will find many Scheme resources from various CS departments.

Functional programming is a bit harder to wrap your head around, but it's worth the time.

AlexThomson_NZ
November 7th, 2007, 07:31 PM
I haven't done any Haskell since uni, but how's the GUI support on Gnome/Linux? is there much of an active community out there to turn for help?

bruce89
November 7th, 2007, 09:34 PM
I haven't done any Haskell since uni, but how's the GUI support on Gnome/Linux?

Gtk2HS -- http://haskell.org/gtk2hs/

AlexThomson_NZ
November 8th, 2007, 03:24 AM
Nice- glade supported too. Could be a plan...

YetAnotherNoob
November 8th, 2007, 03:58 AM
I cannot beleive ppl are considering fortran.

synss
November 8th, 2007, 10:50 AM
I would also recommend against Fortran...

I am using C++ myself. Python is also worth it, would it only to get the design half-right. And now I regret not having maintained my initial idea, which has been exposed above, and which was to program in python and reimplement the bottlenecks in C.

I do not know haskel and the like, though.

C++ is relatively nice with boost for containers of pointers, when appropriate.

LaRoza
November 8th, 2007, 02:11 PM
Fortran is a nice language, and powerful. I don't know why the posters are recommending against it. The newer versions of Fortran, Fortran 90/95, 2003 are quite different from Fortran 77. I still use Fortran 77, and am not familiar with the new versions yet.

pmasiar
November 8th, 2007, 02:43 PM
As OP said, squeezing the most from CPU cycles is the must.

I never used more modern versions (the most 'modern' was RATFOR for RSX/11 :-) ) but traditionally FORTRAN is very good in number-crunching tasks, and has all libraries under the sun for it, so it is worth considering too.

AlexThomson_NZ
November 9th, 2007, 03:09 AM
My interest in Linux is to explore computational efficiency vs. that with the Windows overhead.

In that case maybe Java is worth looking into- obviously a huge library out there, scales per CPU, good IDE & GUI tools, good community, and can run directly on Windows/Linux with no changes.

samjh
November 9th, 2007, 08:42 AM
I have a multiprocessor system (4-AMD Opteron Processors) and I am considering the Ubuntu 64 OS. With this OS I will need a compiler (i.e. an interpreted language will not do) preferably C++, C# or Fortran 90. If possible a “Visual Type” GUI would also be nice.

But most of all I need to be able to fully utilize all the processors in this system through both auto-parallel processing and controlled affinity.

You do not want to use C#. C# is compiled to byte-code and is executed within a virtual machine.


In that case maybe Java is worth looking into- obviously a huge library out there, scales per CPU, good IDE & GUI tools, good community, and can run directly on Windows/Linux with no changes.Negative on that also.

All virtual machine languages have implementation quirks on each platform.

If computational efficiency is what the OP wants to investigate, then he needs to eliminate as many unknown or uncontrollable factors as possible, and these include implementation differences among virtual machines targeted at different operating systems.



But most of all I need to be able to fully utilize all the processors in this system through both auto-parallel processing and controlled affinity. Keep it simple.

Use C. It's relatively low-level compared to most high-level languages, so you can eliminate a lot of uncontrollable factors such as runtime overheads.

For Linux, you can use C with pthreads (POSIX threads).

For Windows, you can use native Win32 threads if you want to examine the efficiency of Windows native threading, or use pthreads if you want to try for a reasonably level playing field (although the field will not be perfectly level!) between your Linux and Windows benchmarks.