The unasked question never gets answered. I don’t know if you can
practically use the following suggestion, but it may be clarifying anyway.

When an amateur develops code incorrectly, s/he sometimes ends up with a
code object that doesn’t run because of intermediate compiler optimizations.

As an example, you could ask a high school class to individually build a
26x26 grid, with the first line having abcdef…xyz; the second line having
zabcd…wxy, and so on. This often results in code that has been corrected,
but will not run correctly because of pre-mature compiler optimizations.

Another task that might illustrate this artifact of program development
might be to have amateurs write a function that raises a^b mod x.

When programming in a C++ environment, this is monitored by keeping track
of “commit charges.”

I’m imagining the following solution. Instead of implementing compiler
optimizations at every execution, have python run completely interpretive
like old Basic. Then introduce a command line switch, that tells python you
are ready to employ compiler optimizations.

There exists a -O switch; there is also a “compileall,” command,  both of
which introduce optimizations. It isn’t clear what each does that is
different, or how to turn all optimizations off for purposes of testing
(usually bad) logic.

Would python benefit as a language by introducing a clearer deliberation as
to when the “commit charge,” occurs?

I ask this only to suggest clarity of thought… it might be impractical to
disambiguate them all, after “killing yourselves,” making the language run
like a bat out of hell already.

Thanks for all you do,

James Johnson
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/5IBZCY5Q54BXK7YHB4EY5FY22ZDKOZX4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to