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

Foreign function interface (FFI) with easy to use macro #29

Closed
c3d opened this issue Feb 8, 2020 · 1 comment
Closed

Foreign function interface (FFI) with easy to use macro #29

c3d opened this issue Feb 8, 2020 · 1 comment
Assignees

Comments

@c3d
Copy link
Owner

c3d commented Feb 8, 2020

Provide an easy-to-use way to generate the foreign function interface (FFI) to call into C code.

The objective is make it very quick to "export" a C function in such a way that it can be called by XL code. Ideally, the whole process would be automated by the C++ compiler using meta-programming techniques.

@c3d c3d added the enhancement label Feb 8, 2020
@c3d c3d self-assigned this Feb 8, 2020
@c3d
Copy link
Owner Author

c3d commented Feb 8, 2020

Implemented in the native.h header file.

Typical usage found in the runtime.

Tree *  xl_evaluate(Scope *scope, Tree *tree)
// ----------------------------------------------------------------------------
//   Dispatch evaluation to the main entry point
// ----------------------------------------------------------------------------
{
    return MAIN->Evaluate(scope, tree);
}
XL_NATIVE(evaluate);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant