Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site cornell.UUCP Path: utzoo!linus!philabs!cmcl2!floyd!vax135!cornell!hal From: hal@cornell.UUCP (Hal Perkins) Newsgroups: net.lang Subject: Re: Treating Data Abstractly Message-ID: <5221@cornell.UUCP> Date: Fri, 2-Sep-83 16:04:04 EDT Article-I.D.: cornell.5221 Posted: Fri Sep 2 16:04:04 1983 Date-Received: Sat, 3-Sep-83 14:06:27 EDT References: <5215@cornell.UUCP> Organization: Cornell Computer Science Lines: 40 Yes, I do know about Smalltalk, Mesa, CLU, Modula-2, and whatnot. These don't seem to do what I want, but I must tread lightly here. I am not a certified expert in any of these languages and still have some reading to do, so I will speak in vague generalities and try to avoid putting my foot too far down my throat. All of these languages do a decent job of separating the specification of a module from the implementation. What they don't do (CLU might, but as I said, I still need to look into it) is handle the problem of multiple representations of the same abstract type simultaniously. For example, suppose I have two implementations of complex variables: one using polar coordinates the other using rectangular coordinates. And suppose I want to have some of my data use one representation and other data use the other one. While the languages Pavel mentions make it easy for me to write a program in terms of a single abstract type (complex) and later specify an implementation (rectangular or polar), I don't think it is easy or transparent to use several different implementations of the same abstract type at once. This is the same problem as having some arrays in main storage and others in the Unix or OS/360 file system. As for Smalltalk, the paradigm of sending messages to objects does indeed seem to solve the problem at a conceptual level. But there are two things I worry about here: One is efficiency--doesn't it require a fair amount of overhead to access an array element by sending a message to an array object? It would seem that no matter how cleverly this is implemented, it wouldn't be as fast as executing a half-dozen instructions to compute a memory location and load the desired array element. I realize that it is not fashionable to worry about efficiency (particularly when you have a dorado on your desk), but I don't want to exclude it from consideration. Secondly, Smalltalk lives in a world of its own. I'm hoping that the ideas in it can be applied in other settings and other languages. Anyway, I'm getting a little beyond my depth. I think I'll avoid any further comments on Smalltalk, Mesa, and CLU until I've learned more about them. Hal Perkins UUCP: {decvax|vax135|...}!cornell!hal Cornell Computer Science ARPA: hal@cornell BITNET: hal@crnlcs