You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation is using libcozo_c, but this library has lot of limitation. Instead of passing a cozoscript query, we should pass a cozo query data-structure, based on Erlang syntax (or from something close to Erlang syntax).
When invoking cozoscript:parse/1, this code will
____________________ ___________________ ___
| | | | / |
| cozoscript:parse/1 |---->| cozo_rust:parse/1 |--->| {ok, bytecode}
|____________________| |___________________| |____|
The same bytecode can be reinjected into another module
lie cozo_bytecode:eval/1 to be evaluated and get back the result.
___ ______________________ __________________
/ | | | | |
| B |--->| cozo_bytecode:eval/1 |--->| cozo_rust:eval/1 |
|____| |______________________| |__________________|
||
_||_
\ /
\/
___
/ |
| {ok, Result}
|____|
In fact, by using this strategy, we don't modify the current
structure of cozo application.
______________________
| |
+--->| cozo_nif:run_query/4 |-->Result
______________ | |______________________|
| | |
| cozo:query/3 |---(+)
|______________| / | ___________________ __________________
/ | | | | |
/ +--->| cozo_rust:parse/1 |-->| cozo_rust:eval/1 |-->Result
[based on params] |___________________| |__________________|
Cozo Rust Interfaces
A cozo core example can be seen in cozo bin source (REPL and server).
The current implementation is using
libcozo_c
, but this library has lot of limitation. Instead of passing a cozoscript query, we should pass a cozo query data-structure, based on Erlang syntax (or from something close to Erlang syntax).Cozo Rust Interfaces
A cozo core example can be seen in cozo bin source (REPL and server).
Cozoscript to Cozo bytecode
Erlang Terms to Cozo bytecode
Cozo bytecode to Erlang Terms
Erlang interfaces
Resources
The text was updated successfully, but these errors were encountered: