Closed kiwi0fruit closed 5 years ago
@ViralBShah It was off topic there so I opened this issue.
This is not really appropriate for a Julep, since it doesn't need to be in the core language; if you're interested in the idea you could do it as a package (see LispSyntax.jl for inspiration). If you want to discuss the idea you'd be welcome to do so on https://discourse.julialang.org.
Thanks for the link to the discourse.
Most of Julia's ability to resolve dynamism with performance comes from language design choices, not clever JIT technology. For example, Julia does not do tracing, it just analyzes code ahead of execution and generates good machine code from what you wrote. So transpiling Python to Julia would provide few performance benefits since you would still be stuck with all of the design choices in the Python language that make it so hard to execute efficiently. Don't take if from me, you can watch this excellent talk by Armin Ronacher on "How Python was Shaped by Leaky Internals" which does a much better job addressing the Python side of this issue than I ever could. For understanding the Julia side and how the language's design allows resolving performance with dynamism, there happens to be a paper we wrote on just that subject that you can check out.
Sounds unreasonable if you you remember what a transpiler is. It's not an interpreter. It's merely a mapping from one language to another. I bet there is no Julia language construction (together with all optimization flags) that cannot be written in valid Python (expect custom operators and like) with decorators (or special transpiler directives like in Transcrypt).
Ideally transpiler maps some special Python dialect to Julia near surjectively.
UPD: Not simply Python dialect but dialect and subset of Python.
Again,
If you want to discuss the idea you'd be welcome to do so on https://discourse.julialang.org.
It would be nice to have Transpiler from subset of Python (and special ~pythonjulia module named like "Juthon") to complete Julia lang.
And a dream looks like it should both be:
A good example of a transipiler from Python is Transcrypt that is a valid Python prior transpiling. But to achieve 1. this should be more like Julia in Python syntax (via IDE friendly mapping and juthon module with well-documented stubs) than attempt to implement Python's standard library.
The idea came from this discussion: Why Julia? Will Python/Numba and Python/Cython lose to Julia?