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
tool / compiler-switches for reading out signatures from compiled files #6757
Comments
Comment author: @gasche The .cmo/.cma themselves do not store typing information, it is in the .cmi for each individual module (.cmo has the implementation, not the interface). Each .cmo has a hash of the .cmi that it uses to check consistency: when you link foo.cmo, the compiler ensures that is exports the same interface that the other modules were compiled against. Now let's assume your question is "how to see the interface of this foo.cmi" or "how to see the interface of foo.cmi which is somewhere in my include path": you may use ocp-browser for that purpose (opam install lambda-term ocp-index): "ocp-index -I ." will run with the standard include paths plus the current directory, and typing "Foo." will complete with the interface of module Foo. (ocp-browser implements a rich command-line interface (thanks to lambda-term), there is also ocamlbrowser (opam install labltk) with the same features, but a Tk GUI.) |
Comment author: @lpw25 I think that cmitomli (available in opam) also provides this feature. |
Comment author: @gasche Oliver, shall we consider this PR resolved then? |
Comment author: oliver OK; I looked at cmitomli, tried it out. This is very helpful and can be used for my purposes. (Nevertheless I think such a tool should be part of the original OCaml-distribution.) |
Comment author: @alainfrisch No strong need for the tool in the core distribution. |
Original bug ID: 6757
Reporter: oliver
Status: closed (set by @alainfrisch on 2015-12-02T15:41:51Z)
Resolution: won't fix
Priority: normal
Severity: feature
Platform: ./.
OS: ./.
OS Version: ./.
Version: 4.02.0
Category: ~DO NOT USE (was: OCaml general)
Bug description
With ocamlc -i foobar.ml
you get the signature of a ml-file.
To find out the signature of cmo-/cma-/cmxa-/.../-files
there seems to be no way.
Making it possible to get the signatures of such files
printed to stdout would be nice.
The text was updated successfully, but these errors were encountered: