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


Groups > comp.lang.python > #35165

Re: Brython - Python in the browser

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'interpreter': 0.04; 'subject:Python': 0.05; 'python': 0.09; 'clock,': 0.09; 'interpreter,': 0.09; 'operator,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'scripting': 0.09; 'subset': 0.09; 'target,': 0.09; 'terry': 0.09; 'worse': 0.09; ';-)': 0.11; 'programmer': 0.11; 'language': 0.14; '(like': 0.15; 'dictionaries': 0.16; 'element,': 0.16; 'elsewhere,': 0.16; 'non-empty': 0.16; 'numpy': 0.16; 'operator.': 0.16; 'presume': 0.16; 'py3': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'splits': 0.16; 'unnecessary.': 0.16; 'wrote:': 0.17; 'instance': 0.17; 'specify': 0.17; 'creates': 0.18; 'jan': 0.18; 'obviously': 0.18; 'mostly': 0.20; 'doc': 0.22; 'latter': 0.22; 'tuples': 0.22; 'defined': 0.22; 'sets': 0.23; 'statement': 0.23; 'connected': 0.24; 'feature': 0.24; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'looks': 0.26; 'url:wiki': 0.26; 'compiled': 0.27; 'forgive': 0.27; 'replace': 0.27; 'translated': 0.27; 'header:X-Complaints-To:1': 0.28; 'allowed,': 0.29; 'arrays': 0.29; 'changed.': 0.29; 'comparison': 0.29; 'omitted': 0.29; 'unlikely': 0.29; 'url:wikipedia': 0.29; 'usable': 0.29; 'array': 0.29; 'related': 0.30; 'classes': 0.30; "skip:' 10": 0.30; 'that.': 0.30; 'normally': 0.30; 'sense': 0.31; 'code': 0.31; 'url:python': 0.32; 'could': 0.32; 'says': 0.33; 'true.': 0.33; 'to:addr:python-list': 0.33; 'wrong': 0.34; 'list': 0.35; 'needed': 0.35; 'false': 0.35; 'machines': 0.35; 'pm,': 0.35; 'similar': 0.35; 'received:org': 0.36; 'created': 0.36; 'except': 0.36; 'but': 0.36; 'url:org': 0.36; 'should': 0.36; 'too': 0.36; 'skip:p 20': 0.36; 'possible': 0.37; 'does': 0.37; 'two': 0.37; 'being': 0.37; 'virtual': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'supports': 0.38; 'url:en': 0.38; 'page': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'step': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'your': 0.60; 'most': 0.61; 'latest': 0.61; 'introduction': 0.62; 'different': 0.63; 'visit': 0.64; 'making': 0.64; 'anchor': 0.65; 'stuck': 0.65; 'home': 0.66; 'url:%1': 0.68; 'lack': 0.71; 'sounds': 0.71; 'browser.': 0.81; 'ambition': 0.84; 'browsers,': 0.84; 'cognitive': 0.84; 'dict()': 0.84; 'pyjs,': 0.84; 'received:fios.verizon.net': 0.84; 'engines.': 0.91; 'urge': 0.91; 'mystery': 0.95
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Brython - Python in the browser
Date Wed, 19 Dec 2012 19:07:15 -0500
References <c0be76ec-d55b-4f6c-9892-a80b482ff5bb@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-173-75-251-66.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0
In-Reply-To <c0be76ec-d55b-4f6c-9892-a80b482ff5bb@googlegroups.com>
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1077.1355962055.29569.python-list@python.org> (permalink)
Lines 69
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1355962055 news.xs4all.nl 6984 [2001:888:2000:d::a6]:47360
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:35165

Show key headers only | View raw


On 12/19/2012 1:19 PM, Pierre Quentel wrote:

> The objective of Brython is to replace Javascript by Python as the
> scripting language for web browsers, making it usable on all
> terminals including smartphones, tablets, connected TVs, etc. Please
> forgive the lack of ambition ;-)

This sounds similar to pyjs, but the latter has two big problems: a) 
personality conflicts splits among the developers; b) last I knew, it 
was stuck on Python 2.

I think your home page/doc/announcement should specify Python 3 at the 
top, so it is not a mystery until one reads down to
"Brython supports most keywords and functions of Python 3 : "

"lists are created with [] or list(), tuples with () or tuple(), 
dictionaries with {} or dict() and sets with set()"

non-empty sets are also created with {} and you should support that.

> The best introduction is to visit the Brython site
> (http://www.brython.info).

That says that my browser, Firefox 17, does not support HTML5. Golly 
gee. I don't think any browser support5 all of that moving target, and 
Gecko apparently supports about as large a subset as most.
https://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28HTML5%29
It is possible the FF still does not support the particular feature 
needed for the clock, but then the page should say just that. Has the 
latest FF (17) actually been tested?

> To create an element, for instance an HTML anchor :
> doc <= A('Python',href="http://www.python.org")

To me, that is a awful choice and I urge you to change it.

'<=' is not just an operator, it is a comparison operator. It normally 
return False or True. Numpy array comparison returns arrays of booleans, 
so the meaning is extended, not completely changed. People will often be 
using it with its normal mean in conditionals elsewhere, so this usage 
creates strong cognitive dissonance. Also, using an expression as a 
statement is allowed, but except in the interactive interpreter, it only 
makes sense with an expression that obviously has side-effects or could 
have side-effects (like the expression 'mylist.sort()'. It just looks 
wrong to an experienced Python programmer like me.

It also is unnecessary. Use '+=' or '|='. The former means just what you 
want the statement to do and the latter is at least somewhat related 
(bit or-addition) and is rarely used and is very unlikely to be used in 
code intended for a browser.


> It still lacks important features of Python, mostly list
> comprehensions and classes ;

Since Python 3 has 4 types of comprehensions, while Python 2 only has 
list comprehensions, I took this to mean that Brython was Python 2.

And yes, I am all in favor of being able to use a subset of Py3 instead 
of javascript. A full Python interpreter in a browser is too dangerous. 
(Actually, I think javascript is too, but that is a different issue.) 
Python translated to javascript cannot be worse than javascript. I 
presume the same would be true if the javascript step were omitted and 
Python were directly compiled to the virtual machines defined by current 
javascript engines.

-- 
Terry Jan Reedy

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


Thread

Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-19 10:19 -0800
  Re: Brython - Python in the browser jkn <jkn_gg@nicorp.f9.co.uk> - 2012-12-19 14:59 -0800
  Re: Brython - Python in the browser Terry Reedy <tjreedy@udel.edu> - 2012-12-19 19:07 -0500
    Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-20 01:37 -0800
      Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-20 20:56 +1100
      Re: Brython - Python in the browser Terry Reedy <tjreedy@udel.edu> - 2012-12-20 18:59 -0500
        Re: Brython - Python in the browser Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-21 02:05 +0000
          Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-21 16:07 +1100
        Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 08:16 -0800
          Re: Brython - Python in the browser Stefan Behnel <stefan_ml@behnel.de> - 2012-12-21 17:52 +0100
          Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-21 11:31 -0700
            Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 12:59 -0800
              Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-21 14:17 -0700
            Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 12:59 -0800
        Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 08:16 -0800
      Re: Brython - Python in the browser Rouslan Korneychuk <rouslank@msn.com> - 2012-12-21 03:31 -0500
        Re: Brython - Python in the browser Terry Reedy <tjreedy@udel.edu> - 2012-12-21 04:44 -0500
    Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-20 01:37 -0800
  Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-19 17:54 -0700
    Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-20 01:42 -0800
      Re: Brython - Python in the browser Stefan Behnel <stefan_ml@behnel.de> - 2012-12-21 12:25 +0100
        Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 04:38 -0800
          Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-21 23:57 +1100
            Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 07:36 -0800
              Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 02:48 +1100
                Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 08:36 -0800
                Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 09:52 +1100
                Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-21 16:45 -0700
                Re: Brython - Python in the browser Amirouche Boubekki <amirouche.boubekki@gmail.com> - 2012-12-22 00:50 +0100
                Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-21 16:51 -0700
                Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 23:59 -0800
                Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 23:59 -0800
                Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-21 16:57 -0700
                Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 11:08 +1100
                Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 23:57 -0800
                Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 19:31 +1100
                Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-22 00:54 -0800
                Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 20:08 +1100
                Re: Brython - Python in the browser Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-22 11:05 +0000
                Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 23:11 +1100
                Re: Brython - Python in the browser Dan Sommers <dan@tombstonezero.net> - 2012-12-22 20:31 +0000
                Re: Brython - Python in the browser Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-22 13:53 -0700
                Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-23 08:49 +1100
                Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-22 00:54 -0800
                Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 23:57 -0800
                Re: Brython - Python in the browser Chris Angelico <rosuav@gmail.com> - 2012-12-22 11:09 +1100
                Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 08:36 -0800
            Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 07:36 -0800
          Re: Brython - Python in the browser Duncan Booth <duncan.booth@invalid.invalid> - 2012-12-21 13:14 +0000
            Re: Brython - Python in the browser Stefan Behnel <stefan_ml@behnel.de> - 2012-12-21 14:34 +0100
        Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-21 04:38 -0800
        Re: Brython - Python in the browser Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-22 02:31 +0000
    Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-20 01:42 -0800
  Re: Brython - Python in the browser Terry Reedy <tjreedy@udel.edu> - 2012-12-19 21:46 -0500
  Re: Brython - Python in the browser Jamie Paul Griffin <jamie@kode5.net> - 2012-12-20 11:32 +0000
  Re: Brython - Python in the browser Pierre Quentel <pierre.quentel@gmail.com> - 2012-12-22 01:01 -0800

csiph-web