-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit includes a proposal for extending the OCaml part of the e…
…xtraction plugin. The new functionality includes: 1) Adding the command Extract Foreign Constant which marks a qualid as external. During extraction, instead of generating `val qualid : type` in mli and `let qualid = mlname` in the ml file, only the expression `external qualid : type = "external_fun_name"` is generated in the ml file. This way, the OCaml compiler knows that the function will be resolved by the C compiler/linker 2) Adding the command Extract Callback qualid which marks a qualid as external. During extraction, additionally to the synthesised function, an OCaml callback registraction function call is synthesised which exposes the function in order to be able to call it from C as closure. 3) Print and Reset commands to show and reset the currently defined externals and callbacks 4) Adoptions to CoqIDE in order to highlight the new commands 5) Adoptions to the Extraction Plugin documentation with the new section "Generating FFI Code" that describes the functionality in more detail. 6) Tests in the test suite With contributions by jfehrle, SkySkimmer and silene
- Loading branch information
Showing
13 changed files
with
415 additions
and
32 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...changelog/13-extraction/18270-master+fix18212-extractio-ocaml-ffi-extension.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- **Added:** | ||
Extension for OCaml extraction: | ||
Commands to extract foreign function calls to C (external) | ||
and ML function exposition (Callback.register) for calling | ||
being able to call them by C functions | ||
(`#18270 <https://github.com/coq/coq/pull/18270>`_, | ||
fixes `#18212 <https://github.com/coq/coq/issues/18212>`_, | ||
by Mario Frank). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.