-
Notifications
You must be signed in to change notification settings - Fork 440
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
it should be possible to load native extensions from an object file at runtime #206
Comments
Use casese:
|
So you're suggesting that the commandline executable would do this so you don't have to write a frontend yourself (in the style of jsonnet_test_snippet)? |
Is there any way to do this portably? What if the user had to give the dynamic library using a commandline param and then it was assumed to implement a particular ABI? |
There are various degrees of support. We should be able to rig something up on linux and mac. Here's where luajit does it for unixy systems: That function is only defined three times in that file :)
Yes, this would be a feature of the jsonnet cli tool that would allow for some basic not-compiled-in extensions. It would server the "import" functionality for native functions. |
dlopen and dlsym are standard but they don't let you search for files or search through files. However if the user gave the filename and we assumed a particular function name (that set up all the callbacks) then it could work. |
* Make some filenames Windows-friendly * Update references to renamed files * Fix escaped filenames to run on non-Windows platforms
Similart to --jpath, we need an --npath that is search for symbols that match a convention, then dlopen and register them as native extensions. Lua supports a similar feature.
https://www.lua.org/pil/8.2.html
The text was updated successfully, but these errors were encountered: