The father of STL is interviewed (the large number of two thousand words)

zhaozj2021-02-08  560

The father of STL is interviewed in March 1995, Dr.Dobb's Journal, the famous technical book writer Al Stevens interviewed STL founder Alexanderstepanov. This interview record is the most complete introduction to the history of STL development, Mr. Houjie His STL is recommended to read this article. So I translated this full text as follows:

Q: You have a long study for Generic Programming, please talk about it. A: I started to consider the problem about GP is at the end of the 7o year, I noticed that some algorithms did not depend on the specific implementation of the data structure, and Just relying on several basic semantic properties of this structure. So I started researching a large number of different algorithms, and the results have found that most algorithms can be abstract from a particular implementation, and the efficiency is not damaged. For me, efficiency is Vocation, if an algorithm is abstract in instantiation, it will lead to a decline in performance. At that time, I thought that the correct direction of this study was to create a programming language. I started with my two friends. And now the current New York State University Professor Deepak Kapur, the other is the professor of the Lenrier Institute of Technology. At that time, we worked at the General Electric Appliance Research Center. We started designing a language called Tecton. There is a thing we call "universal structure", in fact, it is just a collection of forms and attributes, and people can use it to describe algorithms. For example, some mathematical structures allow people to define an algebraic operation, fine Chemically, expand, do a variety of things. Although there are many interesting ideas, the final study did not achieve any practical results, because the Tecton language is a functional language. We believe in the concept of Backus, I believe you can program From the Von Neumann style, we don't want to use the sub-effect, which limits our ability because there is a large number of algorithms such as "status", "sub-effects".

I realized an interesting question in TECTON in the late 1970s: The extensive Accepted ADT concept has fundamental defects. People usually believe that ADT is characterized by only exposing object behavior, and will hide. One action The complexity is considered to be related to the relevant attributes, so it should be ignored when abstract. I realize that when considering a (abstract) operation, the complexity (or at least a complexity of the general concept) must be At the same time, it is considered. This is now one of the core ideas of GP.

For example, an abstract stack stack type, only ensures that your push go in, it is not enough to be POP, the same extreme is important, no matter how large stack is, your PUSH operation must be completed within the constant time. If I write A Stack, every Push is slow, then no one will use this rotten play.

We have to separate the implementation and interface, but you can't completely ignore complexity. The complexity must be, and it is indeed the inconspicization contract between the user and the implementation of the module. The introduction of the ADT concept is to allow software The modules can be replaced with each other. But unless otherwise complexity is similar to this module, you will definitely don't want to achieve this interchange. If I replace the original module with another module and provide exact same interface and behavior, But the complexity is different, then the user is definitely unhappy. Even if I spend the advantage of the abstract achievement, he is definitely not happy. Complexity must be considered part of the interface.

Around 1983, I transferred to New York Brooklyn Technology. Beginning to study the algorithm of the map, the main partners are now IBM's Aaron Kershenbaum. He is an expert in the map and network algorithms, I have made him believe in high order (High Order) and GP can be applied to the algorithm in the figure. He supports me to work with him to start using these ideas for the actual network algorithm. The algorithm of some pictures is too complicated, only the theoretical analysis, never It is achieved. He attempted to establish a toolbox containing high-order general components, so some algorithms can be achieved. I decided to use a variant of the Lisp language to establish such a toolbox. We have established a huge The library shows various programming techniques. The network algorithm is the primary goal. Soon, the David Musser in General Electric is added in the universal electrical appliances, and more components have been developed, a very large library. This library is undergraduate Use, but never commercialization. In this work, I learned that the sub-effect is very important, disapproval, you can't figure out the picture. You can't change a endpoint (Vertex) every time you change On the top of the map. So, the experience you get at the time is to combat the high order technology and deputy efficiency when implementing a general algorithm. The sub-effect is not always bad. It is only when it is used in the wrong use. 1985 Xia, I Back to General Electric Teaching Course with high-ascending programming. I showed the application of this technology when component complex algorithm. There is a class name called Chen, which is the director of the Information System Lab. He asked if I can Implementing these technologies with ADA language, forming a library of industrial strength, and represents support. I am a poor teaching, so I don't know what I know about ADA, I still answer "good". I have Dave Musser. Establish this ADA library. This is a very important period, from the strong type language of the dynamic type language like Scheme, so that I realize the importance of strong types. No one knows strong The type helps to correct. I found that in the universal programming of the ADA, the strong type is a powerful tool for getting design ideas. It is not only the error tool, but also the ideological tool. This work gives me to make the component space The concept of decomposition. I realize that the software components each belong to different categories. OOP's fanatics believe that everything is object. But I realized that this is not right in the ADA General Library. It is not a matter. Object, it is an algorithm. In addition, I also realized that through Decompose components to several different directions, we can reduce the number of components, more importantly, we can provide a conceptual framework for design products.

Subsequently, I got a job in the Bel laboratory C group. They asked if I could do something similar to C . I still don't understand C , but of course, I said to me. Result I can't, because in 1987, there is no template in C . This play is a necessity in common programming. The result has to use inheritance to obtain versatility, obviously not ideal.

Until now the C inheritance mechanism is not used in universal programming, let's say why. Many people want to use inheritance to achieve data structures and containers, and the result is almost all unattime. C inheritance mechanism and related programming style have dramatic Limitations. With this way, universal programming, even if you are trying to determine the small problems of this class, if you use the X class as the base class, you have designed a virtual function operat ==, accept a X-class object, and Derive class Y, then y's operator == is compared to the Y class object with the X class. Take an animal as an example, define an Animal class, derived a Giraffe class. Define a member function Mate (), implementation A mating operation of a mammal, returns an Animal object. Now look at your derived Giraffe, and it is of course a MATE () method, and the result is a giraffe mating, returns an animal object. What is the body? Of course, For C programmers, the mating function is not that important, but Operator == is very important.

To deal with this problem, you have to use templates. With template mechanisms, everything is willing.

Although there is no template, I still got a huge algorithm library, and later became part of UNIX System Laboratory Standard Component Library. In Bell Lab, I am from Andy Koenig, Bjarne Stroustrustrup (Andrew Koenig, President of the Former ISO C Standardization Committee; Bjarne) Stroustrup, C Parent - Translator) This kind of expert learns a lot. I realize that C / C is important, and some of their success cannot be ignored. Especially my new pointer is a good stuff. I am not an empty pointer or pointing to the stack. I said that the general concept of the pointer. The idea of ​​the address is widely used. No pointer us can't describe the parallel algorithm. We now discuss why why C is a great language. Usually people think that C is a programming tool and has been successful because UNIX is written with C. I don't agree. The computer architecture is the result of long-term development, not which smart People have created. In fact, the majority of programmers have promoted those genius to propose these systems in the process of solving practical problems. Computers have passed multiple evolution, now only need to process memory, linear addresses and pointers for byte address indexes. This evolution result is the natural reflection of people to solve the problem. Dennis Ritchie genius works C, which reflects the smallest model of the 30-year computer. C is not a tool at the time. But when the computer is used to handle various When the problem, C has become a very powerful language, which is very efficient when solving various problems in various fields. This is the mystery of C-portable, c is the best abstract model of all computers, and this The abstraction is indeed built on the actual computer, not the imaginary computer. People can understand the machine model behind C, which is much easier than the machine model behind the ADA and Scheme language. C Success is because C is correct, not because AT & T's extreme efforts and UNIX.

The success of C is because Bjarne Stroustrup improves C with C, introducing more programming technology, but always remains within the machine model framework defined by C, rather than closed the door to make a new machine model. C The machine model is not easy. You have memory, the object is saved there, you have a pointer to continuous memory space, very well understood. C retain this model, but greatly expanded the category of the object in memory, after all The data type is too limited, it allows you to create a new type of structure, but you do not allow you to define type methods. This limits the ability of the type system. C has extended C machine model to a real type system.

In 1988, I went to HP Laboratory to work in Universal Bank Development. But I actually made a disk drive for a few years. I am very interesting but it is not related to GP. In 1992 I finally returned to the GP field, the Lab Director Bill Worley established An algorithm research project, is responsible. At that time, C already had a template. I found that Bjarne's template design is very talented. When Bell Lab, I greeted several early discussions about the design of the die design. It is very fierce with Bjarne. I think C template design should be seen to the General Program of Ada as much as possible. I think I may be too fierce. As a result, Bjarne decided to resolutely refuse my suggestion. I realized it in C . When setting the template function, then many people feel that it is best only template class. But I think a template function must explicitly instantiate before use, and the ada is like. Bjarne does not listen to me, he The template function is designed to be implicitly instantiated with an overload mechanism. Later, this special technology has become critical in my work. I found that it allows me to do a lot of tasks that are impossible in Ada. Very happy Bjarne Didn't listen to me.

Q: What is the first concept of thinking STL, what is the initial purpose? A: 92 years of projects were established by 8 people, gradually, more and less, the last two, I and Li Men, and Miss Li is a newbie in this field. In her professional research, the compiler is the main job, but she accepts the idea of ​​GP research, and firmly believes that this study will bring a big change to the software, know that there is There is very little recognition of this belief. No, I can't imagine I can get STL, after all, STL is labeled two people's name: Stepanov and Lee. We wrote a huge library, huge code, huge data structure Components, function objects, adapters, and more. However, although there are many code, there is no document. Our work is considered a verification project, and its purpose is to figure out how can it make algorithm as universal as possible. It is still very efficient. We have been compared for a lot of time, and the results have found that our algorithm is not only most common, but the efficiency is as efficient as handwritten code, this program design style is not discounting! This library is constantly Growth, but it is difficult to say when it becomes a "project". STL is born is a good thing for a few things. Q: When, what is the reason to make you decide to make STL a ANSI / ISO standard C part ? A: 1993, Andy Koenig ran to Stanford to talk about C lesson, I looked at him about some related materials, I think he is really excited. He arranged me to go to San Jose to make a C Standard Committee Speech. The topic of my speech is the "science of C programming", speaking very reason to discuss, there are some basic elements that must be followed by some C . I have given some examples, such as constructing Function, assignment operation, equal operation. As a language, C has no restrictions. You can use Operator == () to make multiplication. However, equal operation should be equal. It must be self-transfection, A == a It has symmetry, A == b, b == a; it also has passed. As a mathematical aircraft, equal operation is a basic element for other operations. Constructor and equal operations There is a rodborn thing. You have generated a new object with a copy constructor, then this object is equal. C is not forced to do, but this is what we must comply with this rule. Similar The assignment operation must also produce equal objects. I showed some "axiom" of basic operations, I also talked a little iterative (ITE Rator), and some general algorithms how to work with iterators. I think it is a two-hour boring speech, but it is very popular. But I didn't want to put this Sitle in the standard. After all, it is Too advanced programming technology, probably not suitable for appearing in the real world, I am afraid that those who do practical work are not interested.

I did this speech in September, until the following year (1994) month, I didn't move to ANSI standard. On January 6th, I received a letter from Andy Koenig (he was standard at that time. Document project editing), the letter says if I want STL to become part of the standard library, can submit a proposal to the Committee before January 25. My answer is: "Andy, are you crazy?", He replied "Yes, I am crazy, why don't we try it?"

At that time, we had a lot of code, but there was no document, there was no formal proposal. Miss Li and I work 80 hours a week, I finally wrote a formal proposal before the deadline. When it is also, only Andy knows What might happen. He is the only supporter, he does provide a lot of help in that day. We will send it out, then wait. We have done a lot during the process of writing suggestions. You wrote a thing, especially if you think that you can write, you will find all the leaks in the design. After sending the standard, we have to rewrite the code in the middle of the library, and hundreds. The components have been re-revised by the San Diego meeting in March. Then we re-revised the proposal, because we found a lot of flaws in the middle of the proposal. Q: You can describe the debate in the Committee ? I suggest it to be supported, or opposed? A: I can't expect anything. I made a report, my response is very good. But there are many opposition. The main opinion is: This is a copy The huge suggestion, and it has been too late, and the resolution has been made at the previous meeting, and this thing is not accepting any big suggestions, including a lot of new play. The result of voting is very interesting. The overwhelming comments are considered to be re-considered, and the voting is postponed until the next meeting, which is a well-known Waterloo meeting.

Bjarne Stroustrup became a strong supporter of STL. Many people have gave help through suggestions, changes and revisions. Bjarne simply ran to this to work with us a week. Andy is even more helping us. C is a complex language that does not always know exact meaning. Almost every day I have to ask Andy and Bjarne C to do this. I have to pay special honors to Andy, which is part of the STL as part of the C standard library; and Bjarne has become the main advocator of STL in the committee. Other people who want to thank: Mike Vilot, the person in charge of the standard library group; Rogue Wave's Nathan Myers (Rogue Wave is the provider of STL scheme in Boland C Builder, Andersen consults Larry Podmolik. There are still many people to thank.

The STL proposed in San Diego is actually C at the time, we are required to rewrote STL with new ANSI / ISO C language characteristics, and some are not implemented. In order to correctly use these new, unreal C features, Bjarne and Andy spend the time that is not countless to help us.

It is desirable that the container is independent of memory mode, which is too much because the language itself does not include memory mode. So we have to think about some mechanisms to abstract memory mode. In the early versions of STL, it is assumed that the volume of the container can be represented by the SIZE_T type, and the distance between the iterative sons can be represented by PTRDIFF_T. Now we are told, why do you not abstract these types? This requirement is relatively high, and the language itself does not have an abstraction to define these types, and the C / C array cannot be defined by these types. We invented a mechanism called "allocator" to encapsulate information about memory mode. This mechanism profoundly affects each component between the library. You may be confused: What is the relationship between memory mode and algorithm or container class interface? If you use Size_t, you can't use the T * object because there are different pointer types (t *, t huge *, etc.). This way you can't use the reference, because the memory mode is different, there will be different reference types. This will lead to a huge branch of the standard library.

Another important thing is that our original associated type data structure is expanded. This is relatively easy, but the most standards are always difficult because we do what we do will use many years. From the point of view of the container, STL has made a very clear two-point design. All containers are divided into two types: sequential and associated, like conventional memory and memory in content. The semantics of these containers are very clear. When I went to Waterlu, Bjarne used a lot of time to comfort me, don't be too embarrassed, because I didn't seem to succeed, but we did it after all. We tried it, so we should face it calmly. The expectation of success is very low. We estimate that most of the opinions will be opposed. But in fact, there is indeed some objection, but do not take up the wind. The results of Waterloo voting make people fall in glasses, 80% are spoiled, 20% opposition. Everyone expects to have a fierce battle, a big argument. The result is an argument, but voting is overwhelming.

Q: What is the impact on the class libraries in the ANSI / ISO C work file issued in February 1994? A: STL is placed in the work file of the Waterloo meeting. The STL document is broken down into several parts, placed in different parts of the file. Mike vilot is responsible for this matter. I have not participated in the editorial work, or even members of the C committee. But every time I have considered it. The committee is considered or is still very thoughtful.

Q: The Committee later made some changes related to the template mechanism, which affects STL? A: There are two changes to the STL before STL is accepted. One is that the template class adds the ability to include a template function. STL has widely used this feature to allow you to build a container of various receiving containers. A separate constructor allows you to build a vector to accommodate List or other containers. There is also a template constructor that constructs a container object from an iterative subsequent, you can use a pair of iteration as a parameter to pass it, which is used to construct a new container object. Another new feature used by the STL is to pass the template itself as a template parameter to the template class. This technology is used in the Allocator just mentioned.

Q: STL affects the template mechanism? A: In the Meetings of the Fosgia Valley, Bjarne recommends adding a "partial specialization" feature to the template. This feature allows many algorithms and class efficiency, but also brings problems in code volume. I studied for a while with Bjarne in this suggestion. This proposal is to make STL more efficiently. Let's explain what is "local specialization". You now have a template function SWAP (T &, T &, Used to exchange two parameters. But when t is some special type parameters, you want to do some special things. For example, for SWAP (INT &, INT &), you want to use a special action to exchange data. This is impossible in situations where there is no local specialization mechanism. With a local specialization mechanism, you can declare a template function as follows: Template void swap (Vector &, Vector &);

This form provides a special way to the SWAP operation of the VECTOR container. This is very important from the perspective of performance. If you use a universal form to switch your vector, three assignments are used, and the Vector is copied three times, and the time complexity is linear. However, if we have a local specialized SWAP version to exchange two vectors, you can get a time complexity constant, very fast, as long as the two pointers in the vector header are OK. This can make the Sort algorithm on the Vector run faster. There is no local specialization, let a special vector, such as Vector is the only way to run the programmer to set a special SWAP function, this line is, but aggravates the contractor's burden . In most cases, local specialization mechanisms can make algorithms more efficient in some general classes. You have the most universal swap, less universal SWAP, more uncommon swap, completely special SWAP such overloaded SWAP, then you use local specialization, the compiler will automatically find the closest SWAP. Another example is COPY. Now our Copy is copied one by one by iteration. Use template specialization to define a template function: Template t ** Copy (t **, t **, t **);

This can be implemented using Memcpy to be efficiently copied, because it is a pointer copy, we can do not worry about constructive objects and destructure objects. This template function can be defined once and then used throughout the library, and the user does not have to worry. We use local specialization to handle some algorithms. This is an important improvement, according to my knowledge, I have received praise in the Foshan Valley meeting, and will become part of the standard in the future. (Later indeed became a standard part - translator)

Q: In addition to the standard library, STL is the most useful place for the application of that class? A: I hope that STL can guide you to learn a new programming style: universal programming. I believe this style is suitable for any type of application. This style is: write algorithms and data structures in the most common way. The semantic characteristics required by these structures should be clearly classified and classified, and the principles of these categorized classifications should be satisfied. Understanding and developing this technology is still a long time, STL is just the starting point of this process. We will ultimately have a standard classification for general components that have carefully defined interfaces and complexity. Programmers will not be able to program at the microscopic level. You don't have to write a two-point lookup algorithm. That is, STL has also provided several general two-point lookup algorithm, and these algorithms can be used in the case of two-point lookup algorithm. The prerequisites required by the algorithm are very small: you just use it in your code. I hope that all components can have such a day. We will have a standard classification, people don't have to repeat these work.

This is the dream of Douglas MCILROY, and he is in the famous article in the "component factory" in 1969. STL is an example of this "component factory". Of course, there is also the need to have mainstream power to intervene in this technology. The light is not working in research machine. The industry should want to provide components and tools to help them find the components needed, bonding the components together. Then determine whether the complexity reaches expectations.

Q: STL does not implement a persistent object container model. Map and Multimap seem to be a better candidate, which can store objects into a persistent object database with an index. What do you do in this direction, or what comments do you have for this type? A: Many people pay attention to this problem. STL did not achieve persistence. STL is already the most acceptable library that can be accepted at the time. If you are bigger, I think the Committee will definitely not accept it. Of course, persistence is indeed a problem proposed. When designing STL, especially when designing allocator, Bjarne believes that the component encapsulated memory mode can be used to encapsulate persistent memory mode. Bjarne's insight is very important and interesting, several object database companies are staring at this technology. In October 1994 I participated in a meeting of Object Database Management Group, I did a speech. They are very interested in letting them are in the interface of the components in the group, but do not include allocator. However, certain members of the group carefully analyzed whether allocator can be used to achieve persistence. I hope that the component object persistence of the STL interface can appear in the next year. Q: Set, MultiSet, Map and Multimap are implemented with red black trees. Do you tries to use other structures, such as the B * tree to achieve? A: I don't think B * is applicable to the data structure in memory, but of course this matter should still be done. The standard interface of STL containers should be implemented in many other data structures, such as Skip List, SPLY TREE, Half-Balanced Tree, and the like. Such research should be made because STL provides a good framework that can be used to compare the performance of these structures. The opening is fixed, the basic complexity is fixed, and now we can make a significant comparison of various data structures. There are many people in the field of data structures to achieve different data structures, I hope they can use the STL framework to turn these data structures into common. (Translator Note: I think most of the data structures mentioned above is not urgent, and a STL does not provide but a truly important data structure is a hash structure. Later SGI * STL in Stepanov and Matt Austern et al. The three containers of Hashset, Hashmap, and Hashtable were added, making this STL implementation more. It is well known that the time complexity of the red-hahead is O (logn), and the Hash structure is O (1). Of course, if implemented Help, B tree is also necessary.)

Q: Does any compiler manufacturer work with you to integrate STL into their products? A: Yes, I received a lot of manufacturers of manufacturers. Borland's Peter Becker is very large. He helped me implement allocator components that correspond to all memory modes of the Borland compiler. Symantec is intended to provide a STL implementation for their Macintosh compiler. EDISON Design Group is also helpful. We have helped from most compiler vendors. (Translator Note: In the current STL version, the best is undoubtedly SGI * STL and IBM STL for AS / 390, all STL implementations under Windows are unsatisfactory. According to test data, Windows is best STL runs on PIII 500MHz far behind and runs SGI * STL running on a 250MHz SGI workstation (IRIX operating system). Taking me personal experience, Linux is also an excellent platform running STL. And in Windows STL implementation In again, the Rogue Wave STL of Borland C Builder is the worst, and the STL in Java2.visual C in JIT execution mode is the personal work of famous master PJ Plauger, which is better, but its Queue component Efficiency is very poor, caution) Q: STL includes support for the 16-bit memory mode compiler of MS-DOS, but the current focus is obviously on the 32-bit linear memory mode (FLAT MODEL) operating system and compiler . Do you think this plan for memory mode will be effective? A: Through the architecture of Intel, the memory mode is an object, encapsulated information about the pointer: What is the integer size and distance type of this pointer, what is the related reference type, and so on. If we want to take advantage of various memory, such as persistent memory, shared memory, etc., abstract work is very important. A very beautiful feature of STL is the only part of the entire library related to the machine type - representing the real pointer, the real reference component - is encapsulated into approximately 16 lines of code, all other, containers, algorithms, etc. Not related to the machine (really cattle!). From the viewpoint of transplantation, all and its related things, like addressing, pointers, etc., are packaged into a tiny, very well-understood mechanism. In this way, the Allocator is not that important for STL, at least as important as the decomposition of basic data structures and algorithms.

Q: ANSI / ISO C Standards Committee believes that such problems like memory models are platform-related, and there is no specific provisions for this. Will C members will take different attitudes? why? A: I think STLs are advanced compared to C standards at this point. However, there is a significant difference between C and C . C has constructor and new operators to deal with memory mode issues, and they are part of the language. It seems that it seems that it seems that the NEW operates in the STL container to work as allocate. But now the importance of the problem is not as significant before STL appears, because in most occasions, the STL data structure will make new unemployment. Most people no longer need to assign an array because STL is more efficient in this type of thing. To know that my superstition of efficiency is not added, but I never use new in my code, and the assembly code indicates that its efficiency is higher than when using New. With the widespread use of STL, New will gradually fade out of the rivers and lakes. And STL will always remember to recycle memory, because when a container exits the scope, its destructor is called, which will destructure all things in the container. You don't have to worry about the memory of the memory. STL can dramatically reduce the need for garbage collection mechanisms. With STL containers, you can deal with what you want, you don't have to care for memory, your own STL constructor and destructor. Q: The C Standard Lubu Council is developing a standard name space (Namespace) and an exception handling mechanism. Will the STL class be a name space? Will it be different? A: Yes. Several members of the committee are considering this, and their work is very excellent.

Q: How much difference is the STL now STL with the ultimate as a standard? Will the Committee do not interfere with certain changes, will the new design will be strictly controlled? A: Most people's opinions seem to do not want to make any important changes to STL.

Q: What kind of STL experience is the programmers before becoming a standard? A: They can use the STL header file from Butler.hpl.hp.com/stl to use it in Borland and IBM or other sufficiently strong compilers. The only way to learn this programming technology is programming, look at the example, try to use this technique to program.

Q: You are working with P. J. Plauger a book of STL. What is the focus of this book? When is it? A: Plan for 95 years in summer, the focus is the detailed explanation of STL implementation technology, with his books achieved by his standard C library and standard C libraries. He is the first author of this book. The book can be used as a reference manual for STL. I hope to cooperate with BJarne to write another book, introduce the interaction of language and libraries in the background of the C / STL.

A lot of work is waiting to do. For the success of STL, people need to conduct more experimental research on this programming technology, more articles and books should help. To prepare to open such courses, write some introductory guides, develop some tools to help people roam the STL library. STL is a framework that should have a good tool to help use this framework. (Translator Note: When he said this, he did not expect what happened in the next few years. Due to the big explosion of the Internet and the huge success of Java, VB, Delphi and other languages, the center of focus on the industry From the classic software engineering domain to the Internet. Add standard C until 98, completely meet the requirements of the requirements until now, STL has not immediately become the focus of people in people. He mentioned The book is also delayed, until a few days (after 2001 New Year's Day), the book has been expected by the book, and the four masters of PJ Plauger, Alexander Stepanov, Meng Lee, David Musser, Prentice Hall is published. However, the book mainly focuses on the implementation technology of STL, and does not apply to ordinary programmers. In addition, PJ Plauger is a description: whose people are one of the early realizes of Stdio library in standard C, one of 91 years About the standard C library book made him named the world. He is now the editor of C / C Use's Journal, maintains good relationship with Microsoft, even over-intimate relationship, STL in Visual C , some content is from him. The only splendid pen. However, because the relationship with MS has affected his neutral image, there are many people who have comments on him.

As for the book of STEPANOV imagination, at least I haven't heard it. In fact, these two are typical programming bails, with Ken Thompson and Dennis Ritchie are all the way, lazy to write books, often do a second author. If the written book is definitely the first author, it is also a college, and it is similar to the standard file. It is not suitable for general programmers reading. In the field of computer science, the programming of the master is a phoenix river, the most famous may be an alien D. E. Knuth, the C field, the first mentioned Andrew Koenig. Unfortunately, our Chinese programmers saw his book. )

Q: What is the relationship between universal programming with OOP? A: One sentence, common programming is the natural continuation of OOP basic idea. What is the basic idea of ​​OOP? Separate the assembly and interface and make components have polymorphism. However, there is still an fundamental difference. OOP emphasizes the syntax of language elements in the program construction. You have to inherit, use classes, use objects, objects to pass messages. GP does not care about you inherit or do not inherit, its start is the classification of the analysis, what kind of kind, how is their behavior. That is to say, what does two things mean? How do I correctly define equal operations? Not only the equal operation is then simple, you will find "equal" in deep analysis, this general concept means that the two object parts, or at least the basic part is equal, according to this, we can have a universal equivalent operation. Among the types of objects. It is assumed that there is a sequence sequence and a set of operations for sequence sequences. So what is the semantics of these operations? From the perspective of complexity weigh, what should we provide users with sequence sequence? What operations do this kind of operation? That sorting is what we need? Only the conceptual type class of these components is clear, we can mention the problem of implementation: use templates, inherit or macro? What languages ​​and technologies are used? The basic view of GP is to separate abstract software components and their behavior standard classification. The starting point is to build real, efficient and non-dependent algorithms and data structures. Of course, the final carrier is still a language, there is no language that cannot be programmed. STL uses C , you can also implement it with ADA, use other languages ​​to implement, the result will vary, but basic things are the same. It is necessary to use two points to find and sort everywhere, and this is what people are doing. For the semantics of the container, different languages ​​bring slight differences. However, the basic difference is clearly the semantics dependent on GP, ​​as well as semantic decomposition. For example, we decided to need a component SWAP and then point out if this component is in different languages. Obviously, focus is semantics and semantic classification. The OOP emphasizes (I think it is excessively emphasized) is a clear definition of hierarchical relationship. OOP tells you how to build a hierarchy, but did not tell you the essence of these relationships. (This paragraph is not understood, there are some terms that may have to have a suitable Chinese translation for a while - Translator) Q: How do you see the future of STL and GP? A: I just mentioned that the programmer Our dreams are a standard component warehouse, which has a good, easy to understand and standard interface. In order to achieve this, GP needs to have a special scientific as a foundation and pillar. STL starts this work to some extent, which is semantically classified for some basic components. We have to have more efforts to this, and the goal is to convert software engineering from a craft technology into engineering disciplines. This requires a classification of basic concepts, as well as some of these basic concepts, these theorem must be easy to understand and master, each programmer can use it even clearly knows it. . Many people do not know the law at all, but as long as people go through the school, they know that 2 5 is equal to 5 2. I hope that all programmers can learn some basic semantic properties and basic operations: What does it mean? What does it mean? How to build a data structure, and so on.

Currently, C is the best carrier of GP. I have tried other languages, and finally C is ideally reached with abstract and efficient unity. But I think it is possible to design a language, based on C and many C excellence, and more suitable for GP. It doesn't have some defects of C , especially if it is like C . STL processed things is concept, what is iterative, not class, not type, is concept. To be more formal, this is the structure type of Bourbaki, which is the concept of the concept of the logicalist, or the type of the type theoretical school (sort), this thing is There is no language level in C (the original inCarnation, translated as a flesh - translator), but there can be. You can have a language, use it you can explore concepts, refinement concepts, and finally use a very "programmed" (directly translated as program, here is the translator that meets programmer habits) Means turn them into classes. Of course, there are some languages ​​to handle species (sorts), but when you want to sort (sort), they are not used. We can have a language, use it we can define something called FoWard Iterator, in STL, this is a concept, no C counterparts. Then we can develop the Bidirectional Iterator from the Forword Iterator and develop Random Iterator. It is possible to design a language to simplify GP. I completely believe that the language is sufficiently efficient, and its machine model is fully close to C / C . I fully believe that it is possible to design a language, one hand as close as possible to the machine level to achieve absolute efficiency, and on the other hand, it is possible to handle very abstract entities. I think the abstraction of the language can exceed C , and it is partly seamless with the underlying machine. I think GP will affect the research direction of language, we will have a practical language suitable for GP. From these words, you should guess my next plan. MenGyan Translation in January 2001

转载请注明原文地址:https://www.9cbs.com/read-286.html

New Post(0)