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

Allow dynlink/eval usage #5

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Allow dynlink/eval usage #5

wants to merge 5 commits into from

Conversation

copy
Copy link
Contributor

@copy copy commented Jan 26, 2022

Fixes #2. This set of commits changes the public api to allow using ocaml-jit as a mechanism similar to dynlink (or eval in dynamic languages). Instead of init_top we expose jit_load and jit_lookup_symbol. Additionally I expose Symbols, Address and Globals in order to be able to pass symbols from external libraries (eventually I'd like to remove Global.symbols and pass them to jit_load, which should also make unloading easier).

I also added a simple eval example. It uses quite a bit of OCaml's internal apis (although not much more than ocaml-jit itself). I'm not sure how maintainable it will be between compiler changes, but it should serve as a nice demonstration.

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

Successfully merging this pull request may close these issues.

Use as as Dynlink-like extension mechanism
1 participant