Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #59918

Re: Oh look, another language (ceylon)

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 <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'broken': 0.04; 'true,': 0.05; 'binary': 0.07; 'indexing': 0.07; 'puts': 0.07; 'suppose': 0.07; 'string': 0.09; '32-bit': 0.09; 'bits': 0.09; 'sake': 0.09; 'strings.': 0.09; 'subject:language': 0.09; 'variance': 0.09; 'boundary.': 0.16; 'crosses': 0.16; 'dumb.': 0.16; 'expensive,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'length,': 0.16; 'length:': 0.16; 'units.': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'passing': 0.19; 'saying': 0.22; "aren't": 0.24; 'bytes': 0.24; 'string,': 0.24; 'visible': 0.24; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; 'raise': 0.29; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'quite': 0.32; "i'd": 0.34; 'could': 0.34; 'problem': 0.35; 'subject: (': 0.35; 'except': 0.35; 'something': 0.35; 'operations': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'opposed': 0.36; 'next': 0.36; 'method': 0.36; 'example,': 0.37; 'two': 0.37; 'performance': 0.37; 'nov': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'even': 0.60; 'dave': 0.60; 'then,': 0.60; 'impact': 0.61; 'simply': 0.61; "you're": 0.61; 'first': 0.61; 'back': 0.62; 'walk': 0.74; 'potentially': 0.81; '2gb': 0.84; 'choices.': 0.84; 'clarifies': 0.84; 'exceeding': 0.84; '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=fIJNKZwaypTOJJTNQUJP2Iu9plLYSFJRY03fkzZd1Mg=; b=xuaCM5J8ljVhfyDjEgCe6XahueXd6KVUVQH1nq3HEZxfFlbrlpaOE/ZAWPiIqdRVLY XoP5sBHFoDV3N19f9lpWybwIsyk8t2w/nJVMmF6gTioN55+oEKUnYEVFB9Xi0oQnAxqg H6XpmgwNVdNFfMoEHdJaeEJhMcDqpPlYfRZ6fPI5iWH8gNcByhwH93H1BgZhMRuTLerD Ru1BKWIi9B/+HwCVaPBo8VH564cjyHP7PRWmQEENs3IgmXBeDdlC1IaB410AB2Wh5ii2 46jGKj9MNoboXjYPIto2vAgWaCw0ZFlZBfx8eCxEDTS5CNAgjjtZigkv5e58r7WnMht2 Szhg==
MIME-Version 1.0
X-Received by 10.66.249.134 with SMTP id yu6mr23692092pac.37.1384817100232; Mon, 18 Nov 2013 15:25:00 -0800 (PST)
In-Reply-To <528a249e$0$29992$c3e8da3$5496439d@news.astraweb.com>
References <mailman.2549.1384371222.18130.python-list@python.org> <beqs6jF6ojmU1@mid.individual.net> <1f0ffad0-f9b1-4154-b048-510d8e38846e@googlegroups.com> <betrckFpdk9U1@mid.individual.net> <mailman.2823.1384757801.18130.python-list@python.org> <41f332dd-1c31-4699-9176-7e8589f9c8ae@googlegroups.com> <mailman.2831.1384769090.18130.python-list@python.org> <528a16b5$0$29992$c3e8da3$5496439d@news.astraweb.com> <528a249e$0$29992$c3e8da3$5496439d@news.astraweb.com>
Date Tue, 19 Nov 2013 10:25:00 +1100
Subject Re: Oh look, another language (ceylon)
From Chris Angelico <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2868.1384817102.18130.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1384817103 news.xs4all.nl 15890 [2001:888:2000:d::a6]:42468
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:59918

Show key headers only | View raw


On Tue, Nov 19, 2013 at 1:30 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> I suppose that's not terrible, except for the O(n) string operations
> which is just dumb. Yes, it's better than buggy, broken strings. But
> still dumb, because those aren't the only choices. For example, for the
> sake of an extra two bytes at the start of each string, they could store
> a flag and a length:

True, but I suspect that _any_ variance from JS strings would have
significant impact on the performance of everything that crosses the
boundary. If anything, I'd be looking at a permanent 32-bit shim on
the string (rather than the 16-or-32-bit that you describe, or the
16-or-48-bit that Dave clarifies your theory as needing); that would
allow strings up to 2GB (31 bits of pure binary length), and exceeding
that could just raise a RuntimeError. Then, passing any string to a JS
method would simply mean trimming off the first two code units.

But the problem is also with strings coming back from JS. Every time
you get something crossing from JS to Ceylon, you have to walk it,
count up its length, and see if it has any surrogates (and somehow
deal with mismatched surrogates). Every string, even if all you're
going to do is give it straight back to JS in the next line of code.
Potentially quite expensive, and surprisingly so - as opposed to
simply saying "string indexing can be slow on large strings", which
puts the cost against a visible line of code.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Oh look, another language (ceylon) Neal Becker <ndbecker2@gmail.com> - 2013-11-13 14:33 -0500
  Re: Oh look, another language (ceylon) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-17 16:41 +1300
    Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-17 15:10 +1100
    Re: Oh look, another language (ceylon) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-17 05:48 +0000
      Re: Oh look, another language (ceylon) jkn <jkn_gg@nicorp.f9.co.uk> - 2013-11-17 00:34 -0800
    Re: Oh look, another language (ceylon) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-17 12:41 +0000
      Re: Oh look, another language (ceylon) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-18 11:33 +1300
        Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-18 11:42 +1100
        Re: Oh look, another language (ceylon) Tim Daneliuk <tundra@tundraware.com> - 2013-11-17 16:48 -0600
          Re: Oh look, another language (ceylon) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-18 23:51 +0000
            Re: Oh look, another language (ceylon) Tim Daneliuk <tundra@tundraware.com> - 2013-11-18 18:31 -0600
    Re: Oh look, another language (ceylon) Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-17 16:18 -0800
      Re: Oh look, another language (ceylon) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-18 19:45 +1300
        Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-18 17:56 +1100
          Re: Oh look, another language (ceylon) wxjmfauth@gmail.com - 2013-11-18 01:44 -0800
            Re: Oh look, another language (ceylon) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-18 09:56 +0000
            Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-18 21:04 +1100
              Re: Oh look, another language (ceylon) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-18 13:31 +0000
                Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-19 00:39 +1100
                Re: Oh look, another language (ceylon) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-18 14:30 +0000
                Re: Oh look, another language (ceylon) Dave Angel <davea@davea.name> - 2013-11-18 15:37 -0500
                Re: Oh look, another language (ceylon) Steven D'Aprano <steve@pearwood.info> - 2013-11-19 02:29 +0000
                Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-19 10:25 +1100
                Re: Oh look, another language (ceylon) Steven D'Aprano <steve@pearwood.info> - 2013-11-19 02:13 +0000
                Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-19 13:54 +1100
                Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-19 13:56 +1100
                Re: Oh look, another language (ceylon) wxjmfauth@gmail.com - 2013-11-19 01:10 -0800
                Re: Oh look, another language (ceylon) Bob Martin <bob.martin@excite.com> - 2013-11-20 08:19 +0000
            Re: Oh look, another language (ceylon) Ian Kelly <ian.g.kelly@gmail.com> - 2013-11-18 05:29 -0700
            Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-18 23:36 +1100
              Re: Oh look, another language (ceylon) Piet van Oostrum <piet@vanoostrum.org> - 2013-11-18 10:31 -0400
                Re: Oh look, another language (ceylon) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-18 15:06 +0000
        Re: Oh look, another language (ceylon) Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-18 19:33 -0800
          Re: Oh look, another language (ceylon) Steven D'Aprano <steve@pearwood.info> - 2013-11-19 07:00 +0000
            Re: Oh look, another language (ceylon) Chris Angelico <rosuav@gmail.com> - 2013-11-19 18:18 +1100
            Re: Oh look, another language (ceylon) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-20 18:25 +1300
  Re: Oh look, another language (ceylon) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-18 14:56 +0000

csiph-web