Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Undefined behaviour in C [was Re: The Cost of Dynamism] Date: Sat, 26 Mar 2016 23:03:06 +1100 Lines: 33 Message-ID: References: <56e7483d$0$1608$c3e8da3$5496439d@news.astraweb.com> <56ef9787$0$1516$c3e8da3$5496439d@news.astraweb.com> <56f02196$0$1588$c3e8da3$5496439d@news.astraweb.com> <56f42d9f$0$1618$c3e8da3$5496439d@news.astraweb.com> <56f55e2e$0$1619$c3e8da3$5496439d@news.astraweb.com> <56f666d8$0$1583$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de B0VU1khB7a80v1+w4MH7hATVcoAcgWhLKXydoLsUmaOQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'dependency': 0.07; 'cc:addr:python-list': 0.09; 'bindings': 0.09; 'it;': 0.09; 'python': 0.10; 'language,': 0.11; 'languages,': 0.15; 'languages.': 0.15; '"an': 0.16; '(via': 0.16; '2016': 0.16; 'brand-new': 0.16; 'dependency,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'partly': 0.16; 'ported': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'gui': 0.18; 'network,': 0.18; 'language': 0.19; 'library': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'java': 0.22; 'not,': 0.22; 'developers.': 0.22; 'libraries': 0.22; 'suppose': 0.22; 'file.': 0.22; 'programming': 0.22; "python's": 0.23; 'sat,': 0.23; 'written': 0.24; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'point.': 0.27; 'separate': 0.27; 'message- id:@mail.gmail.com': 0.27; 'leveraging': 0.27; 'network.': 0.27; 'developing': 0.28; '(although': 0.29; 'accomplished': 0.29; 'cpu': 0.29; 'for,': 0.29; 'subject: [': 0.29; "i'm": 0.30; 'that.': 0.30; 'code': 0.30; 'probably': 0.31; "can't": 0.32; 'role': 0.32; 'compiled': 0.32; "d'aprano": 0.33; 'instead,': 0.33; 'safely': 0.33; 'steven': 0.33; 'languages': 0.34; 'that,': 0.34; 'gives': 0.35; 'received:google.com': 0.35; 'could': 0.35; 'done': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'success.': 0.36; "wasn't": 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'thanks': 0.37; 'received:209.85.213': 0.37; 'itself': 0.38; 'received:209': 0.38; 'anything': 0.38; 'mean': 0.38; 'easily': 0.39; 'build': 0.40; 'high': 0.60; 'your': 0.60; 'subject:The': 0.61; 'programs': 0.62; 'success': 0.62; 'more': 0.63; 'mar': 0.65; 'worth': 0.67; '26,': 0.72; '"hey,': 0.84; 'bignums,': 0.84; 'chrisa': 0.84; 'etc,': 0.84; 'to:none': 0.91; 'played': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=OwE2tbafZdeFRL7NN4Ex2TP7behPiwvAgtVBT0lQJsw=; b=Lk1II/XMXJbTeLC4PMyYNdY5PNTd9j4lOZpphbOyhwwdiPDd99jeE/votgPdyPKitG fZx06zxp/xMZoyjs/n/tGlXduI9R4Bpi+vECv8FUjHSkNr71edqb8/343fdjmcVHZQTb zkaU+sCuS0xzs86Rt5Dh7l3ZdcZtiZvufCUMGhGOZaR40S1DkDaYMcSTDHat+onQrwVG ReJlpJ9LDkoYBP4KBZunCb8XBYODUouR+wgdqO0KpQyO96tYOvhT7RUNvXpr/G8a9mls 8hmq7Ys25GZeGTzT2QCXGfkNe8DQouUzxe9JFAAFdQO+tHPAtPX82K/8VTeHVdOmEXk6 z2cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=OwE2tbafZdeFRL7NN4Ex2TP7behPiwvAgtVBT0lQJsw=; b=lp7le1toBqwv3Bk1U35DfPw5SkT6xZKXZl5baTg2BLp1/JZ/P4qX/5sUQgMNP+mM2R ejWr+EJNQiF4p7AampvxOs5VtRvsFtf162+QUeygYbBbaJ9BY5dyzysixxHldtR1eX7U vZdFyRr1g2M3ullo7MJ8KH9XLcUPhD9+vSyWxHXxjyCKQSYXydflm3xYtpFP9SmUavmN wnBKoTCcJKBZCiQTmgryEHZ36fT3y86lRTnzF1HYm4PJFPw7jmn4F5bqjuZ+IbSaCWrM kHka00Xuyt3E4nLDRhtwGQZh3pUyQmizk2RUPFkEJc2rX6IotIAqdZPC0UPyb9OGxQxU qtsw== X-Gm-Message-State: AD7BkJIxSegdAy5XlBzSwe1EG3D0G1BbQJUdcAhXkW42moZuK6AX05WXr4CpKYCSYtw/a3EihAWhvv3Sf/BgzA== X-Received: by 10.50.138.233 with SMTP id qt9mr1191881igb.13.1458993787063; Sat, 26 Mar 2016 05:03:07 -0700 (PDT) In-Reply-To: <56f666d8$0$1583$c3e8da3$5496439d@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105752 On Sat, Mar 26, 2016 at 9:39 PM, Steven D'Aprano wrote: > It is an accident of history that Python's first and major implementation > happens to be written in C. (Although its use as a glue language, allowing > people to safely use libraries written in C, probably played a role in > ensuring Python's success.) Your parenthesis is more important than you may be giving it credit for, so IMO C is more than "an accident of history" in Python's success. There's a massive network effect surrounding programming languages, particularly glue languages. Suppose I were to develop a brand-new library of awesomeness, distributed as a Java .class file. Python (via Jython) could now use that, but many MANY other languages could not, ergo my library would languish. But if I design my library to have C bindings instead, Java programs can't use it, but any language that is able to connect to C code can. Conversely, if I'm developing a new language, I can look at the available C libraries and say "hey, look, access to C bindings gives me GUI toolkits, bignums, etc, etc, etc", so it's worth my while to connect to that. C may itself be immaterial, but the network surrounding it has been, and continues to be. Thanks to CPython, Python can be easily compiled for any CPU or OS that has the standard C build tools ported to it; that's a huge dependency, but it's a dependency of *so* many other programs that it's a high priority for OS developers. Python's success comes partly through leveraging that portability and power. The same could have been accomplished with any other language at the center of the network, but the same wasn't accomplished with any other language at the center of the network. It was done with C. Of course, that doesn't mean that C's *behaviour* has anything to do with Python's *behaviour*. That's a completely separate point. ChrisA