|
| United States Worldwide |
|
The Soul of a New Programming LanguageFortress focuses on the needs of scientists. By Al Riske 2.Mar.05--Guy Steele leads a small team of researchers in Burlington, Massachusetts, who are taking on an enormous challenge -- create a programming language better than Java. Think of it as Java for scientists, Java for the programmers of a peta-scale supercomputer. Called Fortress, the new language is part of a larger Sun Labs effort to come up with a design for the supercomputer of the future, an effort funded in part by DARPA, the U.S. government's Defense Advanced Research Project Agency. Unlike past DARPA projects, however, the focus is not on high performance but rather high productivity. The difference? High performance is all about giving a problem to a machine and getting the answer, fast. With high productivity, the clock starts when you give the problem to the programmers. "So the question is what additional technologies can you use to support the programming process, the debugging process, the system administration process -- just everything involved with actually getting the answer from the time the problem is posed," Steele says.
Steele, a 10-year Sun veteran and winner of the 2005 Dr. Dobb's Excellence in Programming Award, has written half a dozen programming languages that exist simply as folders in his filing cabinet.
"Designing technically competent programming languages is not that difficult," he says. To him they're like the finger exercises he used to do when he played the piano -- a way to learn. He also has an ability to focus very systematically on what he describes as "nits and corner cases" -- an ability that came in handy when he was asked to co-write the specification for the Java language. "I pestered James [Gosling] with lots and lots of questions," he recalls. "How does the language behave when you write this particular statement, even though you'd never think of writing it in a real program?" His aim was to eliminate unintended consequences. "I made a big matrix," he says. "The rows were the places you could use a type [a description of the set of values a variable can take on] and the columns were the kinds of types you could write. Then I checked each entry in the matrix to make sure the specification addressed what happened in that case. "That's the kind of rigor I try to bring to language design."
A couple of things happened to Steele after the specification was complete.
One was that he got a phone call from a gruff-voiced man at a small firm with half a dozen programmers. "You the guy who wrote the Java spec?" "I co-wrote it, yeah." "Well, I just had to call to thank you. Since we switched to Java, productivity at our firm has quadrupled, just because Java is catching our mistakes." The other thing was that he took some heat from friends in the scientific computing community. "They said, 'Java has terrible support for floating-point arithmetic. You need to fix this so we can use Java.'" But they weren't the community Java was trying to address, Steele says. "In some ways I think it's a mistake to try to make a programming language that is all things to all people. I'm now not convinced that a single programming language can serve everyone's needs, because the needs are so diverse." Fortress focuses on the needs of programmers who work in mathematical disciplines and disciplines such as physics and chemistry that rely extensively on mathematics. For starters, the code looks like math -- math the way it's written on a chalkboard, with square root signs and exponents placed above the line.
"Fortran was invented on accounting equipment. They were using keypunches that had character sets designed for business use. There was no multiplication symbol on a keypunch, so they settled on the asterisk as a compromise," Steele explains.
"It seems like I'm focusing on a tiny, nitpicky point, but that's because I tend to work by examples. This is an exemplar of what I think is a more global problem, which is that programming language notation is different from the working notations of mathematicians and physicists and chemists. Why can't we bring them close together? That's one of the conjectures we have in Fortress. What if we tried really hard to make the mathematical parts of a program look like mathematics?" he adds. "Now that doesn't mean you can do an entire program that way, because there are ideas in programs having to do with algorithmic organization or the expression of loops -- deciding whether things are going to be sequential or run in parallel. Those are things that mathematicians don't usually think about, because they're thinking more abstractly. For that, annotations in existing programming languages may be just the right thing, so we're looking for a combination -- not throwing out everything we know and replacing it with something new." The mistake many language designers make is in failing to study history, failing to look at what worked and didn't work in the past, Steele says. "For example, we're trying to use the dynamic compilation ideas from the Java HotSpot compiler to provide a productivity boost. Essentially, programmers shouldn't have to worry too much about optimizing while they're writing programs. Instead, that optimization can be done by compilers, either ahead of time or on the fly." By measuring how the programming is behaving, he explains, information can then be fed back into a compiler so it can reorganize the program while it's running. "On the other hand, you can't just rely on copying features from the past because contexts change," Steele says. "I'm willing to stand back and say, 'Look, the way we've been doing it for half a century isn't very good.'" The challenge for Steele and the Fortress team will be trying to change the way people have been doing things for their entire careers. "Java succeeded by making people believe, at least initially, that the change wasn't all that great. It looked a lot like C, so people said, 'Oh, this is just a C variant for the Web. We can deal with this.' "Turns out it was actually a very big change in a number of ways -- stronger type system, automatic storage management (which you don't have in C), and the the Java garbage collector completely changes the way you organize a program," Steele says.
"So one thing we're looking at is how can we move people from Fortran to Fortress without it seeming too strange at first. We're still working on that." Steele and his team are also well aware that Java succeeded because it added real value. "With Fortress, we've got to ask ourselves, not just, 'Can we come up with a cool notation and make a language that looks more mathematical?' But we have to ask ourselves, 'Will making it more mathematical make programmers lives easier? Will it improve their productivity? And will the improvement in productivity be large enough that people will find it worthwhile to go to the effort to learn a new thing?'" His answer: "I'd like to think so. That's what I like to do. That's my thing. I think there is room for at least one more big leap, and Fortress is our experiment with trying to make that leap." |
|
|||||||||||||||