News for hackers. Stuff that matters.
Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge... by kevin_thibedeau on Thursday August 06, 2020 @11:53AM (#24072095)
I made all my Py2 code forward compatible with 2to3. It was mostly a smooth process when you're using the future imports and know what landmines to avoid. It still required manual intervention at times with Unicode support and libraries that have breaking API changes between versions.

The end result is something that can be Py3 native whenever I want. 2to3 is the right tool for the job. There is no way to map all Py3 features back into Py2 so 3to2 would be a broken mess that only supported a subset of the language.

Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge... by kqr on Thursday August 06, 2020 @12:55PM (#24072835)
> There is no way to map all Py3 features back into Py2 so 3to2 would be a broken mess that only supported a subset of the language.

Oh but there is. If you can map them to bytecode, you can map them to Python 2, which is a fully capable language. It won't be a one-to-one map, but that's also not required.

Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge... by kevin_thibedeau on Thursday August 06, 2020 @01:26PM (#24073191)
Not going to work for async.
Re:Node Modules at War: Why CommonJS and ES Modules Can’t Ge... by Macha on Thursday August 06, 2020 @01:32PM (#24073275)
Why not? Provide your own future implementation, transform the async code into a state machine. Babel does exactly this for JavaScript async.

Sure the generated code is a horrific mess to look at but even that's a solved problem with sourcemaps if you need to debug it.