Nothing else I could spend my time on could do so much good to so many people.

-Bjarne Stroustrup

coding_professor

人物简介

Bjarne Stroustrup(比雅尼·斯特劳斯特鲁普)博士,1950年出生于丹麦,先后毕业于丹麦奥尔堡大学和英国剑桥大学,AT&T大规模程序设计研究部门负责人, ACM 院士 ,德州農工大學工程学院的计算机科学首席教授 。
1979年,Bjarne开始研发一种支持面向对象抽象的C语言,之后被命名为C++。经过三十年的发展,凭借为众多主流项目(比如Windows)提供高效可用的语言工具, C++已经成为应用最广泛的面向对象编程语言。发明C++之后, Bjarne并没有停下脚步,而是一直致力于积极推动C++ 走向标准化,1998年 ANIS/ISO 颁布C++国际标准,标志着Bjarne多年的理想得以实现。期间Bjarne著有诸多著作, 其中<<The C++ Programming Language>> 被译成19种语言广泛传播。 三十多年来Bjarne 在C++领域孜孜不倦的努力,获得的社会各界的肯定与众多荣誉。Bjarne荣获1990年《财富》杂志“全美12位最年轻的科学家”称号。1993年,ACM年度 Grace Murray Hopper大奖,ACM院士。以及2005年Sigma Xi 颁发的William Procter 科学成就大奖,等诸多奖项。


2012年5月, Bjarne访问丹麦,并在DTU举办C++11 推广讲座。 作为丹麦最大的华人专业人士社团ACED有幸采访了这位 C++ 的发明者,其间谈及多个话题:从C++的诞生过程,到标准化实施进程。从语言本身的高效和移植性到它流行的外因与内因。同时我们也探究是什么样的信念支撑这位大师一路走来,三十多年如一日? 大师的一天又是如何度过的呢?请看下面的专访总结:


ACED专访 Bjarne Stoustrup

1. What character of the language itself makes C++ such popular in the industry ?

Its range of applicability, its performance, its flexibility, its portability the many examples of elegant code, and its stability over decades. For examples of C++ use, see the application list here and “The Programming Languages Beacon” here.Of course, C++ is not perfect. Anyone who claims to have a perfect language is either a fool or a salesman.

2. What character of the language itself make C++ so efficient and thus save CPU circles?

C++ has a direct and efficient model of hardware – there is no “virtual machine”, “interpreter”, or expensive language primitives between the programmer and the machine. On top of that, C++ provides mechanisms for defining elegant and efficient abstractions. The result – in the hands of competent developers – C++ delivers unmatched performance. There is no need to introduce overheads of bloated libraries.


3. What is done to C++ in order to maintain a good portability between a big variants type of hardware ?

A precise specification is necessary for porting between independent implementations and across varying hardware and operating systems. Standards conformance does not in itself guarantee portability because C++ allows you to take advantage of specific features of a system, but it makes porting manageable.

The basic and effective technique for building a portable system is to define a set of simple abstractions (classes, templates, etc.) with interfaces that can be used portably and that can be efficiently implemented on a wide range of hardware and operating systems, and then build the rest of the portable system on top of those.

4. What technology trend/products back in time, makes C++ such popular in the industry?  Do you see Windows as one of the reason ?

In 1979, I became acutely aware of implications of what is now known as Moore’s law. Hardware was getting faster and was likely to keep getting faster for many years. Simpler machine interfaces that could serve a variety of uses (e.g. Fortran and C-like languages) would consistently outperform more sophisticated (e.g., higher-level, safer, language specific) but also more complex and specialized interfaces. So, I decided to build on compiler technology, rather than machine architecture. Before that, I had focused on direct hardware support for higher-level languages and systems.

My work with C++ involved providing efficient abstraction mechanism and a simple, efficient mapping to hardware.

I did not think of Windows when I started with C++; I used Unix. However, when Widows appeared, C++ was efficient enough to provide abstractions on the very slow and memory-constrained hardware of the time (1MHz and 640MB). As hardware improved, I found that human expectation consistently outpaced the improvements in hardware performance, so that a language that could deliver efficiency was always needed for many important uses. C++ is used on all systems where people need performance and have resource limitations.



5. During your work to create the first version of C++, what was the major difficulty that you have to face and find a way out when you design this language? And how was it resolved?

I needed a fundamental model for the language. Earlier languages for systems programming had very weak abstraction mechanism. Remember, the use of C to write a portable operating system was still very new and not universally accepted. Languages with abstraction mechanisms tended to be very slow in comparison and garbage collection. Combining the low-level, machine-near view (from C and similar languages) with the classes (from Simula) was the key design problem.

I solved it by a combination of features: function argument checking and conversions for functions (C adopted this in the form of “function prototypes” a few years later) to get better basic interfaces, classes as purely compile-time entities based on the C structs but with the expressive power of Simula classes.

I had deemed garbage collection infeasible on the grounds of performance, predictability, interoperability with C, and ease of porting. Also, I needed to find a way to establish invariants (“to construct the run-time environment for member functions’’). My solution was constructors (that can acquire resources) and destructors (that can implicitly release resources).

A couple of years later, I added virtual functions based on the simple and efficient model of virtual function tables.



6. C++ has gone a long way for standardization. What takes it so long for standardizing C++?  Who are the major stakeholders?

It takes time to establish the consensus required for an ISO standard. For most languages that have a formal standard, the revision cycle is about a decade. A consensus is necessary to get a standard that everyone will actually use. You can’t just make a standard and hope that people will use it. The participants in the standards process are large companies (often platform providers), small companies (often library and tools builders), and individuals (typically practicing programmers. You’ll recognize some of the big names: Apple, HP, IBM, Intel, Microsoft, Oracle, Red Hat. There are also a few academics and end users tend to be underrepresented. About 200 people participate regularly, mostly via the web. All committee papers can be found at the committee website. To learn more about C+11 (the new standard) and the standards process, see my C++11 page here.

7. What is your major effort now with ISO, after C++11 is published?

I have to help people understand how to use C++ and the benefits from using C++ as a modern programming language. To that end, I give talks (such as “Cpp11-Style” and the talks I just gave in Denmark), write papers (such as “Software development for Infrastructure”), work on a new version of TC++PL, and do some research into new language features and libraries. The ISO C++ standards committee is currently very active with new ideas.

If you use C++ as if it was 1988, you are wasting a lot of time and effort and will come up with inferior solutions. Progress has happened.

8. What kind of spirit is it, that can support you to keep your interest on C++ Standardization for 20+ years?

Nothing else I could spend my time on could do so much good to so many people.

9. Could you describe what do you do for a typical working day ?

I doubt there is a typical day. Some days, I lecture at my university. Some days, I do research with my graduate students and fellow professors. Some days, I work on proposals for improving C++. Most days are a mixture of all of those. I go to work in the morning after dealing with the trivial part of my morning mail and reading the news on my laptop. I come home for dinner and typically put in another couple of hours in the evening. I listen to music and read non-technical books. Sometimes I run to get some fresh air and exercise. I travel too much, going to standards meetings, conferences, and visits to individual universities or businesses. That kind of travel is essential for me to keep up with what problems are faced by a wide variety of programmers.

采访人:

ACED PR

姚大威

Tags: , ,

Categories: 协会公告