proposed api (new built-in):
cvalue( (:sym, :lib), Type ) :: Type
functionally equivalent to
unsafe_ref( convert( Ptr{T}, dlsym( :sym, dlopen(:lib) ) ) )
but with only the unsafe_ref call occurring at runtime, the rest being converted into a llvm global at compile time (similar to the first argument to ccall)
additionally, another valuable function would be
cexists( (:sym, :lib) ) :: Bool
then I think dlsym/dlopen can be removed from the language?