GCC在2012年8月15日的时候,merge了一个patch - Merge from cxx-conversion branch,这意味着,之后在GCC的编译只能用C++的编译器了,也意味着,gcc的实现代码开始转向C++了。 html
你可能会有两个问题, git
那,咱们来看一看吧。 程序员
在GNU的C++ Conversion文档中,咱们能够在Background中看到这样的描述: web
Whether we use C or C++, we need to try to ensure that interfaces are easy to understand, that the code is reasonably modular, that the internal documentation corresponds to the code, that it is possible for new developers to write new passes and to fix bugs. Those are the important issues for us to consider. The C++ features which are not present in C – features which are well documented in many books and many web sites – are not an important issue. shell
这句话的意思能够理解为,今天GCC在用C语言的实现已经有点hold不住了,由于,开发人员以为,无论咱们用C或C++,都须要努力确保接口是容易理解的,这样咱们的代码是想当理性地被模块化的,这样内部文档和代码一致,这样能够更好地组织代码,这样有利于新人了fix-bug。而C++正好可让他们更好的完成这些东西。 编程
GNU还给出了下面这些理由: bootstrap
而后,给了一个PDF http://airs.com/ian/cxx-slides.pdf,这是Google 的 Ian Lance Taylor的的一个PPT,这个文档可让你们更好地理解我在《C++的坑多吗?》一文中那些观点。我都不知道我要说多少遍C++的封装,继承和多态比C语言在代码组织上要好得多得多。你们仍是本身看一下代码吧: 数据结构
数据结构的操做 —— 你写的必定不会有STL好 app
结构套结构仍是继承? 编程语言
函数指针仍是多态?
垃圾回收 仍是 智能指针?
Why not C++?
最后,我想来介绍一下Bootstrapping。 所谓Bootstrapping,就是用本身这个语言写编译器来编译本身,也就是说若是你要编译gcc,你须要用一个c的编译器来编译之,这个就是bootstrapped process,自举过程。包括 BASIC, Algol, C, C++, Pascal, PL/I, Factor, Haskell, Modula-2, Oberon, OCaml,Common Lisp, Scheme, Java, Python, Scala 等语言都这么干。
这样干的好处主要是,本身能够测试本身,编译器的改善和语言的改善相辅相成。
可是,这是一个“鸡生蛋,仍是蛋生鸡”的问题,若是你须要用X语言来写一个X语言编译器的语言,你能够这样干: