Path: csiph.com!usenet.pasdenom.info!gegeweb.org!newsfeed.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'cpython': 0.05; 'explicitly': 0.05; 'output': 0.05; 'indexing': 0.07; 'suppose': 0.07; 'string': 0.09; 'apis': 0.09; 'encode': 0.09; 'subject:language': 0.09; 'python': 0.11; '(java': 0.16; '*must*': 0.16; '1:13': 0.16; '8-bit': 0.16; 'backward': 0.16; 'encodes': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'underlying': 0.16; 'folks': 0.16; 'do,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'backend': 0.19; 'passing': 0.19; 'not,': 0.20; 'work,': 0.20; '(in': 0.22; 'instance,': 0.24; 'question': 0.24; 'somewhere': 0.26; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; 'along': 0.30; 'code': 0.31; "d'aprano": 0.31; 'dom': 0.31; 'piece': 0.31; 'steven': 0.31; 'run': 0.32; 'cases': 0.33; 'entirely': 0.33; 'implemented': 0.33; 'actual': 0.34; 'could': 0.34; 'problem': 0.35; 'subject: (': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'vice': 0.36; 'possible': 0.36; 'nov': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'how': 0.40; 'eventually': 0.60; 'most': 0.60; 'back': 0.62; 'pick': 0.64; 'become': 0.64; 'more': 0.64; 'overall': 0.69; 'stated': 0.69; 'guaranteed': 0.75; 'browser.': 0.78; 'potentially': 0.81; 'browsers,': 0.84; 'compiles': 0.84; 'improvement,': 0.84; 'terrible': 0.84; 'drops': 0.91; '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=CPHE5GeyqJKKnZdZ9ytjncepZ2vA9l6tLBgXwbQkvtc=; b=NDcHWQoKaslwmi/ocWkAHw8CmrrB0n4gutfDBN0V6ETIcDrxdLg75Gu2n6bPQQW2Ig GqMhZiijFye24zQuaugiHjsryhSiS28Stgnw2JMvyDazt4pNTjQNgOXNvlZtX5IEJfqA 2M0qj33FyAp5HB87dWAaRfe1uwDpwrVzAsyYNp0QxYR4NBI75chCGTqbKOHQpdv7JYaQ appQRrcVACI7q3/Ddw0kpPCn4vatlIWH53cQrKk1AR1RXu15gLARYMyfdcE7V2Y3cOH2 PICPUYCKQVBj/IaOGRbLs6IeAC3vn1dtrNv++4ZUHN6Kf1d1cw9R1yFaKauNtLsjux9n NBVQ== MIME-Version: 1.0 X-Received: by 10.68.173.132 with SMTP id bk4mr26579pbc.169.1384829697359; Mon, 18 Nov 2013 18:54:57 -0800 (PST) In-Reply-To: <528ac93d$0$11089$c3e8da3@news.astraweb.com> References: <1f0ffad0-f9b1-4154-b048-510d8e38846e@googlegroups.com> <41f332dd-1c31-4699-9176-7e8589f9c8ae@googlegroups.com> <528a16b5$0$29992$c3e8da3$5496439d@news.astraweb.com> <528a249e$0$29992$c3e8da3$5496439d@news.astraweb.com> <528ac93d$0$11089$c3e8da3@news.astraweb.com> Date: Tue, 19 Nov 2013 13:54:57 +1100 Subject: Re: Oh look, another language (ceylon) 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: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384829701 news.xs4all.nl 15899 [2001:888:2000:d::a6]:32854 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:59934 On Tue, Nov 19, 2013 at 1:13 PM, Steven D'Aprano wrote: > On Tue, 19 Nov 2013 10:25:00 +1100, Chris Angelico wrote: > >> But the problem is also with strings coming back from JS. > > Just because you call it a "string" in Ceylon, doesn't mean you have to > use the native Javascript string type unchanged. Indeed not, but there are going to be many MANY cases where a JS string has to become a Ceylon string and vice versa - a lot more often than CPython drops to C. For instance, suppose you run your Ceylon code inside a web browser. Pick up pretty much any piece of JavaScript code from any web page - how much string manipulation does it do, and how much does it call on various DOM methods? In CPython, only a small number of Python functions will end up dropping to C APIs to do their work (and most of those will have to do some manipulation along the way somewhere - eg chances are print()/sys.stdout.write() will eventually have to encode its output to 8-bit before passing it to some byte-oriented underlying stream, so the actual representation of a Python string doesn't matter); in browser-based work, that is inverted. However, Ceylon can actually be implemented on multiple backends (Java and JavaScript listed). It's fully possible that an "application-oriented" backend might use Pike-strings internally, while a "browser-oriented" backend could still use the underlying string representation. The questions are entirely of performance, since it's been guaranteed already to have the same semantics. I would really like to see JavaScript replaced in web browsers, since the ECMAScript folks have stated explicitly (in response to a question from me) that UTF-16 representation *must* stay, for backward compat. JS is a reasonable language - it's not terrible - but it has a number of glaring flaws. Ceylon could potentially be implemented in browsers, using Pike-strings internally, and then someone could write a JavaScript engine that compiles to Ceylon (complete with bug-compatibility stupid-code that encodes all strings UTF-16 before indexing into them). It would be an overall improvement, methinks. ChrisA