Perhaps a variant of CC-BY NC would be better, but it is not tailored to code.
AGPL addresses that by putting code distributed as a web application in the same category as compiled code.
https://wiki.p2pfoundation.net/CopyFair_License
https://wiki.p2pfoundation.net/Copyfarleft
https://www.metamute.org/editorial/articles/copyfarleft-and-...
GCC is written specifically to prevent this sort of firewalling of the compiler to prevent it from being plugged into another piece of software and avoid GPL requirements.
Even then there's always the analogue/human loophole I suppose, similar to captcha mechanical turks.
I like how this general direction is discussed a lot in France, and sad about learning a language taking so much effort.