Java and other high level languages for computational science

Click For Summary

Discussion Overview

The discussion revolves around the suitability of high-level programming languages, particularly Java and D, for computational science and numerical computing. Participants explore the relevance of low-level programming knowledge, the performance of Java in high-performance computing (HPC), and the potential role of other languages like Python in this field.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Exploratory

Main Points Raised

  • One participant expresses a preference for Java over Fortran and C, questioning whether computational scientists still need to focus on low-level programming aspects like hardware targeting and assembly code.
  • Another participant notes that the importance of understanding cache and throughput varies depending on the specific area of computational science, suggesting that some fields may prioritize performance over high-level language usability.
  • Several participants advocate for Python as a viable alternative, highlighting its advantages in HPC and suggesting it could be used alongside C/C++ for performance-critical tasks.
  • Concerns are raised about Java's performance in HPC, with one participant referencing the IBM paper that critiques Java's suitability and suggesting that a deep understanding of its runtime is necessary for optimal performance.
  • Another participant reflects on the benefits of Java, such as ease of learning and availability of libraries, while questioning whether its limitations for numerical computing can be addressed without losing its advantages.
  • The D programming language is mentioned as a potentially better alternative to Java, with features that may address some of the criticisms raised about Java in the context of numerical computing.

Areas of Agreement / Disagreement

Participants express a range of opinions on the use of Java in computational science, with some advocating for its use while others argue against it in favor of languages like C++ and Python. There is no consensus on the overall suitability of Java or the necessity of low-level programming knowledge, indicating ongoing debate and differing perspectives.

Contextual Notes

Participants highlight the importance of understanding underlying hardware and performance considerations, but the extent to which this knowledge is necessary remains debated. The discussion also reflects varying opinions on the relevance of specific programming languages in different computational science domains.

Starbug
Messages
17
Reaction score
0
Hi,

I'm interested in pursuing a career in computational science and numerical computing and so on. I'm looking for some fairly general advice on how to direct my studies. I started learning programming in java, which I very much prefer to program in these days, having had some exposure to Fortran (yuck) and C (yuckety yuck yuck).

You would expect that as compilers and hardware gets better that managed and high-level languages will become more viable for high-performance codes. But my question would be, as it stands now do computational scientists still have to worry about low-level matters. Are programs still targeted at specific hardware, do I need to be learning about caches and assembly code and so on.

Googling about on the question of Java's viability is a bit tricky. Everyone wants to remind you that there are lies, damn lies and benchmarks, you can get buried under language flame wars and a lot of information might be out of date. For example I came across this quite interesting article written by a group called the Java Grande forum:

http://www.research.ibm.com/journal/sj/391/moreira.html

This outlines a number of reasons for Java's unsuitability for HPC. Are these criticisms still relevant?

Another question would be whether people see java having a more prominent role when 'grid computing' starts to take off?

Also, I'd like to know what people think of the D programming language. Info here:

http://www.digitalmars.com/d/overview.html

At first reading I like the design and philosophy very much. And I wonder if it is a better solution to the dilemma the java grande forum people are trying to solve.
 
Technology news on Phys.org
depends on the computational science that you are looking to do...
puremath eg. cryptology
or numerical
or Nbody
or mesh-based

comprehension of cache is important as my supervisor and profs have put it a lot of it is throughput. They mock people who talk about MATLAB or java.

but we use java as a frontend gui. Assembly is usulaly good to know but you really don't need to if you know C/F..thouggh one of my profs say its always good to be able to understand assembly to see if the compiler is optimizing properly.
 
I strongly, strongly, strongly second Python.

- Warren
 
Java doesn't seem to be used much in physics/astrophysics HPC. I suspect Java does not have much to offer that C++ or the newer Fortran flavors don't have already. The thinking may be, with a lot of existing code already written in those languages, why use Java?

Reading the IBM paper you linked to, it sounds like you need to have a detailed understanding of the Java runtime implementation to get performance that's even in the ballpark. That defeats the point of a managed language, doesn't it? Maybe that's changed since the paper was written.

I like Python in the driver's seat, with extension modules for performance critical kernels written in C/C++/Fij.

If you're going to run on machines where performance matters, you should have some notion of the underlying architectures (cache, memory bandwidth, etc). If you're only writing for yourself to run on your own machines, by all means do whatever you like and someone is willing to pay for.

Why not learn a bit of assembler? Not to write much, mostly just to be able to read what the compiler emits (to check performance, but also to check correctness and to access hardware features unsupported in the language). Also, to have a sense of how a computer really works, something missing from high level languages.
 
nmtim said:
Java doesn't seem to be used much in physics/astrophysics HPC. I suspect Java does not have much to offer that C++ or the newer Fortran flavors don't have already. The thinking may be, with a lot of existing code already written in those languages, why use Java?

Reading the IBM paper you linked to, it sounds like you need to have a detailed understanding of the Java runtime implementation to get performance that's even in the ballpark. That defeats the point of a managed language, doesn't it? Maybe that's changed since the paper was written.

I suppose there is some sense reading that paper of it being a slightly artificial attempt to get a language to do something it wasn't designed for. I'm not so sure though. They point out the benefits of Java, i.e that it's simpler for new programmers to learn, that it has a centralised source of portable libraries and documentation, that it revises some of the design kludges in C++ etc. (Java is taught as a first language for physicists at my university I think for just these reasons.) They also seem to argue that many of the tings that crippple java for numerical computing could be fixed without compromising the benefits, although I don't know if this is ever going to happen or whether it has happened. (This was why I was also interested in D, since it has a very java like design, but has things like intrinsic complex numbers, lightweight objects and is natively compiled.)


Thanks for the python links btw. I will look into it.
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 102 ·
4
Replies
102
Views
3K
Replies
21
Views
13K
  • · Replies 33 ·
2
Replies
33
Views
8K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 80 ·
3
Replies
80
Views
17K