<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto">Many features on this list propose different syntax to python, producing different python "dialects" that can statically be transformed to python :
<div dir="auto"><br>
</div>
<div dir="auto">- a,b += f(x) → _t = f(x); a += _t; b += _t;  (augmented assignement unpacking)</div>
<div dir="auto">- a = 2x + 1 → a = 2*x + 1  (juxtaposition is product)</div>
<div dir="auto">- f(*, x, y) → f(x=x, y=y)  (simplekwargs)</div>
<div dir="auto">- DSL specific language</div>
<div dir="auto">- all def become @partially def</div>
<div dir="auto">- etc...</div>
<div dir="auto"><br>
</div>
<div dir="auto">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.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Those solutions that are too specific would then be provided as a module on pip that has a common interface for "compiling" :</div>
<div dir="auto"><br>
</div>
<div dir="auto">$ cat <a href="http://test.dialect.py" target="_blank" rel="noreferrer">
test.dialect.py</a></div>
<div dir="auto">#! dialect: juxtaposition</div>
<div dir="auto">a = 2x + 1</div>
<div dir="auto"><br>
</div>
<div dir="auto">$ python -m compile <a href="http://test.dialect.py" target="_blank" rel="noreferrer">
test.dialect.py</a> </div>
<div dir="auto">$ cat test.py</div>
<div dir="auto">#! compiled with dialect juxtaposition</div>
<div dir="auto">a = 2x + 1</div>
<div dir="auto"><br>
</div>
<div dir="auto">The generated file should also be read only if the filesystem provides the option.</div>
<div dir="auto"><br>
</div>
<div dir="auto">In the web world, it's very common to compile into html, css or js. One of the reason was that the web must be veeeery generic and will not try to fit everyone needs.</div>
<div dir="auto"><br>
</div>
<div dir="auto">- less compiles scss into css</div>
<div dir="auto">- coffeescript into js</div>
<div dir="auto">- source map provides a standard way to map each line of the new file into lines of the old files (useful for exceptions !)</div>
<div dir="auto"><br>
</div>
<div dir="auto">One useful feature of those compilers is the --watch Option that allows to avoid to launch the compilation manually.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Of course, in the js world, the syntax was improved in the end after a long maturation of the compiling and not compiling libraries.</div>
<div dir="auto"><br>
</div>
<div dir="auto">In the java world, languages such as Scala compile into bytecode, that's another idea.</div>
<div dir="auto"><br>
</div>
<div dir="auto">If a standard module like "compile" is written, users can write their own module that will automatically be read by "compile" (for example, pip install compile_juxtaposition would allow the juxtaposition dialect). Compile doesn't even have to
 be on the standard python, it can be a lib.</div>
<div dir="auto"><br>
</div>
<div dir="auto">One could write a module using multiple dialect like dialect: juxtaposition, simplekwargs</div>
<div dir="auto"><br>
</div>
<div dir="auto">The order would be technically important but functionally non important.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Actually, I might start to write this lib, that looks fun.</div>
</div>
</body>
</html>