Path: csiph.com!aioe.org!news.mixmin.net!enother.net!enother.net!enother.net!peer02.fr7!futter-mich.highwinds-media.com!news.highwinds-media.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Alberto Berti Newsgroups: comp.lang.python.announce Subject: ANN: JavaScrypthon 0.5, now with embedded evaluation of transpiled code Date: Sat, 26 Nov 2016 14:13:15 +0100 Lines: 55 Approved: python-announce-list@python.org Message-ID: References: <87a8cmfkpg.fsf@metapensiero.it> Mime-Version: 1.0 Content-Type: text/plain X-Trace: news.uni-berlin.de P4BdxqvD2EnVdFaxPZHGrwCu+0Gimk3WoQAN8nN8GfMQ== Return-Path: X-Original-To: python-announce-list@python.org Delivered-To: python-announce-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'context': 0.05; 'subject:code': 0.05; 'url:github': 0.05; 'string;': 0.07; 'subject:ANN': 0.07; 'python': 0.09; '*not*': 0.09; 'ast': 0.09; 'dashes': 0.09; 'inherited': 0.09; 'bug': 0.10; 'template': 0.11; 'translate': 0.15; 'interpreter': 0.15; 'variables': 0.15; '``assert``': 0.16; '``except``': 0.16; '``for': 0.16; '``for``': 0.16; '``in``': 0.16; '``range()``': 0.16; '``type()``': 0.16; '``yield``': 0.16; 'evaluating': 0.16; 'expressions;': 0.16; 'interpreter;': 0.16; 'loops': 0.16; 'node;': 0.16; 'optionally': 0.16; 'pypi.': 0.16; 'sorting': 0.16; 'target,': 0.16; 'string': 0.17; 'skip:` 20': 0.18; 'translation': 0.18; 'all,': 0.21; 'defined': 0.21; 'load': 0.21; 'seems': 0.21; 'skip:` 10': 0.22; 'producing': 0.23; 'references': 0.23; 'fix': 0.23; 'properties': 0.24; 'code,': 0.24; 'import': 0.26; 'header :User-Agent:1': 0.26; 'convert': 0.27; 'becomes': 0.27; 'tree': 0.27; "i'm": 0.28; 'command': 0.29; '0.5': 0.29; 'notation': 0.29; 'preliminary': 0.29; 'skip:$ 20': 0.29; 'subset': 0.29; 'announce': 0.29; 'function': 0.30; 'code': 0.30; 'bugs': 0.30; 'starts': 0.31; 'option': 0.31; 'print': 0.31; 'implement': 0.32; 'embedded': 0.32; 'statement': 0.32; 'source': 0.32; 'possible': 0.32; 'fixed': 0.33; 'method': 0.33; 'but': 0.34; 'useful': 0.35; 'class': 0.35; 'there': 0.36; 'add': 0.36; 'skip:s 30': 0.36; 'modules': 0.36; 'subject:: ': 0.36; 'version': 0.37; "there's": 0.37; 'produced': 0.38; 'wrong': 0.38; 'some': 0.39; 'to:addr:python.org': 0.39; 'does': 0.39; 'proto:https': 0.40; 'standard': 0.40; 'subject:with': 0.40; 'received:192': 0.40; 'received:io': 0.40; 'received:psf.io': 0.40; 'more': 0.62; 'latest': 0.63; 'beautiful': 0.66; 'reuse': 0.66; 'subject:now': 0.70; 'to:addr:python-announce-list': 0.71; 'evaluate': 0.75; 'collections;': 0.84; 'lean': 0.84; 'properties;': 0.84; 'url:master': 0.84 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) X-Assp-Version: 2.3.3(14029) on assp.arstecnica.it X-Assp-ID: assp.arstecnica.it m1-65995-10534 X-Assp-Session: B3B71B7C (mail 1) X-Assp-Envelope-From: azazel+python-announce@arstecnica.it X-Assp-Intended-For: python-announce-list@python.org X-Assp-Client-SSL: yes X-Assp-Server-TLS: yes X-Mailman-Approved-At: Sat, 26 Nov 2016 13:20:31 -0500 X-BeenThere: python-announce-list@python.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Announcement-only list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <87a8cmfkpg.fsf@metapensiero.it> X-Received-Bytes: 6512 X-Received-Body-CRC: 343640968 Xref: csiph.com comp.lang.python.announce:2325 Hi all, i'm pleased to announce that JavaScripthon 0.5 has been released to PyPI. JavaScrypthon can translate a subset of Python 3.5 code to ES6 JavaScript producing beautiful and lean code, while supporting some of the latest Python features. Changelog (https://github.com/azazel75/metapensiero.pj/blob/master/CHANGES.rst): - translate ``tmpl("A string with js ${interpolation}")`` to ES6 template literals; - preliminary support to translate names like ``d_foo`` and ``dd_bar`` to ``$foo`` and ``$$bar``; - addded translation of the ``assert`` statement; - fixed a bug in ``try...except...finally`` statement when there's no ``except`` section; - added translation for ``foo is not bar`` that seems to have dedicated ast node; - if the function is defined in a method but starts with ``fn_`` do not convert it to an arrow function. Useful to *not* maintain ``this``; - added translation for ``callable`` and ``hasattr/getattr/setattr``; - updated for loops to support more than one target, so now its possible to write loops like ``for k, v in iterable(a_map):``; - updated documentation; - added a new cli option ``-s`` to translate source from the command line or the standard input; - fixed a pair of bugs on sourcemaps; - added a new cli option ``--eval`` to also evaluate the produced JavaScript using the embedded interpreter; - added a new cli option ``--dump-ast`` to print out the ast tree of the passed in string; - added sorting to the rendered snippets/decorators/assignments so that their order does not change at every ricompilation; - do not re-declare variables declare in outer scopes; - updated BabelJS to version 6.18.1; - allow to import modules with dashes inside by using dunder-inside-words notation (``foo__bar`` becomes ``foo-bar``); - reuse JavaScript interpreter context to speedup translation; - update ``in`` operator to support ES6 collections; - added support for method and class decorators; - added support for class properties and descriptors; - add ``for`` loop over JS iterables; - allow to loop over inherited properties; - fix a bug on ``type()`` translation; - support for ``range()`` steps; - add support for generator functions and ``yield`` and ``yield from`` expressions; - optionally load babel-polyfill before evaluating code; - fix a bug on sourcemaps having wrong references when there are documentation elements; - translate ``__get__()`` and ``__set__()`` to to JS equivalents; - implement ``dict(foo).update(bar)`` and ``dict(foo).copy``; - documentation improvements;