Programming languages

serengeti
serengeti
Joined: 7 Dec 06
Posts: 9
Credit: 6,316
RAC: 0
Topic 192376

What programming language is the number crunching program written in? If I am considering studying astronomy in college, would you recommend that I learn that or other programming languages? It seems most astronomers need to write some kind of programs for data processing or simulations of events, is that true? Thanks!

Annika
Annika
Joined: 8 Aug 06
Posts: 720
Credit: 494,410
RAC: 0

Programming languages

Well I'm not 100% sure about Einstein, but the CPDN app, for example, is written in FORTRAN... would be "classic" for scientific purposes I think.

tullio
tullio
Joined: 22 Jan 05
Posts: 2,118
Credit: 61,407,735
RAC: 0

FORTRAN is an old language,

FORTRAN is an old language, with many programs written using it. I would choose C and C++.
Tullio

Pooh Bear 27
Pooh Bear 27
Joined: 20 Mar 05
Posts: 1,376
Credit: 20,312,671
RAC: 0

SETI is open source, so you

SETI is open source, so you could look at what their's is written in.

Other projects that are not open source would have to tell you. I do not think Einstein ever stated what it is written in.

testr2
testr2
Joined: 18 Jan 05
Posts: 13
Credit: 653,354
RAC: 0

RE: What programming

Quote:
What programming language is the number crunching program written in? If I am considering studying astronomy in college, would you recommend that I learn that or other programming languages? It seems most astronomers need to write some kind of programs for data processing or simulations of events, is that true? Thanks!

C, C++, and Java are all good choices. I agree with whoever said Fortran is a little long in the tooth (I learned it in 1967). You might not write an application in C today either(I learned it in 1976) but it is still used for low level interface work and astronomers still have to do that these days.

The main thing is to learn one good programming lang and the rest will be easy. I am ignoring Visual Basic (VB) since to my knowledge it is not heavily used in scientific work and some people do not think it is a good general purpose lang.

serengeti
serengeti
Joined: 7 Dec 06
Posts: 9
Credit: 6,316
RAC: 0

So, Java is a good

Message 60294 in response to message 60293

So, Java is a good programming language? If I learned Java really well it would be useful and anything else I needed would be easy to adapt to?
Thank you all for your comments!

Odysseus
Odysseus
Joined: 17 Dec 05
Posts: 372
Credit: 20,352,095
RAC: 7,086

RE: […] I agree with

Message 60295 in response to message 60293

Quote:
[…] I agree with whoever said Fortran is a little long in the tooth (I learned it in 1967). […]


The one computer-science course I took in university was on Fortran; that was around 1980. (A horrible course: there were only about 30 terminals for 150 students, and we had to go to another building to get printouts of our assignments’ output. On finding a bug we had to go back to the lab and line up again to get on a terminal for another session … and there was always someone literally breathing down our necks while we worked.)

The only programming language in which I remain ‘fluent’ is PostScript—but while it’s still commonly used for scientific graphics as well as other kinds, these days the code is usually machine-generated (e.g. by “dvi2ps� in a TeX installation).

DanNeely
DanNeely
Joined: 4 Sep 05
Posts: 1,364
Credit: 3,562,358,667
RAC: 0

The einstien app is C++, with

The einstien app is C++, with handcoded assembler in the hot loops.

Java's not a bad langauge, but not a good choice for highend scientific computing. The costs of compiling into intermediate code during development and only being converted into machine code at runtime (you can do much more agressive compiler optimizing if you do it all at once since you're not limited timewise), and of using a garbage collection engine mean that niether Java, .Net, or any of thier successors are ever likely to be able to get faster raw performance than C++.

The advantage they provide is much faster development rates which for thier normal uses (web pages and intranet apps) make the labor savings more than pay for additional server resources. The economics change when 10% slower translates to needing an extra 10,000PCs instead of just 1 or 2.

Dagorath
Dagorath
Joined: 22 Apr 06
Posts: 146
Credit: 226,423
RAC: 0

RE: So, Java is a good

Message 60297 in response to message 60294

Quote:
So, Java is a good programming language? If I learned Java really well it would be useful and anything else I needed would be easy to adapt to?
Thank you all for your comments!

Java is a good programming language for certain tasks, as DanNeely says. You may need to program those kinds of tasks as an astronomer but not very likely. You would more likely be programming to crunch numbers or other tasks where you need speed and low level memory access. Learn C, C++ and assembly language. You may never actually use assembly but learning it will give you valuable insight into the hardware.

Assembly on i386 and i586 can be a bit daunting but there are far simpler processors, the 8051 family, for example. You can learn 8051 at home with free assemblers, a breadboard, a few transistors, resistors and LEDs. You can build a chip programmer or buy one. Take a look at Iguana Labs if you're interested in that sort of thing.

serengeti
serengeti
Joined: 7 Dec 06
Posts: 9
Credit: 6,316
RAC: 0

RE: Learn C, C++ and

Message 60299 in response to message 60297

Quote:

Learn C, C++ and assembly language. You may never actually use assembly but learning it will give you valuable insight into the hardware.

Assembly on i386 and i586 can be a bit daunting but there are far simpler processors, the 8051 family, for example. You can learn 8051 at home with free assemblers, a breadboard, a few transistors, resistors and LEDs. You can build a chip programmer or buy one. Take a look at Iguana Labs if you're interested in that sort of thing.

Here's a foolish question: Do you mean computer assembly?

Annika
Annika
Joined: 8 Aug 06
Posts: 720
Credit: 494,410
RAC: 0

Assembler language ;-) which

Assembler language ;-) which is a bit closer to the hardware than other programming languages. You don't have many different commands but it's normally very efficient in how it uses the hardware.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.