I've noticed several patches from you today in which you're adding code
to try to load an existing library under additional library names for
cygwin support. It's beginning to look like this is a common operation.
I needed this for the OpenGL bindings, so I wrote a utility routine in
runtime/parrot/library/OpenGL.pir called _load_lib_with_fallbacks() that
encapsulates this sort of fallback behavior.
It would be easy to split that routine out into a utility library, and
use it everywhere, but I've got some concerns for which I'd like input
from the Parrot Porters:
1. If this is indeed a really common operation, it might be worth
moving it "down the stack". Instead of using a PIR library,
perhaps we should allow the loadlib opcode to take arguments
other than a single simple string, and use the additional info
to define fallbacks that are automatically tried.
2. It's not clear to me that a simple list of names is appropriate
everywhere. It works when all the variations are unique (and
fully compatible), but it doesn't work so well when the name of
library A on one platform is the same as library B on another
platform. But perhaps this is a problem that doesn't exist in
the wild, or is so rare it's simpler just to special case it.
3. If we try to do something "smarter" for #2, I fear being sucked
into a vortex of complexity, and I really don't want to go there.
Thoughts?
-'f