3 ms·
Hey, Oso engineer here. Good question. The rust core is indeed called from the ruby library (as it is with all of our 5 other host libraries). The core itself
by gkaemmer 5y ago
Hey, Oso engineer here. Good question.
The rust core is indeed called from the ruby library (as it is with all of our 5 other host libraries). The core itself is pretty complex (there's a whole parser/interpreter in there), so maintaining it in a bunch of languages would be a bit hectic.
There are some files inside `lib/oso/polar/ffi` that define the C bindings used by the rest of the library. Here's an example: https://github.com/osohq/oso/blob/main/languages/ruby/lib/oso/polar/ffi/query.rb https://github.com/osohq/oso/blob/main/languages/ruby/lib/os...
We use the ffi gem to make that work: https://github.com/ffi/ffi https://github.com/ffi/ffi
EDIT: hobofan beat me to it! :)
- xcskier56 5y agoThanks for the explanation and the code locations!