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 idea here is to use a crate in an edge, like cardano_storage.
In a edge file, trying to do :
use cardano_storage::{Storage};
lead to
unresolved import `cardano_storage`
and if we add
extern crate cardano_storage;
we get
can't find crate for `cardano_storage`
expected behaviour
the code compiles cleanly
Solutions?
RustFBP level
The problem is that for the moment, the edges are all in the "rustfbp" compilation. So if we want to add crate in an edge, we will need to compile RustFBP with the external crate.
This solution also means we will need to compile RustFBP with all the nodes we will use, no way to add a new node while a program is running. Not very dynamic.
The node level
In the past, we used to put all the content of the edge's files on the top of the agent, so that each agent will have to import the external crate needed by the edges. It can lead to some "boiler-plate" and "strange" dependency management.
The edge level
Perhaps it is possible to consider each edge as an entire crate? its will manage its own dependencies. The agent will do :
extern crate cardano_blockchain;
use cardano_blockchain::*;
agent!{
input( in: CardanoBlockchain)
....
This seems the cleaner solution, even more that we can clean the "boilerplate" import with a macro like the racketone :
edge!(cardano_blockchain);
But it also mean we will have more library to manage (one more for each edge), and also the compilation of the different external crates of each edge (which can be manage with nix, xin, cargo workspace, ...).
The problem with the node level and edge level
We put all the edge declaration at the rustFBP level in this commit, because we had problem with multiple compilation of the RustFBP crate shared by the agent, when connected them together.
It is possible to have another solution, that use "raw pointer", because we now the nodes can be connected (it is the same struct, compiled with the same version of everything). I have a POC of that.
The text was updated successfully, but these errors were encountered:
Okay, yeah best to settle on using cardano_c bindings in rkt-fbp. Once xin comes into place we can look at the issue of these rustfbp moving pieces more clearly.
Steps to reproduce
The idea here is to use a crate in an edge, like
cardano_storage
.In a edge file, trying to do :
lead to
and if we add
we get
expected behaviour
Solutions?
RustFBP level
The problem is that for the moment, the edges are all in the "rustfbp" compilation. So if we want to add crate in an edge, we will need to compile
RustFBP
with the external crate.This solution also means we will need to compile
RustFBP
with all the nodes we will use, no way to add a new node while a program is running. Not very dynamic.The node level
In the past, we used to put all the content of the edge's files on the top of the agent, so that each agent will have to import the external crate needed by the edges. It can lead to some "boiler-plate" and "strange" dependency management.
The edge level
Perhaps it is possible to consider each edge as an entire crate? its will manage its own dependencies. The agent will do :
This seems the cleaner solution, even more that we can clean the "boilerplate" import with a macro like the
racket
one :But it also mean we will have more library to manage (one more for each edge), and also the compilation of the different external crates of each edge (which can be manage with nix, xin, cargo workspace, ...).
The problem with the node level and edge level
We put all the edge declaration at the
rustFBP
level in this commit, because we had problem with multiple compilation of theRustFBP
crate shared by the agent, when connected them together.It is possible to have another solution, that use "raw pointer", because we now the nodes can be connected (it is the same struct, compiled with the same version of everything). I have a POC of that.
The text was updated successfully, but these errors were encountered: