On Sat, Jul 25, 2020 at 12:09 PM André Roberge email@example.com wrote:
On Fri, Jul 24, 2020 at 10:43 PM Chris Angelico firstname.lastname@example.org wrote: SNIP
If we had some sort of easy to use standard library support for transpiling code, then your advice could actually be practical and not just dismissive. "Pft, if you don't like it, write your own language" is not exactly practical for most people. Even if a transpiler is a tad simpler than writing an entire interpreter or compiler, it's still a new language.
... would be best done with stdlib support, yes. I think import hooks can do everything that's needed, but I've never actually done it. Normally I'd just use a simple source-to-source transformation before execution, and usually I do things that aren't ever going to show up (string literals aside), so I don't need it to be very smart.
Already done (with a different keyword):
Thank you. Especially since the source code is extremely short:
I'd like to see this 'ideas' module (or similar) better known. It'd help a lot with complaints like Steven's.