[Python-ideas] Python dialect that compiles into python

Abe Dillon abedillon at gmail.com
Mon Sep 10 20:15:11 EDT 2018


[Steven D'Aprano]

> It would be great for non-C coders to be able to prototype proposed
> syntax changes to get a feel for what works and what doesn't.


I think it would be great in general for the community to be able to try
out ideas and mull things over.

If there was something like a Python Feature Index (PyFI) and you could
install mods to the language,
it would allow people to try out ideas before rejecting them or
incorporating them into the language
(or putting them on hold until someone suggests a better implementation).

I could even see features that never make it into the language, but stick
around PyFI and get regular
maintenance because:
    A) they're controversial changes that some love and some hate
    B) they make things easier in some domain but otherwise don't warrant
adoption

It would have to be made clear from the start that Python can't guarantee
backward compatibility with
any mods, which should prevent excessive fragmentation (if you want your
code to be portable, don't
use mod).

On Fri, Sep 7, 2018 at 7:30 PM Steven D'Aprano <steve at pearwood.info> wrote:

> On Fri, Sep 07, 2018 at 11:57:50AM +0000, Robert Vanden Eynde wrote:
>
> > Many features on this list propose different syntax to python,
> > producing different python "dialects" that can statically be
> > transformed to python :
>
> [...]
> > Using a modified version of ast, it is relatively easy to modifiy the
> > syntax tree of a program to produce another program. So one could
> > compile the "python dialect" into regular python. The last example
> > with partially for example doesn't even need new syntax.
>
> [...]
> > Actually, I might start to write this lib, that looks fun.
>
> I encourage you to do so! It would be great for non-C coders to be able
> to prototype proposed syntax changes to get a feel for what works and
> what doesn't.
>
> There are already a few joke Python transpilers around, such as
> "Like, Python":
>
> https://jon.how/likepython/
>
> but I think this is a promising technique that could be used more to
> keep the core Python language simple while not *entirely* closing the
> door to people using domain-specific (or project-specific) syntax.
>
>
> --
> Steve
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180910/181e41ac/attachment.html>


More information about the Python-ideas mailing list