Slashdot Mirror


Sun Releases Fortran Replacement as OSS

sproketboy writes "Sun Microsystems has released an alpha version of a new programming language called Fortress to eventually replace Fortran for high performance scientific computing tasks. Fortress was designed specifically for multi-core processors and is published under the BSD license."

24 of 233 comments (clear)

  1. Re:Doesn't make a difference. by Harmonious+Botch · · Score: 4, Interesting

    Yep, programming languages advance by evolution, not intelligent design.

  2. Read the FAQ by symbolset · · Score: 4, Informative
    The FAQ gives this pdf example

    This one looks like a winner.

    --
    Help stamp out iliturcy.
  3. Re:What's it look like? by gardyloo · · Score: 3, Funny

    program Hello_world

    ### The following is the canonical 'Hello World' program implemented in fortress ###

    load fortran77
          print *,"Hello World"

    fortress.obfuscate

    end program Hello_world

  4. Re:What's it look like? by nuzak · · Score: 4, Interesting

    http://research.sun.com/projects/plrg/PLDITutorial Slides9Jun2006.pdf

    Fortress uses a lot of unicode mathematical operators, which slashdot will quite pitifully fail to display.

    --
    Done with slashdot, done with nerds, getting a life.
  5. This is fake... by Anonymous Coward · · Score: 5, Insightful

    All they do release under an OSS license is an *interpreter* of the language. This is completely worthless for high-end number crunching. Wake me up when they open source a good optimising *compiler*.

    Bah... Slashvertisement...

  6. Cue Fortrain Jokes by locokamil · · Score: 5, Funny

    "God is REAL unless declared INTEGER"

    "Q: What will the scientific programming language of 2050 look like? A: No one knows, but it will be called FORTRAN."

    "CS without FORTRAN and COBOL is like birthday cake without ketchup and mustard."

    "Consistently separating words by spaces became a general custom about the tenth century A.D., and lasted until about 1957, when FORTRAN abandoned the practice."

    "The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change."

    I'd actually venture that FORTRAN has more jokes about it than C. I for one welcome our FORTRESS-joke-making overlords.

  7. Re:Doesn't make a difference. by celardore · · Score: 3, Funny

    Yep, programming languages advance by evolution, not intelligent design.

    Thanks for shattering my illusions. I thought programming languages were as they were, are, and always will be. I'm going to sue you.
  8. Another winner from Guy Steele by msuzio · · Score: 4, Interesting

    For those who won't bother to read the article, Fortress was designed by Guy Steele, which gives it a good pedigree in my book. I heard his talk at OOPSLA 2006 on the language design decisions they made for Fortress, and although my Fortran (and math) experience is too shallow to fully appreciate it, I found it fascinating nonetheless.

    At the very least, Sun has given people something to think about.

  9. Fortran has some coolness by EmbeddedJanitor · · Score: 3, Interesting
    I used fortran quite a lot around 25 years ago. Sure it had some oddball limitations and wierdness, but it is damn fast and quite efficient for some coding purposes.

    I wrote a Fortran program that printed out a calendar with the year in a banner font at the top. It took 57 cards (no library calls etc, beyound PRINT). Try do anything useful in 57 lines with today's languages.

    --
    Engineering is the art of compromise.
    1. Re:Fortran has some coolness by mhore · · Score: 4, Insightful

      I used fortran quite a lot around 25 years ago. Sure it had some oddball limitations and wierdness, but it is damn fast and quite efficient for some coding purposes.

      I wrote a Fortran program that printed out a calendar with the year in a banner font at the top. It took 57 cards (no library calls etc, beyound PRINT). Try do anything useful in 57 lines with today's languages.

      It shouldn't surprise you... but I use fortran quite a lot today. A lot of the oddball limitations and weirdness are gone in Fortran 90/95... though I still use Fortran 77. It is still an amazingly useful and fast language to code numerical stuff in. Yes indeed. No need for any math.h in this programmer's world! I just hope this Fortress business is just as fast as fortran, because if it's not... you won't see many fortran guys switching over. The main reason (as far as I'm concerned) that we're still using it is that it is fast, and simple. OOP belongs in business... not in Molecular Dynamics.

      Mike.

      --

      Mmmm......sacrelicious.

    2. Re:Fortran has some coolness by Stephen+Williams · · Score: 3, Insightful

      Try do anything useful in 57 lines with today's languages.

      Given that DeCSS can be written in six lines of illegible Perl, I shudder to think of what a Perl coder could accomplish with 57 lines...

      -Stephen

  10. I don't see anyone trying to give credit where due by zappepcs · · Score: 4, Insightful

    In recent times, we've seen all kinds of credit given to companies that have nothing more than vaporware (I don't dare mention anything from Apple here or I'll get modded as troll) and yet Sun, like them or not, is giving back. Perhaps they are not giving back things that you will immediately use or notice, but they are giving back, making it open source, working to stay relevant. That last phrase was on purpose.

    They are doing this in complete (nearly) opposition to the position that MS takes. I think Sun deserves a little credit. The did (sort of) open some of the hardware as well, and while that may not fall into hobbyists hands soon, it is a start. Opening (in any meaningful fashion) some high end hardware is a big thing.

    No, I don't have tons of Sun hardware or software at home, but I do use it at work, and its incredibly stable, if not super easy to administrate.

  11. Re:Multi-core? by IvyKing · · Score: 3, Insightful

    Not sure if you're being sarcastic or ignorant. One of Sun's latest jewels is the 8 core Niagara and it behooves them to come up with ways of keeping all 8 cores going on a processor.

  12. Intellectual Fortress Commentary by namtro · · Score: 5, Informative

    Robert O'Callahan (a core Mozilla developer) had some fairly insightful comments on Fortress a couple of days ago I personally found interesting...

  13. Re:Multi-core? by Cassini2 · · Score: 4, Informative

    Multi-processor programming is becoming a real force / nightmare. Dual-core is only the beginning. At the rate AMD and Intel are moving, we will have Niagara like chips in our home PCs. Already, AMD and Intel have quad-core processors, and are talking about dual quad core (8 core) computers. The average program just can't scale well to 8 cores. Most programs, programming languages, and algorithms don't scale well with increasing the number of cores.

    Fortress is proposing a language to automate that scaling. They are discussing language features to deal with multi-CPU systems, where multiple memory banks are present. AMD's multi-CPU system's (Opteron) with HyperTransport each have a separate memory banks for each processor. It makes sense to allocate the half of the array used by CPU #1 in CPU #1's memory bank, and the other half used by CPU #2 in CPU #2's memory bank. Then the threads should be split so first pair of cores on CPU #1 work in the first half of the array, and the second pair of cores on CPU #2 work on the activities related to CPU #2. Currently, all these multi-processor mapping activities happens manually, and it really sucks. It would be wonderful if programming languages supported this activity automatically.

    I don't know if Fortress is the answer to the multi-core / multi-CPU problem. I hope something is. The computing world needs a solution.

  14. Re:What's it look like? by Goaway · · Score: 3, Funny

    And most monitors will fail to display unambiguously, in any straightforward and reliable way.

    You may not have noticed, but cutting-edge monitors nowadays are capable of displaying graphics, and not just text.

  15. From the specification, it is Ugly by XPulga · · Score: 5, Interesting

    I've seen this a couple of days before and bothered to skim through the specifications carefully hidden in the depths of Sun's site. I am not pleased with what I saw. Summarizing:

    It seems that the only Fortran-esque side of Fortress is that it is aimed at scientific computing and number-crunching. Other than that, the programming paradigm of Fortress is based on object orientation and programming-by-contract. If Java smelled like Smalltalk, Fortress smells like Eiffel.

    Fortress has focus on three basic things:

    1) programming by contract (pre-conditions and post-conditions of a method)
    2) Numerical and dimensional correctness
    3) Keeping the programming language as close to mathematical notation as possible.

    1) means that people will write more to achieve the same thing with some guarantee of correctness. Much like Java's enforcement of exception handling, an be easily misused.

    2) means that Sun bothered to include kelvin, Pascal, meter, second, Newton and every Physical unit you can think of as language keywords, that all parameters should specify what unit they're in, and that the language will do some effort to prevent errors arising from adding oranges and bananas, or precision errors from summing milligrams to some hundreds of kilograms.

    3) means that Fortress will make Perl look readable. Good part of the language specification deals on how the editor should render the source code onscreen. The logical AND operator is the upward-pointing wedge symbol of math. The logical OR operator is the downward-poiting wedge symbol. The Integer type is that special-font Z, and a real is that special-font R. The specification deals on how to represent these in an ASCII file, using a meta-language similar to TeX (but incompatible with).

    Programming Fortress on anything other than Sun's own IDE will most likely be unfeasible. Think of every math operator you've seen. If you have experience with TeX/LaTeX, think of those 4 pages from symbols.dvi with all symbols you could use. Those are the Fortress operators. Sun has finally come with something mor unreadable and with more operators than Perl. And the operators aren't even ASCII, they're untypeable. The bitwise AND and OR operators are a weird thing I had never seen before (after 5 years of engineering, and 5 years as graduate student in CompSci).

    That said, Fortress may even succeed as a niche programming language. But I still have two concerns left:

    How will non-scientific code look on it ? Surely Fortress programs will want to open windows, and dialog boxes, access files and the network. The math-oriented syntax has all it takes to make UI programming uglier than C+Xlib.

    Sun claims that Fortress is aimed at High Performance Computing. Sun released an alpha interpreter of Fortress, which is written in Java. What kind of sick language designer writes an interpreter in Java to demonstrate something related to High Performance computing ?

    1. Re:From the specification, it is Ugly by Coryoth · · Score: 5, Insightful

      It seems that the only Fortran-esque side of Fortress is that it is aimed at scientific computing and number-crunching.

      Which is to say, its aimed at the niche that Fortran, despite how old and creaky it is, still rules. The world of programming has come a long way since Fortran, but nothing matches it for scientific computing and number crunching. To be honest that's about the only aspect of Fortran worth keeping...

      Other than that, the programming paradigm of Fortress is based on object orientation and programming-by-contract. If Java smelled like Smalltalk, Fortress smells like Eiffel.

      You say that like it's a bad thing! Eiffel is, surprisingly enough, a very nice language to work in. I'd be very happy with a language targetted toward numerics (And with real math style notation to boot!) that was as pleasant to work with as Eiffel. Design by contract is a good thing, and importantly it is optional. You can specify a contract or property for a function, but you don't have to. The ability to flesh out an API with contracts and properties is a damn good thing - something far too many languages lack.

      means that people will write more to achieve the same thing with some guarantee of correctness.

      Contracts and properties are optional. If you don't want correctness guarantees then don't use them. On the other hand if you would like a little more insurance... well then they're very useful indeed.

      means that Sun bothered to include kelvin, Pascal, meter, second, Newton and every Physical unit you can think of as language keywords, that all parameters should specify what unit they're in, and that the language will do some effort to prevent errors arising from adding oranges and bananas, or precision errors from summing milligrams to some hundreds of kilograms.

      Again, specification of units is optional. If you don't want to worry about units then don't use them. Then again if you're writing some physics code then having the sanity check of unit analysis to make sure everything is working properly is a damn useful thing to have available. Having dimensions and units as not more onerous than having types - it is simply another level of checking available; the benefit here is that the units are optional: if you don't want the extra checks, don't use them.

      means that Fortress will make Perl look readable. Good part of the language specification deals on how the editor should render the source code onscreen. The logical AND operator is the upward-pointing wedge symbol of math. The logical OR operator is the downward-poiting wedge symbol. The Integer type is that special-font Z, and a real is that special-font R. The specification deals on how to represent these in an ASCII file, using a meta-language similar to TeX (but incompatible with).

      Well that depends on who you are really: Fortress looks incredibly readable to me. Then again I am a mathematician and look at math, formatted in exactly that way, all the time. If you spend all day looking at Java and C code then sure, it's going to look unfamiliar to you. Then again, you probably aren't in the target market for a language aimed specifically at scientific computing. To me a lot of C looks awful and can be hard to read because of its requirement that you pound everything into basic ASCII. It really all depends on what you're used to. As to how easy it is to enter - sure it would be nice if it was straight TeX - but then it is so similar that there is really no problem learning it. If you actually do a lot of math then you can name all those symbols straight away, and what you have to type in to get the symbol is simply it's name. Again, not ideal for people who don't do a lot of math, but then that isn't the target audience. If you do much math then the symbols look right instead of being the ugly ASCII kluges of other languages, and

    2. Re:From the specification, it is Ugly by Coryoth · · Score: 3, Informative
      My point in comparing Fortress to Eiffel was pointing out that Fortress may be closer to Eiffel than to Fortran, and the press release from Sun mentions Fortran alone.

      And I think that's reasonable, given that the role that Fortress is intended to play is far more important (especially given that it is a niche role) than what Fortresses ancestor languages are. It owes as much to Scala (at least it looks that way - I have no idea whether Scala was actually an influence) as it does to Eiffel. What counts is what it is intended to be used for - which is scientific computing and HPC where parallelisation counts: that is to say the niche currently filled by Fortran.

      I do hope Sun finds a way to keep the GUI/OS-interaction code in some other language (Java is reasonable), making it possible to build applications from Fortress and non-Fortress parts. Treating mouse and other UI events with that math notation won't be fun, even for the most devout Mathematician.

      I honestly have no idea what you mean here. I expect GUI/OS-interaction code would most likely look an awful lot like Scala, which is hardly a problem. The math formatting onlycomes in when actually doing mathematics. The rest of the time it's essentially just an OO language like any other, and won't look any different to any other language. Treating UI events will be straightforward.

      I didn't see in the specs (I skimmed through it quickly, could be my fault) how Fortress is meant to parallelize computations more efficiently. From all I saw, I assume each method runs atomically in a single thread and parallelization of methods is be based on the contracts.

      There are a number of things that Fortress does to make parallelisation work. For instance for loops are parallel by default, as are vector operations. Try looking at the "atomic" keyword to see more on how control of serial and parallel operation is handled. If you want easy parallelisation via each method working in a separate thread and contracts determining wait conditions then look at Eiffel and SCOOP: it introduces a single new keyword (separate) and allows you to do just that.

      I am a Perl programmer, and I don't think Perl is that unreadable. In fact, I agree with most of its design. I am happy that now we can point the finger at something else when someone complains about "weird syntax" and "too many operators".

      I think what you need to consider is how many operator symbols are defined by default in Fortress: it actually isn't that many. Fortress simply supports unicode and the ability to define new operators using classical math symbols - it doesn't have them all defined in the base language. Almost everything is farmed out to libraries. You may think it looks ugly and complicated compared to Perl but I (who have done a fair bit of Perl programming, and have spent time looking at Fortress as it developed) think you're being premature. See it in action or actually try using it yourself and I think you'll quickly find it is, in fact, a lot more readable than Perl.
  16. Good News, but work is still needed by deadline · · Score: 3, Informative

    This announcement is great news because the parallel programming problem is quite difficult and is becoming more important as multi-core systems emerge. One important distinction that is often not made, is the difference between concurrency and parallel execution. (although the article does touch on it)

    Basically, determining whether a program or algorithm is concurrent (parts can computed independently) is possible but can be difficult in some cases. Many people think that is the essence of parallel computing. It is not.

    Once you have the concurrent parts, the questions becomes "whether they should be executed in parallel". The answer depends upon the ratio of computation to communication (parallel overhead). All parallel computers (and clusters) have different ratios and therefore, something that runs well in parallel on one machine, may run poorly on another.

    Having a language where concurrency can be expressed and controlled, allows researchers to investigate the second issue (parallel scheduling).

    If you want to read more about this kind of thing (and some other parallel programing ideas) take a look at some of the Cluster Programming articles on ClusterMonkey.

    --
    HPC for Primates. Read Cluster Monkey
  17. Re:APL by Coryoth · · Score: 3, Interesting
    I'm not sure that's a good idea, either, since reals and floats are different things. Reals have infinite precision, whereas precision is finite for floats.

    In Fortress the basic types ZZ and RR provide arbitrary preceision integers and floats. If you want a specfied precision then you need, say, ZZ32 or RR64 etc. So in fact it is the correct notation.

    Yes, that's what I imagined it would be like. I also imagine actually _typing_ something that looks a lot more like regular program code, so that you still have to learn an alternative to math notation.

    Yes, but it is well documented and, if you are at all familiar with mathematics, straightforward to learn (indeed, you almost don't need to learn - instinctually typing in whatever you would say works for most symbols. It is no harder to learn than TeX - easier if you already know TeX in fact.

    Also, the result will look like what one would see printed in a math textbook, as you said which is (1) not what the programmer typed, and (2) horribly obfuscated to me (which is a personal thing, but applies to many people).

    Sure, it applies to many people. None of them are in the target market for Fortess though. Fortress is aimed at mathematicians and scientists - the sort of people who are still using Fortran - and for them the math notation makes the whole thing much, much easier to read. It all depends on what you're used to. If you're a programmer who reads C and Java all day then that probably looks good to you. If you spend much of your time reading math papers, however, then mathematical syntax looks far more natural the the elaborate and obfuscated look of C. Congratulations, you're not the target market for the language - that doesn't mean it isn't a great idea that will be of great value to many other people.
  18. Fortran aint that fast... by spagetti_code · · Score: 3, Interesting
    I know that Fortran has a good reputation for speed...

    But when I was postgrad at university, I helped a Math mate recode some department apps used in his thesis from Fortran into 'C'.

    The end result is the damn stuff ran faster. I looked into it more deeply to try to understand the difference - was it that I (comp-sci major) was coding the apps more cleanly than the original math majors?

    Details are lost - it was a while ago - but I do recall that the 'C' libs were doing most floating point operations faster than fortran. Not just the low level co-processor stuff, but also the more complex operations.

    Surprised the heck out of both of us. I suspected at the time that it was just the variant of fortran we were running on Vax's, but didn't bother checking further.

    1. Re:Fortran aint that fast... by mjc_w · · Score: 4, Insightful

      Another possibility is that the program used a lot of indices (for 1 and 2 (or more) dimensional arrays) and the fortran version had subscript checking on. My experience is that subscript checking can add (undex VAX VMS) up to 20 to 30 percent to the run time. My experience is also that this catches at least 1/3 of my errors and is definitely worth it.

      Fortran (and Ada) are languages that understand arrays.

      In C, an array is a pointer, an offset, and a prayer.

      --
      This is the Constitution.This is the Constitution under the Bush administration. Any questions?
  19. Go read about it... by mritunjai · · Score: 4, Informative

    Folks,

    Seriously, first go and read about it before making any comments or cracking FORTRAN jokes.

    This language is unfortunately advertised as "FORTRAN replacement" though probably the only thing it shares with FORTRAN is that it is targetted at scientific computing. But that's about it!

    Secondly, there is a different between language specification and implementation! The "interpreter" is just proof of concept and a fast way of giving means to people to play with it so that you can ot just try to express your computation in it, but also see it running in flesh! Though, it is primarily of interest to language designers to find out implementation quirks and iron them out as the language design evolves. A compiler is usually the final outcome, but is not the goal. The goal of language design is to address the problems in the domain it is targetted to, effectively.

    I have been following the developments in Fortress community for a while and it is a very peculiar one in its own regard. Guy Steele has bettered himself again and has set some of the firsts-

    1. Integration with typography system. The programs are not just typed, but typed well. You can typeset your equations. The primary symbol set is unicode (with ASCII symbols for lagacy compatibility).

    2. Full support for closures, mixins etc with multi-paradigm programming support.

    3. The language specification implies parallelism by default! loops are parallel, unless specified serial.

    4. Units are included in the language type system. So the compiler can not just check whether you're using the right storage type (int, real etc), but also whether the calculation you're coding actually makes sense!

    and many more. It is a great read for anyone remotely interested in computing, languages and software enginnering and development.

    Please follow the links to the specification down in this thread and go through it, if your busy schedule permits.

    Thanks

    --
    - mritunjai