4 ms·
Yeah it will pretty much always boil down to mutable global state when you have "spooky action at a distance." Like, in python, there is one import cache, so I
by richard_todd 9y ago
Yeah it will pretty much always boil down to mutable global state when you have "spooky action at a distance." Like, in python, there is one import cache, so I can import os, and redefine os.pipe() to be some other function. Then any other module importing os get's MY version of pipe(). That's a recipe for disaster and of course the real-world answer in all these cases is "don't do that."
I love Perl5, smalltalk, lisp, etc., and I guess for that reason I feel like we have plenty of great languages where these hazards are exposed already. I'm not excited by yet another one. I'm more interested in new languages that attempt to allow crazy hacks in a contained way, so things still compose in the large.
- bdmatatu 9y agoIn the example, the effects of "use Jolly" are restricted to the enclosing scope, e.g. use lib <.>; { use Jolly; # inner scope } # TODO: this does not throw an error
- richard_todd 9y agoI don’t have a problem with that. It can still be hard if you also want to “use Holly;” which wants some incompatible syntax hack, but at least it is lexically contained. I think the main reason this stuff tends to work out ok is that it’s so rare (in practice there aren’t enough Holly’s and Jolly’s in play so you don’t ever need to use both in the same scope).