[Python-ideas] Python dialect that compiles into python
dkteresi at gmail.com
Wed Sep 12 23:45:33 EDT 2018
Not totally convinced about this. It would require PEP writers to fully implement their proposed feature, people can usually get a pretty good idea of how a feature is supposed to work through PEPs (most of which are extremely well written), and these "mods" wouldn't be used in production code anyway since they're not backwards compatible with the rest of the language.On Sep 10, 2018 8:15 PM, Abe Dillon <abedillon at gmail.com> wrote:
> [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":
>> 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.
>> Python-ideas mailing list
>> Python-ideas at python.org
>> Code of Conduct: http://python.org/psf/codeofconduct/
More information about the Python-ideas