Fortress: The Successor to Fortran?
An anonymous reader writes "A draft specification of the Fortress language was recently released. Developed by Sun Microsystems as part of a DARPA-funded supercomputing initiative, Fortress is intended to be a successor to Fortran. Guy Steele, a co-author of Java and member of the Fortress development team, hopes that Fortress will to 'do for Fortran what Java did for C.' Steele admits that Java isn't probably the best choice for numerical computing, and that 'it's a mistake to try to make a programming language that is all things to all people... because the needs are so diverse.' Fortress has a number of interesting features, including support for Unicode characters in code, enabling code to look more like formal mathematical expressions. More information about Fortress is given in interview with Steele, and in a talk by Steele. There's also some interesting commentary on Fortress, including some commentary by a member of the Fortress development team, in response to two stories at the programming languages weblog Lambda the Ultimate."
Fortress development team, hopes that Fortress will to 'do for Fortran what Java did for C.' Steele admits that Java isn't probably the best choice for numerical computing
So they finally admit that what Java did was break the IEEE floating-point specification, that was correct in C, as Professor William Kahan, of Berkeley (see How JAVA's Floating-Point Hurts Everyone Everywhere), had been shouting to deaf ears all this time?
Main difference between the BSD license and the GPL license: one is from California and the other is from Massachusetts
I've worked on several mathematical and scientific projects, from high performance libraries to manipulate geometry (applications to CAD/CAM/graphics/etc.) to analysing results from metrology hardware. To date, I've never seen a serious project where the programmers use Matlab; writing custom code in any number of serious programming languages is a better option (mostly because there is more to almost any program than maths, even a mathematical one).
Tools like Matlab are great for working scientists who need to get the job done by don't have access to real programming. For those who do, the latter appears to be a much more popular choice.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
From the FORTRAN FAQ (http://www.faqs.org/faqs/fortran-faq/) :
FORTRAN and C have different semantics. A FORTRAN optimizer knows more about aliasing, function interactions, and I/O. A C optimizer has to infer or compute such information. C bigots typically have neither written such optimizers nor worked with folks who do it for a living, and are prone to dismiss such arguments as being petty and neolithic. FORTRAN programmers are often a bit more in touch with high performance computing, and are unwilling to bet that heavily on compiler wizardry.
There is a vast body of existing FORTRAN code (much of which is publically available and of high quality). Numerical codes are particularly difficult to "vet", scientific establishments usually do not have large otherwise idle programming staffs, etc. so massive recoding into any new language is typically resisted quite strongly.
Fortran tends to meet some of the needs of scientists better. Most notably, it has built in support for: - variable dimension array arguments in subroutines - a compiler-supported infix exponentiation operator which is generic with respect to both precision and type, *and* which is generally handled very efficiently or the commonly occuring special case floating-point**small-integer - complex arithmetic - generic-precision intrinsic functions
I thought Mathematica was the successor to Fortran.
Mathematica is (hopefully) mostly used for symbolic computations. In numeric computing, MATLAB and its extensions is quite popular (maybe even GNU Octave for those who rightly fear that proprietary software undermines freedom of research). I have no idea why the folks at Sun think that Fortran is their competitor. Maybe MATLAB suffers from a stigma similar to Visual Basic. Certainly someone inside Sun knows that their HPC customers frequently run MATLAB programs on Sun hardware.
Why don't they just improve the Mathematica calc engine for parallel/distributed supercomputing?
Why would they want to improve the product of a competitor on a government grant? Sounds like a stupid plan to me from a business perspective.
Anyway, language design suitable for numeric computing is not Sun's strength.
No, I'm afraid it's worse than that.
They use a series of identifiers separated by spaces to represent either function calls or multiplication, depending on context. The dependence is relatively subtle, too: uses of () for function calls seem to depend on how many parameters the function takes, for example...
Unlike the April Fool proposal for C++, this is actually, serious BTW.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Having loops be parallel by default, on the other hand, is going to explode a lot of heads. Can you imagine what it will be like to write a loop which doesn't depend on the effects of any previous iteration?
Granted, this has existed in various supercomputing languages and VLIW/vector processing assembly since the 80s, but trying to push this out to the masses is pretty revolutionary. A lot of people are going to see it as a serious drawback, and either shy away from Fortress or ask for sequential loops explicitly everywhere, unless they can be taught how to parallelize, which is often a very difficult task for all but the simplest loop side-effects. Sometime's it's just hard, and sometimes it's NP-hard, depending on the details of the algorithm considered for parallelization.
Frankly, given that functional style is much less of a stretch from ordinary procedural programming, and given how slowly ML variants and things like Haskell have been catching on, I guess Fortess is destined for permanent niche status, and not even math typography will save it from consignment to the high-preist class of supercomuter programmers. In fact, that may be a disadvantage, because the scientists writing the formulae aren't the engineers translating those formulae for parallel processing, in most cases.
I would say that you're totaly wrong. Most of the CPU hours I see are good ol fortran. I see some requests for matlab runs, but it's dificult to parallelize, so it ends up being used for small projects, or quick tests of stuff. The bulk of the actual CPU hours is in C/C++/Fortran.
I don't think I want to learn this language...
Given the phenomenal number of weird bugs that both C and Fortran developers produce because of the nature of those languages and their lack of memory management and safety, I'm sure a large number of Fortran developers would be very interested, even if you aren't.
One is support for multiple return values, which I love.
...
:)
:P
Have you seen the new tuple library being added to C++? See here. GCC 4.0 already supports them. At first I was reading through and wasn't that impressed, but then I saw things like:
#include <tr1/tuple>
#include <tr1/functional>
using namespace std::tr1;
tuple<int,char,double> doStuff();
{
int a; char b;
tie(a,b,ignore)=doStuff();
}
Yes, the above works. And with inlining or the named return value optimization, it doesn't slow down your program. And it shuts up those people who don't like returning data in references
I was reading through the list of things already in the first library addition and got pretty excited. see here. Already added are reference-counted smart pointers (much more impressive than the usual), regexp, standarized hash tables, a new parameter binder, additional support for template metaprogramming and a few other things.
In the pipeline for TR2 are lambda functions (see Boost.lamba, say: Function F= _1*_2) and a lot of other fun stuff.
Heh. And Java is barely on templates
Safety?
My ass, try ADA for that one
If Java was truly "designed for safety at the start", you just wouldn't need that kind of project
Sorry, that is false. that is a bug-finding tool, not a safety checker. Similar bug-finders are required for Ada, although they work with source code.
Java includes major safety features (like the SecurityManager) that Ada doesn't. Ada is relatively safe because it is a Pascal-like language with features, such as bounds checking and very strong type safety, that C etc. lack. Java has such bounds-checking features, but goes further than Ada, as it does not require manual memory management.
It is also an open standard with MANY compilers for most platforms. Will Sun work on all of this? They didn't think it was important enough to do with Java.
On the contrary, they thought Java was so important they have battled to retain control of the language to prevent forking of the specification.
One of the major problems with Fortran is the large range of dialects, with many incompatibilities.
(1) You give up speed for a marginal increase in features
No you don't. Recent Linpack benchmarks have shown Java can match C/C++ in terms of math performance in many benchmarks. There is no speed disadvantage for this kind of work.
(2) You give up source portability for binary portability. Almost every platform has an ansi-C compiler, yet only a handful support Java, especially if you use a recent library.
There are few platforms that now don't have Java; the statement 'only a handful' is nonsense. There are recent VMs for all major operating systems, and many minor ones. The number of platforms with GNU compilers on is enormous, which comes with GCJ.
There are more platforms that support OpenGL than Java3D, for example.
True, but I assumed we were discussing numerical language use, not games development.
(3) A company controls your language. The future of Java is at the whim of a single for-profit entity. Furthermore, this entity has displayed that it wants to control the Java language and the Java platform to the greatest extent possible.
On the contrary, almost everything about the development of Java has been handed over to the Java Community Process. Also, the VM spec and language spec are available for anyone to implement compatible languages (and many have).
Have you seen the new tuple library being added to C++?
He said: multiple return values. You said: have you seen the tuples library? Two distinct and very different things. Multiple return values means that a function can return several distinct first-class values that have nothing to do with each other. Otherwise, the function could just return a list. Hey, look, multiple return values!
The distinction helps you when you want to return distinct unrelated objects that don't really belong in the same data structure, such as an error code and a value, for example. There are a million other ways in which you can do that, but this is one of the more elegant approaches.
Multiple return values are especially useful in compiler intermediate representations, because they allow you to model certain control constructs (exceptions and continuations) explicitly. That turns out to be surprisingly useful to compiler writers.
Bush Lies Watch
"(1) It is probably the first really mainstream general-purpose widely-used language with garbage collection. "
Actually Basic was the first. It used garbage collection for strings.
"(3) It is the first mainstream language to run mostly on a VM, so you get portability not just at the source code level, but at the level of compiled programs."
Nope that would have been Pascal. At lest is was the first I had heard of. UCSD Pascal was very popular back in the late 70's early 80's It's byte code was called p-code. I think there where even some chips that ran p-code directly. An other early virtual machine was used by Infocom to run their text adventure games. If you go by number of users it was extremely popular.
See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
To those people who detest using Fortran, check out http://www.scipy.org/ .All these libraries are based on the same dependant Fortran code.
For signal,image processing and more, in a nice python syntax. Nice readable code, no learning curve!
From the website:
SciPy is an open source library of scientific tools for Python. SciPy supplements the popular Numeric module, gathering a variety of high level science and engineering modules together as a single package.
SciPy includes modules for graphics and plotting, optimization, integration, special functions, signal and image processing, genetic algorithms, ODE solvers, and others.
SciPy is developed concurrently on both Linux and Windows. It has also been compiled successfully on Sun and Mac, and should port to most other platforms where Python is available.
Java is not a language of clever tricks and obscure code, like C++ can be.
Java does have some extremely clever tricks, and I'm surprised that more beople don't use them.
The primary one I have used is reflection. You can use it to navigate class strcuctures in clever ways, search for methods by pattern matching etc.For instance, I have used this as a report generator to generate reports based upon C/C++ structures exposed to Java.
Another one is NIO byte buffers I have used this to import C++ structures into Java effieciently, without any communication with C++ code.
I hope this new language has provided some equally clever tricks for the scientific community to do their computing
True (or nearly so -- I don't know any percentages). However the vast majority of high-performance scientific computing (i.e., large numerical model, supercomputer stuff) is done in Fortran.
Based upon my experiences, within universities, ONLY in CS departments Matlab is NOT (yet ?) the de facto standard ....
CS departments don't, as a rule, do scientific computing. Science departments do. CS departments do software development/engineering, algorithms, etc. In the real (non-university) world, exactly 0% of that is in Matlab.
Primary author of Common Lisp the Language, the community-generated pre-spec for Common Lisp
The other half of Steele and Sussman, co-inventors of Scheme
Co-author of The C Programming Language by Harbison and Steele, which codified many of the techniques that made portable C code possible
As co-author of The Java Programming Language Specification, he reportedly brokered many design compromises between Bill Joy and James Gosling
Given his track record, I wouldn't bet against him if he says he's going to create a worthy successor to Fortran.
To a Lisp hacker, XML is S-expressions in drag.
Do we really, really have to go over this well-trodden ground again?
OK, here's the short version:
If you write your Java like C, restricting the functionality you use to almost entirely low-level operations on primitives, then you'll probably get comparable performance, modulo a bit of range-checking on arrays and the like. That's not surprising, and should be true in most programming languages; any language that doesn't ultimately generate basically the same machine code to execute in this case is seriously deficient in performance terms.
Now try writing anything beyond a relatively contrived and self-contained benchmark in Java -- something that uses more involved data types than built-in doubles and arrays where bounds checking can mostly be optimised away, for example -- and see how far you get.
Sorry, JIT really helps and modern Java implementations do have some pretty good optimisations, but the design of Java fundamentally means that it will only ever approach the performance of elementary C or C++ as a limit, and there will always be a certain amount of overhead at some stage in the proceedings. You simply cannot avoid this, while still having the bounds checking, still missing value types, etc.
You could encounter an exceptionally fortunate set of conditions, such that Java has a chance of outperforming C or C++ code. You'd probably need code that ran often enough with similar enough data for dynamic optimisation by the VM to make up for the overhead of monitoring run-time performance in the first place, and then to generate better performing code on that sort of data than C or C++ code run through a good optimiser/profiler combination to produce generic output. Yes, it's theoretically possible. No, I've never, ever seen it.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
The successor to Fortran, is Fortran.
Specifically, it's F77 -> F90 -> F95 -> F2K. There have been enough attempts to replace Fortran, and the only result so far is that it's kept computer scientists entertained. All of these ideas are driven by one common thread; formally trained computer scientists can't stand Fortran 77's control structures, non-dynamic memory, etc, and demand that it must be replaced for religious reasons. F90/F95 have already fixed those problems, but it's still called Fortran, and so it simply *MUST* be replaced.
Let's see, we had PL/I (a merger of Fortran, COBOL, and Algol), RATFOR, Ada, Matlab, C++, and the late, and rather lamented, Sather. None of them has the performance of Fortran, the ease of programming, the extensive and validated libraries, complex numbers as a fundamental data type, or the solidity of compilers.
It's the cockroach of computer languages; you can keep spraying, and it will keep sneakout out at night.
the more accurate the calculations became, the more the concepts tended to vanish into thin air. R. S. Mulliken
maybe even GNU Octave for those who rightly fear that proprietary software undermines freedom of research
There is also Scilab, from the French INRIA (*) (let's say it's sort of Caltech, MIT, but French - highly competent, they are - they make great croissant and cheese) and ENPC. It's Libre software (FAIF).
I've seen people use it for real research, and they thought it to be excellent. There aren't as many packages as Matlab, apparently (but this is something that depends on the number of power users, so it might change).
(*)INSTITUT NATIONAL DE RECHERCHE EN INFORMATIQUE ET EN AUTOMATIQUE
Main difference between the BSD license and the GPL license: one is from California and the other is from Massachusetts
Sun's not the only one working on a language to better support HPC (i.e. massively parallel) programming. IBM's working on a language called X10, and Cray is working on one called Chapel. All three companies are being funded by the DARPA High Productivity Computing Systems project.
Will any of these replace the dreaded MPI+(C/Fortran)? Only time will tell...
"Java is more secure than C since you can't access arbitrary addresses and Java makes array bounds checks" myth. In this case, it is important to seperate the language and the architecture on which the programs run. It is not the Java language that does these things, but rather the JVM.
That's absurd. There's dozens of languages that do that running on i386. BASIC, Ada, Java, Pascal, Fortran in some cases, they all check the bounds of arrays and prevent the use of arbitrary address in the general case. You don't check the bounds of arrays by some hardware magic; you check them by storing the array bounds with the array. C can't do that, since it's legal to pass a pointer to the middle of an array as if it were a pointer to an array.
In fact, Java is the least portable language I have ever seen. It only runs on one single architecture: The JVM.
Really. I guess gcj, the GNU Java frontend to GCC, doesn't exist then. On the flip side, you haven't been around computers much if you haven't seen languages that run on only one architecture; QBasic comes to mind.
Actually, I think we need more people to learn that programming is only a part of the job, and worrying more about doing what needs to be done and less about how l33t they are.
Personally, I think I have better things to do than chase down memory leaks. Java (for example; not my favourite language) saves me from worrying about that and allows me to concentrate on the important things.
Of course, I don't get to go wakka wakka wakka on slashdot about how cool I am because I used Duff's device in hand coded assembly because I didn't like how to the compiler optimized my code. I also don't have a manual choke in my car, do my laundry on a washboard, sparge my own malts, or still use an email bang-path from ihpn4!... anymore.