Each new programming language comes with its own syntax and definitions<p>For example, def, fn, func,...<p>How hard is it to convert rust syntax to python so that programmers can write rust programs with python sytax?
It depends a lot on how idiomaic you wan to the "python" code to look.<p>I guess you wish that a person can see it and think it's python with a few surprising &mut here and there. It will be a hard decition to select what to add to "python" to be able to write (almost) any program in rust.<p>Another hard decition is what python synax to remove. Do you want to support list comprehension?<p>A few years ago, Racket was rewriten to use Chez Scheme as a "backend". It took 4 years (or more), and Matthew is extremly good programing. It was harder becuse the objective was to get a new version that is bug compatible and as fast as the old one. It was easier because a lot of the hard decitions were avoided becuse the programs in new version should be identical to the programs in the old one.<p>So my guess is that you need like a year.<p>(Are you planing to port the standard library? I don't know enough about python and rust to show an example, but sometimes in one language the name of the functions or the order of the parameters is different.)
First you need a parser, since the rust parser can't parse everything that is valid in python and it excludes whitespace.<p>After it has been parsed in an valid manner, simple scripts can be converted to rust. types that require lifetimes, pointers and generics will be much harder.