[Python-Dev] PEP 511 (code transformers) rejected

Nick Coghlan ncoghlan at gmail.com
Wed Nov 1 21:53:11 EDT 2017


On 2 November 2017 at 09:16, Lukasz Langa <lukasz at langa.pl> wrote:

> I find this sad. In the JavaScript community the existence of Babel is
> very important for the long-term evolution of the language independently
> from the runtime. With Babel, JavaScript programmers can utilize new
> language syntax while being able to deploy on dated browsers. While there's
> always some experimentation, I doubt our community would abuse the new
> syntactic freedom that the PEP provided.
>
> Then again, maybe we should do what Babel did, e.g. release a tool like it
> totally separately from the runtime.
>

Right, I think python-modernize and python-future provide a better model
for Babel equivalents in Python than anything built directly into CPython
would.

In many ways, python-future's pasteurize already *is* that kind of
polyfill, where you get to write nice modern Python yourself, and then ask
pasteurize to mess it up so it also works on Python 2.7:
http://python-future.org/pasteurize.html

The piece that we're currently missing to make such workflows easier to
manage is an equivalent of JavaScript's source maps (
http://blog.teamtreehouse.com/introduction-source-maps), together with
debugging tools that are able to use source map information to generate
nice tracebacks, even when the original sources are unavailable.

Source maps could also potentially help with getting meaningful tracebacks
in other contexts, like bytecode-only deployments and Cython extension
modules (for example, the traceback problem is the main reason Red Hat's
Python container images still have the source code in them - when that was
last measured, you could get an image size reduction of around 15% by
including only the pyc files and omitting the original sources, but it
wasn't worth it when it came at the cost of making tracebacks unreadable).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20171102/745fa492/attachment.html>


More information about the Python-Dev mailing list