open-psa / mef

The Open-PSA Model Exchange Format
https://open-psa.github.io/mef
5 stars 7 forks source link

Extern library specification #53

Open rakhimov opened 7 years ago

rakhimov commented 7 years ago

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 commented 7 years ago

I have implemented this proposal in SCRAM https://github.com/rakhimov/scram/issues/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).