正在加载图片...
1108 EMULATING OBJECT TECHNOLOGY IN NON-O-O ENVIRONMENTS $34.4 Anyone interested in the progress of programming languages-even people who do not care too much for the language itself-has a political debt to C,and sometimes a technical one as well: Politically,C ended the fossilized situation that prevailed in the programming language world until around 1980.No one in industry wanted to hear(particularly after the commercial failure of Algol)about anything else than the sacred troika, Fortran for science,Cobol for business and PL/I for true blue shops.Outside of academic circles and a few R&D departments,any attempt at suggesting other solutions was met with as much enthusiasm as if it were a proposal to introduce a third brand of Cola drink.C broke that mindset,making it acceptable to think of the programming language as something you choose from a reasonably broad and evolving catalog.(A few years later,C itself became so entrenched that in some circles the choices seemed to have gone from three to one,but it is the fate of successful subversives that they become the new Establishment.) Technically,the portability and machine-closeness of C have made it an attractive solution as a target language of compilers for higher-level languages.The first C++ and Objective-C implementations used this approach,and compilers for many other languages,often having no visible connection to C,have followed their example The advantages for the compiler writers and their users are:portability,since you can have a single C-generating compiler for your language and use C compilers (available nowadays for almost any computer architecture)to take care of platform dependencies;efficiency,since you can rely on the extensive optimization techniques that have been implemented in good C compilers;and ease of integration with ubiquitous C-based tools and components. With time,the contradiction between the two views ofC-high-level programming Kernighan 1978]. language,and portable assembly language-has become more acute.Recent evolution Kernighan 1988] of the ANSI standard for C(first published in 1990,following the earlier version known as KeR from the authors of the first C book,Kernighan and Ritchie)have made the language more typed-and hence less convenient for its use as a compiler's target code. It has even been announced that forthcoming versions will have a notion of class, obscuring the separation from C++and Java. Although an O-O extension of C simpler than C++and Java may be desirable,one can wonder whether this evolution is the right one for C;a hybrid C-based O-O language will always remain a strange contraption,whereas the idea of a simple,portable, universally available,efficiently compilable machine-oriented language,serving both as a target language for high-level compilers and as a low-level tool for writing very short routines to access operating system and machine-dependent facilities (that is to say,for doing the same thing that assembly language used to do for C,only at the next level) remains as useful as it ever was.1108 EMULATING OBJECT TECHNOLOGY IN NON-O-O ENVIRONMENTS §34.4 Anyone interested in the progress of programming languages — even people who do not care too much for the language itself — has a political debt to C, and sometimes a technical one as well: • Politically, C ended the fossilized situation that prevailed in the programming language world until around 1980. No one in industry wanted to hear (particularly after the commercial failure of Algol) about anything else than the sacred troika, Fortran for science, Cobol for business and PL/I for true blue shops. Outside of academic circles and a few R&D departments, any attempt at suggesting other solutions was met with as much enthusiasm as if it were a proposal to introduce a third brand of Cola drink. C broke that mindset, making it acceptable to think of the programming language as something you choose from a reasonably broad and evolving catalog. (A few years later, C itself became so entrenched that in some circles the choices seemed to have gone from three to one, but it is the fate of successful subversives that they become the new Establishment.) • Technically, the portability and machine-closeness of C have made it an attractive solution as a target language of compilers for higher-level languages. The first C++ and Objective-C implementations used this approach, and compilers for many other languages, often having no visible connection to C, have followed their example. The advantages for the compiler writers and their users are: portability, since you can have a single C-generating compiler for your language and use C compilers (available nowadays for almost any computer architecture) to take care of platform dependencies; efficiency, since you can rely on the extensive optimization techniques that have been implemented in good C compilers; and ease of integration with ubiquitous C-based tools and components. With time, the contradiction between the two views of C — high-level programming language, and portable assembly language — has become more acute. Recent evolution of the ANSI standard for C (first published in 1990, following the earlier version known as K&R from the authors of the first C book, Kernighan and Ritchie) have made the language more typed — and hence less convenient for its use as a compiler’s target code. It has even been announced that forthcoming versions will have a notion of class, obscuring the separation from C++ and Java. Although an O-O extension of C simpler than C++ and Java may be desirable, one can wonder whether this evolution is the right one for C; a hybrid C-based O-O language will always remain a strange contraption, whereas the idea of a simple, portable, universally available, efficiently compilable machine-oriented language, serving both as a target language for high-level compilers and as a low-level tool for writing very short routines to access operating system and machine-dependent facilities (that is to say, for doing the same thing that assembly language used to do for C, only at the next level) remains as useful as it ever was. [Kernighan 1978], [Kernighan 1988]
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有