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
Mechanize interface generation, part 2 #43
Conversation
e3f0b36
to
d2b8ce9
Compare
Codecov Report
|
@@ -1,7 +1,7 @@ | |||
[package] | |||
name = "lightning-sys" | |||
version = "0.2.1" | |||
authors = ["Peter Elliott <pelliott@ualberta.ca>"] | |||
authors = ["Peter Elliott <pelliott@ualberta.ca>", "Darren Kulp <darren@kulp.ch>"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope adding my name is all right here. I do not care so much, but I thought it would make sense to match the crates.io
ownership list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About time :^)
d2b8ce9
to
94e9851
Compare
I am planning to get back to this soon (at worst, by early August), with robust justification; I just ended up working on other things for a while. |
94e9851
to
6e0e54c
Compare
`jit_entry`-style support for aliases of these functions will not be ready right away. For convenience, collect these aliases for specific entry points that are not provided by `jit_entry` yet.
This stops jit_register_p from being split into `jit_registe`, `r`, `_p`.
Check for entry point existence Introduce infrastructure for top-level wrappers Add explicit ignores for many instructions Convert compilation check to run check
Prevent testing for jit_destroy_state Avoid testing disassembly when not present
`cargo doc` shows that entry points like `JitState::jit_absr_d` were being exposed publicly outside the crate. This seems to be because, despite being in a non-`pub` `mod` named `raw`, they are associated with a `pub` `type` named `JitState`. Hide them internal to the crate for now.
Drop exclusion for destroy_state -- it is safe to call it now.
5739b02
to
62b6eb3
Compare
I am splitting the current PR into several new PRs.
This splitting-up should make it easier to evaluate the costs and benefits of the new implementation. Much of the benefit is gained from parts 1-3. |
Goals
lightning-sys
, as opposed to being hiddenMeans
Using the foundation laid in #32, the current PR implements a pattern-matching paradigm to generate public entry point wrappers.
jit_
macro exposed by GNU lightning will either match a pattern (and have a generated entry point) or fail to match (and cause a build error).Gains
jit_
-macro entry points advertised by GNU lightning'slightning.h
exist, and (in most cases) that the entry points can be called with zeroed parameters without crashing.Costs
The new implementation (including work done in #32) carries a significant burden of complexity, especially in macros. The use of
tt-call
makes the macros more composable and understandable individually, but contributes to the verbosity of the macro implementation.