Heading:
PE report (section 5a)
Page Numbers: No
DISCUSSION OF DIFFICULTY ESTIMATES
In this section we discuss the difficulty estimates for the highest-priority features. Nearly all these features fall into one of three difficulty patterns:
Considerably easier in Mesa than in either Lisp or Smalltalk (e.g. L11, L13, T5).
Considerably easier in either Lisp or Smalltalk than in Mesa (e.g. L5, T1, L12).
Comparable in difficulty in all three systems (e.g. L4, L3, T8).
This is not terribly surprising, given the underlying philosophical similarities between Lisp and Smalltalk.
Priority A
(L5)030Object management -- garbage collection/reference counting
Reference counting, which relies almost entirely on "local" information, and garbage collection, which needs a "global" map of all potentially traceable data, present quite different problems for Mesa. For reference counting, it might be adequate to add an attribute to the Mesa type system so that reference counting or transaction queuing can occur when the program stores into a pointer that might point to an automatically managed object, and arrange for a user-supplied finalization procedure to be called when a count becomes zero. A further refinement might be automatic generation of the procedure by the compiler based on declarations. All this would be difficulty level 2.
Garbage collection in Mesa is more difficult, for two reasons:
The type information needed to locate all pointers is not present in the actual data, but must be derived from the symbol table produced by the compiler.
The presence of LOOPHOLEs, pointer arithmetic, overlaid variants, and relative pointers makes it impossible for a garbage collector to find or trace all pointers to structure to be saved.
The former problem is only one of efficiency: one way around it might be to arrange for the compiler to generate a tracing procedure for each structure that might participate in garbage collection. The latter, however, is a fundamental difficulty. We believe that the proper approach to overcoming it is to discover a subset of the Mesa language that does not use any of the LOOPHOLE-like features mentioned above, and find a way to draw a protection boundary around a program written in this subset so that it can have automatically managed data. This is a hard problem.
(L11)203Statically checked type system
The basic problem with static type checking in both Lisp and Smalltalk is that very little is known at compile time about the referents of names.
Lisp currently has a facility called DeclTran, which uses embedded declarations (both of types and of arbitrary predicates) to check the types of operands at runtime and to generate more efficient code within an individual function. This facility applies to both interpreted and compiled code, but is somewhat machine-dependent and does not exist for the Alto/Dorado Lisp system. Also, it has no ability to deal with static checking of interfaces between user-defined functions (as opposed to the interface from user-defined functions to built-in operations like arithmetic). If mechanisms, such as those of (L13) and (L14), were added to Lisp to control exporting and linkage of names, it is likely that DeclTran could be extended to inter-function type checking. We are inclined to think that this is not a good approach in the long run and that the type system should be more tightly integrated with the underlying language system, but it seems like a workable way to obtain the desired result.
Smalltalk has no facilities at all for static declaration of types. Furthermore, because every operation is decoded at execution time by the object that is its first operand (even "elementary" operations like +), there is in principle no way of knowing what code will actually get executed in advance of execution time without some combination of type declarations and searching the entire system to discover what classes implement what operations. The situation is complicated by Smalltalk’s subclass structure, which makes it very desirable that, for example, a method requiring an argument of type Number should accept values of type Integer (a subclass of Number). Smalltalk has a fairly simple compiler and name structure, but a lot of new machinery would have to be built, some of which would require careful thought about what "type" means in the Smalltalk environment.
(L4)000Memory management -- object/page swapping
Lisp, Mesa, and the high-performance Smalltalk all use a straightforward paging scheme, which Pilot supports.
(L14)302Abstraction mechanisms; explicit notion of "interface"
As discussed under (L13) below, Lisp currently has only a very weak mechanism for explicitly dealing with interfaces between a package and its clients. In addition, Lisp has no mechanism for taking a group of functions and controlling how its imported names are to be linked: such a facility is necessary if interfaces are to be separated from their implementations.
Smalltalk is somewhat better off since its invocation mechanism does hide the implementation from the caller. A type system for Smalltalk, as discussed under (L11) above, would also go far towards providing an explicit notion of interface, since the current Smalltalk notion of "abstract class" can be viewed as either a type or an interface description.
(T1)020Fast turnaround for minor program changes (<5 sec)
Lisp has an interpreter, and a fully integrated editor. (We have discussed replacing the interpreter with a high-speed, low-code-quality compiler, which already exists for the Alto.) Smalltalk has a compiler which we believe will run fast enough on the Dorado, and an integrated editor.
Mesa offers several medium-size obstacles to fast turnaround for changes:
Since the editor (Bravo) is not integrated or even properly packaged, considerable machine and human overhead is involved in getting in and out of it. We recommend replacing it by a packaged editor available in the programming environment. It appears that SDD is quite interested in this already.
The compiler is not designed to compile anything smaller than an entire module. We recommend some work to modularize the compiler (it is already broken up quite well) and to make sure enough information is available for it to be able to compile single procedures.
The current Mesa system does not provide for safe, incremental replacement of modules or procedures by new versions without losing execution state. This feature must be provided.
(L16)?0?Adequate runtime efficiency
The Lisp instruction set is actually quite similar to that of Mesa: for example, it can use the Dorado IFU. Sources of additional overhead include the fact that all data are doublewords, and considerable runtime type-checking is required. We believe that even the present (Bcpl-based) Lisp system will perform adequately (better than 1x Maxc) on the Dorado; this will improve considerably after the move to Mesa and Pilot, which will enable use of the IFU. Further significant gains in efficiency would be possible with some redesign that would use the Dorado processor stack, and with the extensions required for (L11), static type checking.
The Smalltalk instruction set, in principle, is also similar to that of Lisp and Mesa. The high-performance Smalltalk design uses the IFU and processor stack. In addition to doubleword data and runtime type-checking, Smalltalk also suffers somewhat from substantially less ability to compile things like arithmetic and structure access in-line, and the requirement for doing some kind of hash lookup on each invocation. We believe that Smalltalk could also be brought up to acceptable efficiency through the high-performance design.
(L1)002Large virtual address space (> 24 bits)
Lisp and Mesa already provide 24-bit address spaces. The difficulty code for Smalltalk reflects Dan Ingalls’ estimate that the current system could be modified (without changing its basic structure) in 3 to 6 months.
Priority B
(L13)302Encapsulation/protection mechanisms -- export control
Lisp already has one mechanism for controlling the export of names from a group of functions: the block compiler. However, this mechanism has many disadvantages:
Using it requires giving up a good deal of debugging capability, since non-exported function and variable names are completely lost.
It is not compatible with either the interpreter or the normal compiler.
Its application is limited to a single level, e.g. a package cannot use this mechanism to have subfunctions local to an individual interior function or group of functions.
We believe that adding export control to Lisp would require introducing notions of nested or otherwise controlled lexical name scopes similar to those of Mesa; we would expect this to have ramifications throughout the system, and some impact on user programs that take advantage of the fact that there is a single space of names that encompasses both all of the system, their own programs, and their own data. (We note that in the past, the lack of export control has often been seen as an advantage, since it made it easy for a somewhat knowledgeable user to extend or modify the system as desired, but we believe this is outweighed by the problems it causes.)
Smalltalk has two different export control mechanisms. For variables, there is a dual lexical hierarchy based on lifetime (method variables, instance variables, and static class variables) and on specialization (subclassing). For operations, each class defines the names of operations it will accept. However, Smalltalk is deficient in several respects:
There is a loophole, fairly easy to use, that allows access from outside to any variable of any object.
A class cannot restrict purely internal operations to internal use -- all operations within the class are accessible to all clients.
Subclasses have access to all operations and data of their superclass.
We believe that remedying these defects would require significant additions to Smalltalk but no changes in its basic structure.
(L3)333Well-integrated access to large, robust data bases
This is an area requiring considerable thought. No general-purpose programming language currently offers this capability as we intend it to be interpreted. We have no a priori reason to think it would be harder to implement in one language than in another -- it will be a challenge in any of them.
(L12)020 Self-typing data (a la Lisp and Smalltalk), run-time type system
Mesa, unlike Lisp and Smalltalk, segregates type information from data at runtime by relegating the former to symbol table structures put out by the compiler, which are normally not part of the runtime environment. Extending the type system into the runtime environment in a reasonable way seems to require adding types as a type in the language, and arranging things so that the runtime representation of types can match up properly with the information in the symbol table. Some of the design for this already exists, since the debugger must manipulate types internally. It is worth noting that Mesa’s facilities for variant records and (proposed) for sequences already address a small part of this problem.
(T5)203Consistent compilation
Mesa ensures consistent compilation by placing time stamps on source and object files, and by recording in each object file the complete list of time stamps for the files that produced it. For Lisp and Smalltalk, the basic problem is that identified in (L13) and (L14) above, namely, lack of mechanisms for identifying the dependencies between modules.
(T6)323Version control
Mesa contains most of the mechanisms for the history part of version control (knowing exactly how to reconstruct any object file). Some things are missing, such as a record of the compiler switches (fixed in Mesa 4.1), and also the Binder does not provide this information in the files it constructs. For Lisp and Smalltalk, the problem is that objects do not carry any kind of identifying stamp, nor do compilation processes record the information they used. In the present Lisp system, the problem is almost insoluble, because compilation takes place in the context of whatever random collection of macros, flags, and other declarations happens to be lying around at the time of compilation. (The problem is not the large amount of state on which compilation depends, but the fact that there is no mechanism for recording the relevant parts of it with the compiled file.)
Aside from C/Mesa and the Binder, none of the three systems has any mechanism for describing how parts are put together to form a whole. C/Mesa fails to cover certain crucial aspects of initialization and parametrization -- there is no way to pass parameters from a C/Mesa program to initialization code, for example, in lieu of supplying them directly when the program initializes itself. Lisp allows programs to load other programs as part of their initialization, and several large systems have more elaborate mechanisms of their own for doing this, but there is no system-wide machinery of this kind.
(T8)000Source-language debugger
All three systems have adequate source-language debuggers. All of them could profit from additional work, since there are ideas in each one that are not present in the others: for example, the REVERT feature in Lisp, the ability to point directly to the source text on the screen in Mesa, and the Smalltalk method for displaying local variables.
(P1)121Text objects and images
Lisp already has a package (TXDT) for manipulating documents with formatting on individual characters (font, bold/italic, etc.). However, TXDT has no provisions for paragraph-level formatting or tables, and there is no software to convert to or from Bravo or Press files. These defects are minor. Facilities for manipulating text images as images are provided within DLISP. Documentation for the formatting aspects of TXDT, and for all of DLISP, does not currently exist, although the latter is being worked on.
No comparable package exists in Mesa, although Laurel and other systems have had to provide some of these functions. Diamond probably has an internal package that provides these capabilities, but it runs in a highly tailored environment (it doesn’t even use the standard Mesa runtime system). When and if Diamond is converted to run under Pilot, this problem may disappear.
Smalltalk provides the notion of a formatted paragraph, and facilities for editing, displaying, and selecting within it, in the standard system. Smalltalk also provides conversion to and from Bravo format, and to Press format. Smalltalk does not provide paragraph-level formatting or tables, and its facilities for handling text images in any but the most straightforward way are poor. Again, these defects are relatively minor.
(L18)021Uniform screen management
Lisp already possesses an elaborate and functionally rich screen management package, DLISP. As noted above, DLISP is still being documented. It does seem to satisfy our principal desire, namely that programs access the display only through an interface that makes sharing and allocation of the physical screen invisible to them; we are not certain whether it imposes too much structure on the user’s view of the display, to the extent that some kinds of experiments might be difficult or impossible (no such difficulties have arisen in the few applications attempted thus far).
Several attempts have been made at creating a screen management package in Mesa; all have failed to gain acceptance, for a variety of reasons. We believe that it will be necessary to start from scratch, taking into account the experience with the failed models and with the more successful ones of Lisp and Smalltalk.
Smalltalk has the opposite problem: accessing the screen in an anarchic way has been too easy. Some moderately successful interfaces have emerged -- one for windows, one for documents, and one under development for graphics -- but there is still a substantial need for unification of what has been learned.
(L8)202User access to the machine’s capability for packed data
Lisp and Smalltalk, unlike Mesa, take the view that all data accessible to the programmer are pointers. Intrinsically non-pointer data, such as string characters, are handled with various subterfuges. To obtain the benefits of packed data within these two systems would require extending the storage management system to be able to allocate and deallocate such objects, and extending the compiler to generate instructions to access them under safe conditions. The Lisp "record package" accomplishes some of this, but in a way that is poorly integrated with the rest of the storage management system and makes use of what we consider impermissible loopholes in the compiler. Smalltalk has no such facility at all, although the Smalltalk implementors have discussed it and believe they understand in principle how to do it without structual changes in the system.
(L10)111Run-time availability of all information derivable from source program (e.g. names, types, scopes)
All three systems make most of the source information available in some form at runtime. In Lisp, the facilities for retrieving source information are very good, but they do not handle declarations and variables with the same ease as functions. In Mesa, the relevant data structures (in the symbol tables produced by the compiler) are not currently documented for public use. In Smalltalk, the information required to correlate the dynamic environment with the names used in the program exists but not in convenient form. Mesa’s facilities for correlating the PC with a point in the source program are much better than either Lisp’s or Smalltalk’s.
(X2)222CSL control over the system’s future
The basic problem here is that all three systems are currently enjoying a great deal of support by groups other than CSL, which however have priorities different from ours. We would have to provide this support if we were to choose any of these systems as an EPE base. The difficulty code reflects the investment in learning time and ongoing manpower required for such support.
CSL certainly has control over the Dorado Lisp system, and over the Lisp-coded parts of the Tenex implementation. However, our real control over Lisp’s future is hampered by our desire to maintain compatibility with a large number of outside Interlisp users so we can benefit from mutual exchange of programs. Against this we must weigh the benefits of tailoring Lisp to our high-performance, display- and communication-oriented personal computer environment. (We also have the option of going in what we think are the best directions technically and hoping we can drag the rest of the world along with us.)
In the case of Mesa, the conflicting factors are our desire to benefit from the large amount of work that SD will be doing on the language and system, and the differences between our needs and theirs.
LRG’s plans for Smalltalk agree with our desires in many areas, but again their priorities are different. In particular, they are much more interested in small systems and in computer-naive end users.