I still don't understand the dynamic library stuff related to "fname". Is it a hint for a compiler to link against a given library? Any compiler surely has some kind of option/pragma for this already. What should it mean when there is a corresponding static lib, but not a dynamic one? Most of the time one doesn't really care about this. What should it mean for an interpreter? dlopen-ing? How should the condition
"... if the external entity has to be obtained from a dynamically loaded library ..."
be implemented, i.e. when does "fname" simply denote the header to #include and when does it denote something related to a DLL? It looks like mixing two unrelated concepts here.
I thought we agreed to remove the specification of libraries from the FFI, and leave it to some compiler-dependent mechanism. As Sven points out, there are going to be times when you really don't want a library at all, or in any case not one with the same name as the header file, and there will be cases where you want several libraries in some system-dependent order that shouldn't be placed in the source code. GHC already has such a mechanism: the package system, and additionally using fname as a library spec would make our lives somewhat harder. I suggest just deleting the sentence "Moreover ... may be made." on page 6. Cheers, Simon
Simon PJ writes:
I thought we agreed to remove the specification of libraries from the FFI, and leave it to some compiler-dependent mechanism. As Sven points out, there are going to be times when you really don't want a library at all, or in any case not one with the same name as the header file, and there will be cases where you want several libraries in some system-dependent order that shouldn't be placed in the source code.
I'm certain that at least one person (me) disagreed with removing any library specs from the FFI. I tend to the view that if the compiler needs to know about something (and can't work it out for itself) the information should be in the source code. Putting it in a Makefile or some other auxiliary structure (package configuration?) is not really clean enough for me. I don't want to have to write three different Makefiles, one for each possible compiler I could use. Please let's aim for portability. Having said that, it is true that the FFI may not be the best place for a specification of link libraries or whatever. Maybe we should agree on some pragmas for this sort of information? In any case, I'd like to have a compiler-independent standard, whether or not it is part of the FFI. Regards, Malcolm
participants (2)
-
Malcolm Wallace -
Simon Marlow