Conversation
02cb06d to
fe6feee
Compare
|
Thanks a lot for this! I will try to have a look at this PR this week. I’m a bit surprised by this:
Though the idea is very nice, This is summarized by this graph introduced in a blogpost about how to use |
|
@lthms Thank you very much for the detailed reply. It looks like I misunderstood what coqffi is doing. I will mark this PR as draft and study your blog post further so I can amend the implementation. |
fe6feee to
9571e96
Compare
|
@lthms I've updated this PR so that it now takes in the cmi of the specified module instead. In order to do this, the user must specify which library is being talked about. This allows for composition with libraries in a workspace or those that are installed. For now, only libraries installed using Dune are supported (due to the presence of cmi). I thought about allowing for multiple libraries, but that would make resolving the module name trickier. Another question: Do you want flag support? |
9571e96 to
30cf20d
Compare
30cf20d to
89a095a
Compare
89a095a to
b2a98ba
Compare
b2a98ba to
b790764
Compare
|
I've added some basic flag support. |
|
The support you are describing looks awesome, thank you so much for doing it. I on the other hand have not been the best reviewer you could have hoped for. I had a quick look this evening, mostly the code part, and the tests. Looks good so far. I plan to have a test-run of my own this week. |
|
I've also added |
96eca16 to
2e71dac
Compare
|
OK so there is a huge issue with this PR atm, which is that coq.theory cannot pick up the output of the coq.ffi stanza. I will try to fix this, but if I don't finish this week, coq.ffi will have to miss 3.6. |
b0be94b to
3d23123
Compare
|
I've fixed the ability for coq.theory to pick up the generated .v files. However I had to drop support for |
3d23123 to
df808fc
Compare
|
I agree. Besides, using |
This adds a coq.ffi stanza with a (modules ) field which turns specified .mli files into .v files using coqffi. The intended use case is for the .mli file to become the interface for the .ml file extracted from the .v file. TODO: Add fields for more arguments to coqffi? Signed-off-by: Ali Caglayan <alizter@gmail.com> ps-id: 0347ad6c-3758-4184-8bcf-29fdee6b1f29
df808fc to
fec8a13
Compare
ejgallego
left a comment
There was a problem hiding this comment.
Rules look good, however coqffi is an independent tool and indeed the code this PR adds doesn't depend on anything from the Coq_* namespace, so I suggest to place the code instead into a Coqffi file (which submodules Sources, Stanza, etc...` if desired; similar for the tests.
|
Moreover this should maybe be guared with |
|
Can If we do, I think it would make more sense taking the time to support this. For a list of modules sorted by dependencies relation
(with the correct path prefix) By doing so, it’s possible to have Does it makes sense? |
|
@lthms , yes it makes sense, and Dune can do that. I guess in your case the dep information is what |
|
Exactly! The set of |
|
OK seems I need to do some more work on this. I have split coqffi into its own stanza/language/files so that we can easily work on it in the future. I need to understand how the .ffi file rules will work so I will open a new draft and close this PR. |
|
Why do we need to close PRs just to reopen them again? It makes the dicussion harder to follow, and worse meta-data in general. |
|
@ejgallego because this is now a new feature and not an extension to Coq lang. |
We can just rename the PR? Anyways, not a big deal, just wondering about the logic as a curiosity. |
This adds a coq.ffi stanza with a (modules ) field which turns the
cmis of specified modules of a library into .v files using coqffi.Currently we only support
cmi's from libraries in the workspace and those installed using Dune.cc @lthms would appreciate if you could take a look.