Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'operator': 0.03; 'anyway.': 0.05; 'interpreter': 0.05; 'subject:Python': 0.06; 'plenty': 0.07; 'pypy': 0.07; 'arrays': 0.09; 'ascii': 0.09; 'classes.': 0.09; 'decision.': 0.09; 'oh,': 0.09; 'slow.': 0.09; 'yeah,': 0.09; 'python': 0.11; 'thread': 0.14; '"+"': 0.16; 'backward': 0.16; 'boolean': 0.16; 'cleaner': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'itself,': 0.16; 'new-style': 0.16; 'numpy': 0.16; 'old-style': 0.16; 'ought': 0.16; 'reflects': 0.16; 'subject:Java': 0.16; 'why,': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'bit': 0.19; 'everyone,': 0.19; "python's": 0.19; 'code,': 0.22; 'error': 0.23; 'byte': 0.24; 'instance,': 0.24; 'unicode': 0.24; '15,': 0.26; 'task': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'feature': 0.29; 'am,': 0.29; 'character': 0.29; 'errors': 0.30; 'message-id:@mail.gmail.com': 0.30; 'went': 0.31; 'url:wiki': 0.31; 'breaking': 0.31; 'consequence': 0.31; 'fast.': 0.31; 'languages': 0.32; "i'd": 0.34; 'subject: (': 0.35; "can't": 0.35; 'classes': 0.35; 'something': 0.35; 'good.': 0.35; 'no,': 0.35; 'objects': 0.35; 'operations': 0.35; 'usual': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'object,': 0.36; 'transition': 0.36; 'done': 0.36; 'next': 0.36; 'similar': 0.36; 'url:org': 0.36; 'too': 0.37; 'performance': 0.37; 'step': 0.37; 'sometimes': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'rather': 0.38; 'anything': 0.39; 'ability': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'major': 0.40; 'how': 0.40; 'even': 0.60; 'till': 0.61; 'john': 0.61; 'simply': 0.61; "you'll": 0.62; 'high': 0.63; 'kind': 0.63; 'such': 0.63; 'design,': 0.64; 'places': 0.64; 'more': 0.64; '(that': 0.65; 'finally': 0.65; 'between': 0.67; 'it!': 0.67; 'production': 0.68; 'design.': 0.68; 'price.': 0.74; 'goal': 0.75; 'grow': 0.77; 'lack': 0.78; 'hard.': 0.84; 'shape.': 0.84; 'carries': 0.91; 'suited': 0.93; '2013': 0.98 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:to :content-type; bh=IZxlElE1a7mLaFHE+jVx4l5awnngEycOKItuAYWR2SM=; b=h8NGZzolOjUaUY38Q+rmXjb1O7cLeaxrv0A86KXJWm39syHIeAQ+Mz+MhBlXGBnacB E0sR+QlXLddBw2xgbqV26LJA24qaj2V2CwLpVqAj7IInW5fRNX4k9KdkI24u0PBDZt5m 7Am/IDXP3LiToMwYMUkWatrooJzocsbQVkkXnAshF6VPvzC56tdybjsriKHGpAAZ5WPS QIXYJYesgea5B7xSw5dBmGaszSILV2cu5CrPJuXdBTRR+tu4IJIp/fLqgC33ZAVMbOTI qmbagkTpiGCAzD9m+769BKzAmFNBqfFeQMfMELG1qgSlPFiqjmshq0h+6qO7nMbfzXrf WufA== MIME-Version: 1.0 X-Received: by 10.67.23.227 with SMTP id id3mr40367457pad.101.1381790596962; Mon, 14 Oct 2013 15:43:16 -0700 (PDT) In-Reply-To: References: Date: Tue, 15 Oct 2013 09:43:16 +1100 Subject: Re: Python was designed (was Re: Multi-threading in Python vs Java) From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 52 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381790607 news.xs4all.nl 15940 [2001:888:2000:d::a6]:41348 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56827 On Tue, Oct 15, 2013 at 6:18 AM, John Nagle wrote: > On 10/12/2013 3:37 PM, Chris Angelico wrote: >> "Designed". >> >> You simply can't get a good clean design if you just let it grow by >> itself, one feature at a time. > > No, Python went through the usual design screwups. Look at how > painful the slow transition to Unicode was, from just "str" to > Unicode strings, ASCII strings, byte strings, byte arrays, > 16 and 31 bit character builds, and finally automatic switching > between rune widths. Old-style classes vs. new-style classes. Adding a > boolean type as an afterthought (that was avoidable; C went through > that painful transition before Python was created). Operator "+" > as concatenation for built-in arrays but addition for NumPy > arrays. > > Each of those reflects a design error in the type system which > had to be corrected. Oh, Python's design wasn't perfect - that's a pretty much impossible goal anyway. Sometimes you don't learn what you ought to have done till it's been in production for a while - that's why, for instance, these happened: https://wiki.theory.org/YourLanguageSucks#Fixed_in_Python_3 You'd have to be completely omniscient to avoid that kind of misjudgment, and breaking backward compatibility is such a major cost that sometimes design errors just have to be kept. But you'll still end up with something far cleaner than would come from ad-hoc undirected changes; it'll be a design with warts, rather than a lack of design. > The type system is now in good shape. The next step is to > make Python fast. Python objects have dynamic operations suited > to a naive interpreter like CPython. These make many compile > time optimizations hard. At any time, any thread can monkey-patch > any code, object, or variable in any other thread. The ability > for anything to use "setattr()" on anything carries a high > performance price. That's part of why Unladen Swallow failed > and why PyPy development is so slow. Yeah, this does make things hard. But that dynamism is a fundamental part of Python's design, even if it's used by almost nothing. I'd say this isn't proof of a design error, just a consequence of a design decision. Python isn't for everyone, nor for every task - sometimes it'll be too slow for what you want. So be it! There are plenty of places where it's good. And there are similar languages (hi Pike!) for when you want a bit more performance. ChrisA