STL's father's visit (1)

xiaoxiao2021-03-06  76

Human Al Stevens Translator

Houjie Note: This article is the article in Beijing "programmer" magazine 2001/02. High readability, full technology. Mr. Mengyan and the person in charge of "Programmer" magazine, Mr. Jiang Tao, will be reproduced in Taiwan readers, thank you very much. Mr. Meng Ran's consent of Mr. Jiang Tao, please do not reprint this article. The following blue is question, black is an answer. Red is a translation, and purple is advisable to Houjie's individual. Light blue is the mystery mark when Houjie is read. The traditional Chinese language is directly transferred, and the mainland usual term is not converted to Taiwan's usual term.

In March 1995, Dr.Dobb's Journal, the famous technical book writer Al Stevens interviewed STL founder Alexander Stepanov. This interview record is the most complete introduction to the history of STL development, Mr. Houjie is in his STL Related Articles Recommend you to read this article. So I translated this article as follows.

Q: You have a long study for Generic Programming, please talk about it. A: I have begun to consider the issue of GP is in the late 7o year, I noticed that some algorithms did not rely on the specific implementation of the data structure. It is just a few 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 it is effective. For me, Efficiency is critical, if an algorithm is abstract, it is not good after it is, it is not stick. At the time, I thought the correct direction of this study was to create a programming language. I am with my two friends. Began to do it. One is the current New York State University professor Deepak Kapur, and the other is the Professor of the Lenilier Institute of Technology. At that time, we worked in the General Electric Companies Research Center. We started to design a language called Tecton. This language has something we call "universal structure", which is just a collection of forms and attributes, and people can use it to describe algorithms. For example, some mathematical general structures allow people to define an algebra. Operation, refine, 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, believe You can liberate the program from the Von Neumann style, and don't want to use the sub-effect, this limits our ability, because there are a lot of algorithms need to take advantage of the concepts such as "status", "sub-effect". I realized an interesting question in TECTON in the late 1970s: The concept of ADT has a fundamental defect. People usually believe that ADT is characterized by exposing object behavior, but 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 the complexity (or at least general concept of complexity) must be simultaneously in consideration of a (abstract) operation. Take into account. This is now one of the core concepts of GP. For example, an abstract stack stack type, only guarantees that your push go in, it is not enough, the same extreme is important, regardless of Stack How big is your PUSH operation, you must be able to do within the constant time. If I wrote a Stack, every Push is slower, then no one will use this rotten play. We have to separate the implementation and interface, but The complexity cannot be completely ignored. The complexity must be, and it is indeed the immunity between the user and the implementation of the module. The introduction of the ADT concept is to allow software modules to be replaced with each other. But unless the module Operation complexity is similar to this module, otherwise you will definitely don't want to interchange it. If I use another module to replace the original module and provide exactly the same interface and behavior, but the complexity is different, then the user is definitely unhappy. Even if I spend the advantages of the abstract achievement, he is definitely not happy. So the complexity must be considered part of the interface. For about 1983, I transferred to New York Brooklyn General University.

Start researching algorithms, the main partners are now IBM's Aaron Kershenbaum. He is an expert in the map and network algorithms, I have enabled him to believe in high order ideas and GPs can be applied to the algorithm He supported 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 implemented. He attempted to establish a general component containing high order Toolbox, 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 library, showing various programming technology. Network algorithm is the primary goal Soon, I was also added in the universal electricity David Musser, developed more components, a very large library. This library is used under the college, but never commercialization. In this work, I It is important to understand that the deputy efficiency should be very important. If you do not use the sub-effect, you can't figure out the picture. You can't change a node (Vertex) is on the map, so, the experience at the time is to implement a general algorithm The high order technology and deputy effect should be combined. The sub-effect is not always bad. It is only when it is used by the error. In 1985, I returned to the general appliance to teach the course about the design of the high-ascending program. I showed it. The application of this technology when the component complex algorithm. There is a class of people named Chen, which is the director of the Information System Laboratory. He asked if I can use the ADA language to implement these technologies, form a library of industrial strength, and express It can be supported. To know that I am just a poor teaching, I still answer "good" for ADA, I still answer "good". I have established this ADA library with Dave Musser. This is a very important period, from The dynamic type language like Scheme turns to the strong type of language such as ADA, so I recognize the importance of strong types. Everyone knows that the strong type helps to correct. I found that in the General Programming of the ADA. Strong type is a powerful tool for obtaining design ideas. It is not only the wrong tool, but also ideological tools. This work gives me the concept of orthogonal decomposition for component space. I realize that software components are different. Category. OOP's fanatic supporters think everything is object. But I realized that this is not right in the work of the ADA General Library. It is not an object. It is an algorithm. In addition, I also realize that by will Component space is broken down into a few different directions, we can reduce the number of components, more importantly, we can provide a conceptual framework for designing products. Subsequently, I get in the Bel laboratory C group. A job, special library research. They ask what I can do with C . Of course, I still don't understand C , but of course, I said to me. But the result is, I can't, because 1987 There is no template in C . This play is a necessity in common programming. The result has to use inheritance to get versatility, it is obviously not ideal. Now now the C inheritance mechanism is not used in general 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 styles have dramatic limitations. Use this way for universal programming, even "equation judgment" The small problem can not be solved. If you use a x-class as the base class, you have designed a virtual function operat ==, accept a X-class, and by X-derived class y, then Y's Operator == is taking Y class object Compared to the X object. Take an animal as an example, define an Animal class, derived a Giraffe class. Define a member function Mate (), implement the mating operation with another mammal, return an Animal object. Now look at you The derived class giraffe, of course, there is a MATE () method, and a giraffe has an animal mating, returns an animal object. What is the body? Of course, for C programmers, the mating function is not so important, but Operator ==

It is very important. To deal with this problem, you have to use the template. With the template mechanism, everything is willing. Although there is no template, I still get a huge algorithm library, and then become a part of Unix System Laboratory Standard Component Library. . In Bell, I learned a lot from ISTRUSTRUP (Andrew Koenig, former ISO C Standardization Committee; Bjarne Stroustrup, C Parent - Translator) These experts have learned a lot. I realize the greatness of C / C The place, some of their success cannot be ignored. In particular, I found that the pointer is a good stuff. I am not an empty pointer, or pointing to the stack of pointers, I said that the general concept of the pointer. The concept of address is widely used. It is impossible to use the concept of pointers. No pointer us can't even describe the parallel algorithm. Let's discuss why c is a great language. Usually people think C is a program cutlery and Success, because UNIX is written with C. I don't agree. We speak the language is the abstraction of the computer architecture, and the computer's architecture is the result of long-term evolution. It is not created by a smart person. In fact, the majority of programmers will be promoted in the process of solving practical problems. Those genius proposed these systems. The computer has elapsed, and now only needs to process the memory, linear address space and pointer of the byte address index. This evolution result is the natural reflection of people to solve the problem. Dennis Ritchie genius works C, It is reflecting the smallest model of the computer that has evolved for 30 years. C is not a tool at the time. But when the computer is used to handle various problems, the C became a very powerful language in various fields. It is very efficient when solving various problems. This is the mystery of C portability, C is the best abstract model of all computers, and this abstraction is indeed based on actual computers, rather than imaginary computers. People can easily understand the machine model behind C, which is much easier than the machine model behind the ADA and Scheme language. The success of C is because C is correct, not because Unix and AT & T are highly advocated. The success of C is because Bjarne Stroustrup improves C with C, although more programming techniques are introduced, but always remain within the machine model framework defined by C, rather than closed the door to make a new machine model Come. C machine model is very simple. 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 objects in memory, after all The data type of C is too limited, it allows you to create a new type of structure, but you don't allow you to define a type method. This limits the ability of the type system. C extension C's machine model is a real type system. I arrived in 1988 HP laboratory is engaged in universal library development work, but I actually made a disk drive for a few years, it is very interesting but it is not related to GP. In 1992 I finally returned to the GP field, and the Laboratory director Bill Worley established an algorithm The research project was responsible. At that time, C already had a template. I found that Bjarne's template design is very talented. In Bell, I added a few early discussions on template design, and I was very noisy with Bjarne. Fierce, I think C template design should be seen to the General Solution of Ada as much as possible. I think I may be too fierce. As a result, Bjarne decided to resolutely refuse my suggestion. At that time, many people feel that it is best to only template, and I realized that I need to set the template function mechanism in C .

However, I think a template function must be explicitly instantiated before use. It is like ADA. Bjarne does not listen to me, he is designed to design the template function to implicitly instantiate it. 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. I am very happy that Bjarne didn't listen to me. Q: When is you the first concert STL, initially What is the purpose? A: The project was established by 8 people in 92 years, gradually increasingly, and the last two, I and Li Mad, 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 large change to the software. I have to know that there is very little recognition of this belief. No her, I can't imagine me. Can get STL, after all, STL indicates two people's name: Stepanov and Lee. We wrote a huge library, huge code, large data structural components, function objects, adapter classes, and more. However, although there are many codes, there is no document, because our work is considered a verification project, its purpose is to make it clear that it can still be very efficient under the premise that the algorithm is usually as common as possible. We spent Many times comparison, the results 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 growing, but it is difficult to say when it becomes a "Project". The birth of STL is a good thing for a few things. Q: When is the reason for your decision to make STL a ANSI / ISO standard C part? A: 1993 Summer, Andy KOENIG ran to Stanford to talk about C lesson, I looked at him, I think he was really excited. He arranged me to give a speech from San Jose to the C Standard Committee. The topic of my speech is "C " The science of programming is very ruthless, and it is necessary to follow the principles of some C basic elements. I have given some examples, such as constructor, assignment operation, equivalent operation. As a language, C has no restrictions. You can use Operator == () to make multiplication. But equal operation should be equal. It must have anti-translocking, a == a; it has a symmetry, a == b == a; it also has passed. As a mathematical aircraft, equal operation is very basic for other operations. .

The connection between the constructor and the equal operation is in the inside. You have generated a new object with the copy constructor, then this object and the original one should be equal. C is not forced, but this It must be complied with this rule. Similarly, the assignment operation must also produce equal objects. I show some of the basic operations "axiom", I also talk about iterator, and how many general algorithms use iteratively Work. I think that is a two-hour boring speech, but it is very popular. But I didn't think about it in the standard. After all, it was too advanced programming technology, probably not suitable for In the real world, I am afraid that those who do practical work are not interested. I am doing this speech in September. I haven't been to the ANSI standard in September (1994). On January 6th, I received a letter from Andy Koenig (he was the editor of the standard document project), and the letter said if STL would become a standard library, you can submit one before January 25 Requirements to the Committee. My reply is: "Andy, are you crazy?", He replied: "Yes, I am crazy, why don't we try it out?" At that time, we had a lot of code, but no Document, there is no formal proposal. Miss Li and I have to work more than 80 hours a week, I finally wrote a formal proposal before the deadline. When it is also, only Andy knows what may happen. He It is the only supporter, and he does provide a lot of help in that day. We will send the suggestion. Then we have done a lot during the process of writing the suggestion. When you write a thing, especially It is to think that you may write a standard, 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 of components, until the San Diego meeting in March prior to. Since then, we re-amend the proposal, because we found a lot of flaws in the middle of the proposal. Q: Can you describe the debate in the committee? It is recommended to be supported, or Oppact? A: I can't expect anything. I did a report, my response was very good. But there were many oppositions. The main opinion is: This is a huge suggestion, and it is too late, the previous time At the meeting, the resolution has no longer accepts any big suggestions. This thing is the biggest suggestion ever, including a lot of new games. The results of voting are very interesting, overwhelming most comments, thinking about advice And postpone the voter to the next meeting, it is the next well-known Waterloo meeting. Bjarne Stroustrup became the strong supporters of STL. Many people have given help by suggesting 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 a C standard library; and Bjarne has also become the main advocator of STL in the committee. Other people who want to thank: the person in charge of the standard library group Mike Vilot; Rogue Wave's Nathan Myers (Rogue Wave is a provider of STL schemes in Boland C Builder, Larry Podmolik, Andersen Consulting. There are still many people to thank. STL proposed in San Diego is written in 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 properly use these new unrealized C features, Bjarne and Andy spent the time that is not countless to help us. It is desirable that the container is independent of memory mode, which is a bit too much because the language itself does not include memory mode. So we have to come up with some mechanisms to abstract memory mode. In the earlier versions of STL, we assume 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.

Someone now said to us, why are you not abstract? 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? In fact, if you use something like this, you can't use the T * object because there are different pointer types (near pointer far pointer giant pointer, etc.). You can't use the reference, because the memory mode is different, there will be different reference types. In this way, for practical, the standard library will have a huge branch. Another important thing is to extend our original associated type data structure. This is relatively easy, but it is always difficult as a standard thing, because people we do will use many years. From the point of view of the container, STL has made a very clear dichotomy 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 try to try it, so we should face it calmly. The expectation of success is very low. We estimate that most comments 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% agree, 20% against. Everyone expects to have a fierce battle, a big argument. The result is indeed arguing, 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 didn't have excessive places and editors, 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 that can accommodate List or other containers. There is also a template constructor that constructs a container object from an iterative score, you can use a pair of iterative pieces as a parameter to 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 number 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 numbers. But when t is some special types of 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 SWAP operation for the VECTOR container Special way. 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 faster to let the programmer 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 common 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. Look at a case about COPY. Now our Copy is copied one by one by iteration. Using template specialization can define a template function: Template t ** Copy (t **, t **, t **); this can be implemented with Memcpy to efficiently copy a series of pointers because it is a pointer copy We don't have to worry about the overhead of constructors and sectors. 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 what I know, I have been praised in the Foshan Valley meeting, and will become a standard in the future. 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 applicable to any kind of application. This style is: write algorithms and data structures in the most common way. The semantic characteristics required by these structures should be clarified and classified, and the principles of these categorization classifications should be any object. 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. He is in the name of the famous article in 1968 on the famous article (M. Douglas Mcilroy is now working in the Bell Lab Computer Science Research Center, the topic of the article Is Mass Products, now you can now find this papers in http://cm.bell-labs.com/cm/cs/Who/doug/components.txt. STL is an example of this "component factory".

Of course, there is still a need for mainstream power to intervene in this technology, and the research institution is not in the research institution. The industry should want to provide components and tools to help them find the components needed, bond the components together, then Determine whether complexity meets the expected requirements. 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 request for people. 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 added a meeting of Object Database Management Group, I made a speech about STL. 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 * trees apply the data structure in memory, but of course this matter should still be done. There should be a standard interface of STL containers such as a SPLY Tree, such as a SPLY Tree, or the like, such as a SPLY TREE. 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: Later, the Hash Structure Hash single-stranded table SLIST and giant string ROPE SLIST and giant string ROPEs are added in STEPANOV and MATTHEW AUStern et al., In order to implement STL object persistence, B tree may be added in the future. The time complexity of the red black tree is O (logn), and the ideal HASH structure is o (1).) Q: Is there any compiler manufacturer to 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: The currently common STL versions are: Borland C Builder used Rogue Wave STL; Visual C DINKUMWARE STL; GNU C and SGI Irix C SGI STL used.

SGI STL is STepanov and developed. It has been highly respected. Russian Boris Fomitchev even launched a SGI STL-based free project STLPORT to transplant SGI STL into a variety of mainstream compilation environments, please see http: // Www.stlport.org and http://www.sgi.com/technology/stl )q:STL includes support for the 16-bit memory mode compiler for MS-DOS, but the current focus is obviously linear in 32-bit 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 does not talk, the memory mode is actually an object, encapsulates information about the pointer: What is the integer size and distance type of this pointer, what is the relevant 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 representing a real pointer. The real reference component is encapsulated into approximately 16 lines of code, and everything else, container algorithm, etc. are not related to the machine. From the viewpoint of transplantation, all and its related things, like address, 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 the C committee will take different attitudes? why? A: I think STLs are advanced compared to C standards at this point. There is a significant difference between C and C . C has a constructor and a New operator to deal with memory mode issues, and they are part of the language. It is now goodbyday if you can make the New operations like the STL container to work like allocate. However, the importance of the problem now is not as obvious 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 will be famous space, will it throw an exception? A: Yes. Several members of the committee are considering this, and their work is very good. 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: How do programmers get some STL experience 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 STL's inspection manual. 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, did not expect what happened in the next few years. Due to the big explosion of the Internet and the huge success of the language of Java VB Delphi, the center of gravity of the industry from the classic The software engineering domain shifts to the Internet. Plus standard C until 98, fully meet the requirements of the compiler until now, STL has not immediately become the focus of people in people. The book 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 Publication. 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 implementors of Stdio library in standard C, one of 91 years The book of standard C library makes him named the world. He is now the editor of Dinkumware, the editor of C / C Use's Journal, maintains good relationship with Microsoft, and even exact relationships, STL in Visual C and some content It is from his spring. Http://www.dinkumware.com.) Q: What is the relationship between universal programming with OOP? A: What is the basic idea of ​​OOP? Separate the assembly's implementation and interface, and make components have polymorphism. In a word, common programming is the natural continuation of this basic idea of ​​OOP. 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 doesn't care about you inherit or don't inherit, its start is the classification of the analysis, what kind of kind, what is their behavior. That is to say, what does two things mean? How do I correctly define equal operations? It is not as simple as thinking. If you deepe, you will find "equal", this general idea means that the part of the two objects, or at least the basic part is equal, according to this, we can have a general purpose. Equal 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, should we provide users with sequence of sequence? What operations do this kind of operation? That sorting is what we need? Only the conceptual classification of these components is clear, we can mention the realization: use the template inheritance or macro? What languages ​​and technologies are used? The basic view of GP is to use the abstract software components and their behaviors to classify standards, starting points are to build real and 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 how this component works in different languages. Obviously, focus is semantics and semantic classification. The OOP emphasizes (I think it is over-emphasized) is a clear definition of hierarchical relationship between classes. 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 there will be a suitable Chinese translation translation translation) Q: How do you see the future of STL and GP? A: I just mentioned that the programmer Dreams are a standard component warehouse, which has a good understandable 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 does not know these theorem, it can also use it correctly. . 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, integrated 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 processing 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 corresponding item on the language level in C (the original is Incarnation, "directly translated into a flesh translator), but there can be. You can have a language, use it you can explore concepts, refinement concepts, and ultimately use a very "programmed" means to convert them into classes.

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

New Post(0)