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

Feature/vm dynload #49

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

Feature/vm dynload #49

wants to merge 37 commits into from

Conversation

cipher1024
Copy link
Contributor

Pull Request Description

Ensure you have read the contribution guide before filling in a description of the
pull request, regardless of whether it is complete or a work in progress.
All Pull Requests should include test case(s) which demonstrates the intended
behavior of a feature, or a regression test demonstrating that the fix resolves
the issue.

agentultra and others added 30 commits April 27, 2019 23:17
This module will allow the vm to dynamically link shared objects at
run time so that Lean can call external code written in C/C++.

Fixes: leanprover-community/lean #24
Following some conventions established in (#20) I added some
constructor functions to allocate the `vm_foreign_obj` struct in the
VM.
As I'm learning about the VM architecture in Lean I'm adding notes to
help future contributors.
We add libffi to our build dependencies
Add initial documentation on the VM FFI
WIP

We register a declaration attribute to bind foreign functions to Lean
constants like so:

    @[ffi `libfoo]
    constant foo_fun : c_int -> c_int -> c_int

Allowing the vm to get a handle to the foreign function from `dlsym`
and map it with a `ffi_cif` struct from `ffi.h`. This will allow Lean
users to then create functions using this type to marshal Lean values
into the bound `ffi_cif` and make the call with `libffi` under the
hood.
Fix relative paths to work on linux
Normalize the file path handed to `load_foreign_object`
@gebner gebner added the WIP Work in progress label Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants