Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extern library specification #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rakhimov
Copy link
Member

The existing extern-function specification doesn't clarify
the origin of functions (issue #37).
This 'extern-library' specification complements the 'extern-function'
by providing a way to define the source library for functions.
'extern-library' is a dynamic library loaded at runtime,
and 'extern-function' is a C function in the library
looked up by its symbol (name).
This is a flexible and cross-platform way to allow extensions
but not without drawbacks (more about this in the spec).

I am not sure what the MEF original 'extern-function' creators wanted it to be,
but it doesn't seem to be fully specified or tool-agnostic (portable).
My proposal is one of ways to clarify and 'empower' this MEF element.
This 'flexible' way of defining extern-function may be a bit tedious to implement
but definitely achievable across tools and platforms (I think).

I have yet to implement it myself and see what can be improved.
Meanwhile, I would love to get your feedback on this proposal.

Closes #37

@rakhimov
Copy link
Member Author

I have implemented this proposal in SCRAM rakhimov/scram#74.
The major challenge has been the support for the variety of function interfaces (100+).
This can be achieved with tedious manual enumeration or with some code generator
(e.g., C++ templates in the case of SCRAM).

The existing extern-function specification doesn't clarify
the origin of functions.
This is an attempt to provide ways
to load extern C functions from dynamic libraries.
This specification complements the 'extern-function'
by providing a way to define the source library for functions.
'extern-library' is a dynamic library loaded at runtime,
and 'extern-function' is a C function in the library
looked up by its symbol.
This is a flexible and cross-platform way to allow extensions
but not without drawbacks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant