What does GCC have to do with the python interpreter?
I just noticed this on my macintosh. Launch $ python
starts an interpreter session with the following lines:
$ python2.7
Python 2.7.10 (default, Feb 6 2017, 23:53:20)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
The second line of the startup text mentions the GCC and clang versions.
How do these two relate to the python interpreter? Given that python is an interpreted language, there shouldn't be any compiler whisper at all, so I was curious as to why this is shown.
Now, here's the same thing with python3.6:
$ python3.6
Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
There is no mention of the klang this time. Why?
source to share
CPython interpreter itself is written in the C . It is important which compiler was used to convert the C code to a binary executable; behavior and performance can vary in subtle ways, which is why it is mentioned in the banner.
You have two different Python binaries, the differences in the banner reflect the differences in how these binaries are created. Since the Python 2.7 release is the one that comes bundled with OS X, it was built by Apple engineers using a different toolchain (using > GCC .
source to share