Sponsored Link •
Frank Sommers: Many people nowadays talk about XML's role in providing semantic context for Web services. Jini's primary mechanism of semantics, however, lies in the Java language's service type. Last March, the WWW Consortium's Tim Berners-Lee published "The Semantic Web" in Scientific American, describing what the future of the Web might be like. How do you envision Jini playing a role in the semantic Web? How would you compare the XML-based, semantic approach to Jini's reliance on a type system?
Jim Waldo: I think we're a long way from understanding semantics. It would be wonderful if we could teach machines to understand things the way we understand them. We don't have a good model of how we understand semantics, much less a model that we can translate into a computer program. I think that work, like what Tim is pushing on the semantic Web, is wonderful. But I don't believe it will succeed in my lifetime. So, I'm looking at other aspects. I could be absolutely wrong, and they could be wildly successful. When they are, they might be able to replace all of the work we're doing on Jini. But I don't think so.
Type systems don't give you a complete semantics, but rather describe the kinds of things in the world. So, that way they are a semantics, because they tie some language into those things. We have rules on how you combine types to get other types. Semantics isn't just the meaning of constituent parts, but how you combine those meanings to define their combination. So the composition model really makes something into a semantics. We don't understand the semantics of natural language, but we do understand the semantics of type systems.
Bill Venners: We're speaking a natural language, and we're understanding each other...
Jim Waldo: We understand each other, but we don't understand why or how. It would seem easy if I knew the meanings of all the words to come up with rules that would let me say, If you combine these words together, here is what the meaning of the combination is. But it's unbelievably hard. The formal semantics that we have available for natural language are limited to trivial pieces. And the progress we're making, when it has worked, is quite small. Computers are understanding natural language better by basically ignoring the work that linguists have done for the past 20 years, and returning to a notion of statistical analysis and Markov models, where you get an idea of what might be said based on surface analysis and the probabilities of one word following another. But it doesn't really give this combinatorial ability.
Type composition, we understand. And in the Java language, we can specify it quite well. Java is an artificial language; it doesn't give us as rich a meaning as we get in a natural language. It's very hard to express metaphorical meaning in Java types. But the exact matching we get is what we ground the identification in Jini in. And that's why we use a type system.
Frank Sommers: You're saying that type systems have a well-proven logical model, whereas for these other types of semantic notions there is no model at all, at least not yet.
Jim Waldo: That's right. Or what models we do have are known to be inadequate for anything interesting. We're engineers in the Jini group. We took something that we understood to be inadequate but well specified and used it as the foundation of what we've built. And we're seeing how far that train will lead us. We think it's a fairly interesting train.
Bill Venners: Would you give an example of what you mean by composition of types in the Java system?
Jim Waldo: The whole polymorphic type hierarchy is a notion of compositionality, as is the notion of being able to implement multiple interfaces. One problem if you're using natural language in a directory system to describe a service is what you do with a multifunction device. So, if the device is a printer, scanner, and a fax machine, how do you describe the relationship between combinations of printers/scanners/fax machines to printers, and scanners, and fax machines?
Using the type system, that's simple. The device implements three interfaces: the printer interface, the scanner interface, and the fax interface. Using a descriptive language, like English, it's difficult to describe what their relationship is.
In Java, we have compositionality of subtyping. A color printer is a printer type, which gives us one form of compositionality. In addition, there is the notion of mixing interfaces together to build types out of other types. Both are well specified. It's not rich semantics; you really only have two types of relationships: subtype and compositional type. But it's rich enough to do a lot, and that's what we're looking for.
Bill Venners: I once heard you say that although people are good at understanding strings, computers aren't. But computers are good at understanding types. Could you clarify what you meant by that?
Jim Waldo: A program is good at comparing a couple things for type equivalence. It's really hard for a programmer to compare two strings for meaning equivalence. As a programmer, I can understand the meaning equivalence of those two things. I know that a color printer is a type of printer, but a ribbon printer is not. But it's tough to write a program that understands that. Subtyping and compositional relationships in a type system are easy in Java: I say, Is this a ..., and I'm done. I don't have an equivalent primitive in the Java language that says "means the same as" and that takes two strings. We could get the Java people to do that, but it would be difficult.