C语言是开源的吗?C++是开源的吗?C语言、C++是两个开源的标准,而不是开源软件或其它

  我一度对于C语言与C++是不是开源语言很困惑:为什么有那么多人鼓吹Java、Python、PHP等是开源语言,却没有人提C与C++开源与否呢?今天在stackoverflow上找到了几个比较满意的回答,特写篇博文总结一下老外的回答,也供各位对此问题持疑问态度的朋友一个参考。

  关于C语言开源与否:

  C语言是一个由ISO组织中的ANSI制定的标准,任何个人或者组织都可以根据这个标准将其实现。现今,世界上有许多不同的C语言实现,比较著名的有:GCC、Watcom、MS C等,其中前两者是开源的,后者是闭源的。下面粘贴几个老外的回答(链接:https://stackoverflow.com/questions/5099384/is-c-open-source):

1 The C language is not a piece of software but a defined standard, so one wouldn‘t say that it‘s open-source, but rather that it‘s an open standard.
2
3 There are a gazillion different compilers for C however, and many of those are indeed open-source. The most notable example is GCC‘s C compiler, which is all under the GNU General Public License (GPL), an open-source license.
4
5 There are more options. Watcom is open-source, for instance. There is no shortage of open-source C compilers, but without a doubt the most widespread one, at least in the non-Windows world, is GCC.
6
7 For Windows, your best bet is probably Watcom or GCC by using Cygwin or MinGW.
1 C is a standard which specifies how C compilers should generate programs.
2 C itself doesn‘t have any source code, just like a musical note doesn‘t have any plastic.
3
4 Some C compilers, such as GCC, are open source.
1 C is just a language, and a standardised one at that, too. It pretty much is the compiler that "does all the work". Different compilers did have different dialects; before the the C99 ANSI standard, you had things like Borland C and other competing compilers, that implemented the C language in their own fantastic ways.
2
3 stdlib is just an agreed-upon collection of standard libraries that are required to be present in any ANSI C implementation.

  关于C++开源与否:

  与C语言类似,C++也是由ISO/ANSI制定的一个标准,所谓的“官方”并未提供确切的实现,任何组织与个人都可以根据标准自己开发一个C++编译器出来。出名的C++编译器有:GCC/G++、libc/libc++、clang(++)、 Visual studio和MS´ runtime等。也把老外的几个回答贴出来(链接:https://stackoverflow.com/questions/22589213/is-c-an-open-source-project-which-community-developes-it):

 1 C++ itself is only a description what the language should be,
 2 without a definite implementation.
 3 Anyone can make his own implementations (compiler etc, runtime library, ...)
 4 and call it C++ if it fits to the description.
 5
 6 http://www.open-std.org/jtc1/sc22/wg21/
 7
 8 And if a implementation is open source depends on the creator.
 9
10 Examples of implementation (parts):
11 GCC/G++, libc/libc++, clang (++ too), Visual studio and MS´ runtime...
1 C++ is developed by an ISO standard committee. There‘s also a C++ foundation that runs a web site you might want to read.
2
3 C++ itself is a language, not a specific implementation, so there‘s no source code available for the standard/language itself.
4
5 Some C++ implementations are open source (e.g., Gnu and Clang).
1 1. C++ is a code standard defined by the International Organization of Standardization (ISO). There are many different implementations of the language, but they all tend to conform to C++11. Unlike Linux or Qt, C++ is just a standard, and to use any code written in the language you‘ll need a compiler. The major compilers (list from Wikipedia) are LLVM Clang, GCC, Microsoft Visual C++, and the Intel C++ Compiler.
2 2. C++ revisions are dealt with by ISO, and are influenced primarily by the maintainers of the above four implementations.
3 3. Clang and GCC are both open-source, I‘m sure if you poke around you can find other conforming compilers but those are the two most used.

  总之,跟Java、Python和PHP这样所谓的开源语言不同,C语言与C++没有官方提供的各自确切的实现代码(库),ISO/ANSI仅仅提供了C和C++的标准。

原文地址:https://www.cnblogs.com/25th-engineer/p/11785619.html

时间: 2024-07-31 02:35:16

C语言是开源的吗?C++是开源的吗?C语言、C++是两个开源的标准,而不是开源软件或其它的相关文章

Go语言的9大优势和3大缺点, GO语言最初的定位就是互联网时代的C语言, 我为什么放弃Go语言

Go语言的9大优势和3大缺点 转用一门新语言通常是一项大决策,尤其是当你的团队成员中只有一个使用过它时.今年 Stream 团队的主要编程语言从 Python 转向了 Go.本文解释了其背后的九大原因以及如何做好这一转换. Go的优势 原因 1:性能 Go 极其地快.其性能与 Java 或 C++相似.在我们的使用中,Go 一般比 Python 要快 30 倍.以下是 Go 与 Java 之间的基准比较: 原因 2:语言性能很重要 对很多应用来说,编程语言只是简单充当了其与数据集之间的胶水.语言

多态 这是动态语言和静态语言(例如Java)最大的差别之一。动态语言调用实例方法,不检查类型,只要方法存在,参数正确,就可以调用。

多态 类具有继承关系,并且子类类型可以向上转型看做父类类型,如果我们从 Person 派生出 Student和Teacher ,并都写了一个 whoAmI() 方法: class Person(object): def __init__(self, name, gender): self.name = name self.gender = gender def whoAmI(self): return 'I am a Person, my name is %s' % self.name clas

构建一个学生Student,根据类Student的定义,创建五个该类的对象,输出每个学生的信息,计算并输出这五个学生Java语言成绩的平均值,以及计算并输出他们Java语言成绩的最大值和最小值。

定义一个表示学生信息的类Student,要求如下: (1)类Student的成员变量: sNO 表示学号: sName表示姓名: sSex表示性别: sAge表示年龄: sJava:表示Java课程成绩. (2)类Student带参数的构造方法: 在构造方法中通过形参完成对成员变量的赋值操作. (3)类Student的方法成员: getNo():获得学号: getName():获得姓名: getSex():获得性别: getAge()获得年龄: getJava():获得Java 课程成绩 根据类

优分享VR开源啦,优分享VR是基于Google VR开发的一款手机VR视频资源的聚合软件

欢迎来到优分享VR开源项目 优分享VR 开源中国Git地址: http://git.oschina.net/xumingwang/youkes_vr 优分享VR是 优分享安卓APP VR视频播放开源部分.其它开源部分:优分享开源浏览器 优分享VR是基于Google VR开发的一款手机VR视频资源的聚合软件.由于google vr sdk现在出于初级阶段,所以本软件也不能完美的支持一些VR视频资源的播放,不过随着Google VR的发展,优分享也会与时俱进的支持更多的VR视频资源. 优分享VR安卓

尝试自己的Perl语言的包 TCP协议的再包装起到类似python语言装饰器的效果

#!/usr/bin/perl # Filename: BuildSocketTCP.pm # #   Copyright 2012 Axxeo GmbH #   Licensed under the Apache License, Version 2.0 (the "License"); #   you may not use this file except in compliance with the License. #   You may obtain a copy of t

尝试自己的Perl语言的包 UDP协议的再包装起到类似python语言装饰器的效果

#!/usr/bin/perl # Filename: BuildSocketUDP.pm # #   Copyright 2012 Axxeo GmbH #   Licensed under the Apache License, Version 2.0 (the "License"); #   you may not use this file except in compliance with the License. #   You may obtain a copy of t

JS脚本语言(全称java script:网页里使用的脚本语言:非常强大的语言):基础语法

一.注释语法 1.单行注释// 2.多行注释/**/ 二.语法输出 1.alert(信息):弹出信息 2.confirm(信息):弹出一个和用户交互的对话框 3.prompt(信息):弹出一个可以让用户输入的对话框 三.嵌入代码 1.尽量靠下写 2.<script style="textjavasprit"></script> 四.程序的基础知识 1.所有的字符全部是英文半角的 2.大部分情况下每条语句结束之后要加分号 3.每一块代码结束后要换行 4.程序前后呼

对百度WebUploader开源上传控件的二次封装,精简前端代码(两句代码搞定上传)

首先声明一下,我这个是对WebUploader开源上传控件的二次封装,底层还是WebUploader实现的,只是为了更简洁的使用他而已. 下面先介绍一下WebUploader 简介: WebUploader是由Baidu WebFE(FEX)团队开发的一个简单的以HTML5为主,FLASH为辅的现代文件上传组件.在现代的浏览器里面能充分发挥HTML5的优势,同时又不摒弃主流IE浏览器,沿用原来的FLASH运行时,兼容IE6+,iOS 6+, android 4+.两套运行时,同样的调用方式,可供

C语言基础课程 第四课 它山之石可以攻玉---C语言数据类型和表达式

?? 1         C语言中的数据类型 1.1      常量 常量就是在程序中不可变化的量 1.1.1         #define #define MAX 10 Define的常量一般用大写定义,这是惯例,而不是强制要求 1.1.2         const const int i =100;//定义了一个int型的常量 1.2      字符串常量 "hello world" C语言""都是字符串常量 1.3      二进制数.位.字节与字 我们习