Open
Conversation
Currently, `decode` for custom jets does not working. Probably bug in encoding tree pasted into `decode_bits!`
Changed handle for FFI jet value since `Jet` trait requires it to be `Copy`. It involves storing index of jet's val inside `ALL` array. `decode` func is mocked for now since I think it worth just paste original Elements decode tree inside and then implement it via fallback if `Clone` will become available. `c_jet_ptr` is also mocked because Box<dyn Fn...> can't be used and I have not figured out how to mitigate this issue.
Moving `BitIter<I>` via FFI was too complicated, so I implemented auxiliar function `decode_bool_iter`, which takes `&mut dyn Iterator <Item = bool>`. It also stores entire encoding tree, so is safe now. We can reimplement fallback strategy if `Clone` on `BitIter` would become available. Custom jet codes now store 20 bits (16 bits of hash + 4 bits of prefix)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Implemented:
jet_plugins::register_jets!: A macro that implements the Jet trait for user-defined functions, alongside a corresponding C interface.core::jets::jet_dyn: A C interface for interacting with custom jets and theirJettrait implementations via dynamic libraries.service::custom_jet: Glue code for re-importingJetimplementations from a dynamic library.service::jet_backend: A wrapper to invoke defaultElementsjets if no dynamic library is provided via environment variables.