There's a new language coming! This language is sure to be a favorite of scientists and mathematicians. We've all noticed that mathematical programming has always been difficult in traditional languages that require us to use odd syntax that doesn't exact
For many developers today, THE computer languages are few: Java, some derivative of C (C++ or C#), or a flavour of Visual Basic. For others, scripting languages like Python, Perl and Ruby rule. But when the minicomputer was king, Fortran was often the language of choice. Fortran (FORmula TRANslation) was designed to handle mathematical and scientific tasks, but later grew into more general-purpose work as compilers appeared for business systems and inventive programmers got their hands on the language.
Of course, when the personal computer took over, Fortran didn't keep up. Although a belated .NET implementation ultimately surfaced, while Fortran publishers fiddled, other languages snatched dominance away from it, and Fortran quietly slipped into the world of niche products.
ADVERTISEMENT
The need for mathematical and scientific calculations hasn't gone away, however. Think about functions like weather modeling, protein synthesis, orbital calculations, or even the search for extraterrestrial life--all of these rely on heavy-duty calculations that can be a beast to program in other languages. That's why researchers at Sun Microsystems have been working on a new language that is explicitly optimized for mathematics and high performance computing (HPC). And it's now an open source project; you can play too!
That language is called Fortress.
Fortress is one of three languages developed as part of the DARPA High Productivity Computer Systems (HPCS) program. (The other two, if you're curious, are Cray's Chapel and IBM's X10). The goal of Fortress is a new generation of high performance computing for use by government and industry and, in the words of its mission statement, to "Fill the high end computing gap between today's late 80's based technology High Performance Computing (HPCs) and the promise of quantum computing. "
But the language isn't just about high performance; it's about high productivity. Not only should a language with such goals help the computer be able to churn out answers quickly, it should be easy enough to program to get from initial problem to solution at a brisk pace, powerful enough to provide necessary functionality, and smart enough to get there with a minimum of errors.
Although Fortress is being positioned as a general-purpose computing language, lead author Guy Steele (who also co-wrote the Java specification) has been quoted as saying he doesn't think any one language can serve everyone's needs, because their needs are so diverse. The needs addressed in Fortress are those of high performance computing, with its massive parallelism and huge memory requirements. In fact, a number of core constructs, such as for loops, are parallel by default.
Fortress targets programmers who work in mathematical realms. It uses Unicode characters and math notation as part of its syntax, even allowing the same 2D notations mathematicians would scribble on their chalkboards (like the figure to the right), to make it easier for scientists and mathematicians to get up to speed, without necessarily echoing the syntax of legacy languages.
Two basic concepts are those of object and trait. An object consists of fields and methods, and traits (a concept introduced in the Self programming language {{need link to Self language}}) are named program constructs that declare sets of methods.
object SolarSystem extends { StarSystem,OrbitingObject }
sun = Sol
planets = {Mercury, Venus, Earth, Mars, Jupiter,
Saturn, Uranus, Neptune, Pluto }
position = Polar(25000 lightYears, 0 radians)
ω :R64AngularVelocity = 2π radians / 226million years in seconds
variation(ωΔ) =
ω += ωΔ
end
In the above code, the object SolarSystem extends the traits StarSystem and OrbitingObject, the object Sol is defined by the field sun, and the field planets is defined as a set of objects.
As in mathematical notation, multiplication can be expressed by juxtaposing multiplier and multiplicand, as we see above, along with actual symbols (2π, rather than 2 *pi as it would have appeared in other languages), and types don't necessarily have to be specified for all fields, method parameters and return values, but are inferred where possible. This was a deliberate decision to remove complexity and to allow scientists to write Fortress programs that preserve the look of mathematical notation.
Fortress programs can be run either as scripts or as compiled files. If we step back a bit, here's what our old friend "Hello World" would look like in a Fortress script:
You would put this code in a file with the extension .fsx, and run it by issuing the following command to the shell:
Fortress script filename.fsx
A compiled file would have the extension .fss, and its source code would look like this, for example:
Component HelloWorld
Export Executable
run(args) = print "Hello, world!"
end
Components are compiled and stored in a persistent database called a fortress, which holds all components for one user, or a group of users who share programs and libraries.
Fortress is still very much a work in progress, however. Its designers presented a demo of parallel Fortress programs at Sun Open House last year, and have published proofs of the soundness of some core components. The reference implementation is still only an interpreter running on the Java Virtual Machine (a compiler is sometime in the future); designers are looking for feedback from HPC programmers in all sectors. There is, in other words, a long way to go before Fortress emerges as a full-blown language. It's an ideal time to get involved if you want to watch the birth of a new language.
You will find a link to a download of the latest version of the Open Source reference implementation of Fortress, as well as licensing information, at: http://fortress.sunsource.net/. It requires Java 1.5 or better to run, and Ant 1.6.5 or better to build. You can also join a mailing list so you can follow the evolution of the language, or even join the project) and be on hand for the building of a shiny new programming language.