-
Notifications
You must be signed in to change notification settings - Fork 30
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
datalog foreign function interface prototype #228
Conversation
CodSpeed Performance ReportMerging #228 will not alter performanceComparing Summary
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v5 #228 +/- ##
==========================================
+ Coverage 64.82% 65.44% +0.62%
==========================================
Files 25 25
Lines 6502 6729 +227
==========================================
+ Hits 4215 4404 +189
- Misses 2287 2325 +38 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
4f68cf3
to
949d273
Compare
c9a91d0
to
7d1297d
Compare
2daa976
to
90c6ca3
Compare
ff6d1f4
to
99c0718
Compare
This allows using external functions in datalog. This makes it easy to provide custom logic without extending the spec for every use-case, at the expense of portability: behaviour is no longer guaranteed to be consistent cross languages, and some languages won’t be able to support it at all (for instance JS as of now). Todo: - stricter conversions from datalog - feature-gating if possible Open questions: - enum index for the FFI variants (contiguous or not?) - how to provide functions (right now, function pointers: prevent mutability and closing over arguments) - how to provide arguments (right now, datalog::Term, so symbols have to be resolved, and functions returning strings have to register new symbols)
- using boxed functions instead of function pointers allow capturing the environment - using builder terms instead of datalog terms remove the need for manual symbol management
Instead of storing strings directly in the ops, do as we do for everything else and use the symbol table. This required duplicating `biscuit_parser::builder::Binary` and `Unary` in the `biscuit_auth::builder` module (which previously used the definitions from the `datalog` module directly). There is a lot of duplication between `biscuit_parser::builder` and `biscuit_auth::builder`, with a circular-ish dependency (biscuit_auth depends on biscuit parser, but code generated by the `ToTokens` impl blocks in biscuit parser depend on `biscuit_auth::builder`).
This ensures consistent evaluation of functions and removes the need of storing them in `RunLimits`
that will be a great tool for future experimentation |
This allows using external functions in datalog.
This makes it easy to provide custom logic without extending the spec for every use-case, at the expense of portability: behaviour is no longer guaranteed to be consistent cross languages, and some languages won’t be able to support it at all (for instance JS as of now).