Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We have internally developed a library for generating `extern` extern functions out of existing Rust source code named `irohairoha_ffi` ffi (the library will be renamed and released as a separate crate). While this is a powerful library in itself, the `cbindgen` cbindgen library for generating C/C++ header files out of Rust source code is missing one crucial feature for these two to interoperate, namely the ability to resolve associated types. To tackle this, first part of this internship will be to add the support for resolving associated types into cbindgen. Since cbindgen's parser is a simple one it is believed that we can use it directly as is to parse MIR (which resolves all associated types) instead of Rust source code with minimal modifications. If this is not sufficient (which will surface once we start using `cbindgen` cbindgen), the task will be to integrate with the `cbindgen` cbindgen's parser so that it parses Rust source code first and then uses MIR to fill out associated types. Second part of the internship will be to use `irohairoha_ffi` ffi library to generate `extern` extern functions out of existing functions in the `irohairoha_client` client library or write them manually if the case so requires (preferably not). Third, and the final, part of the internship will revolve around generating C header files from the `extern` extern functions exported from `irohairoha_client` client library. At this step we will determine if we're missing any crucial features to enable this interop and reevaluate our progress. Hopefully, by the end of the internship we will have the object files and C header files ready to be linked against by the SDK. If the time allows we would like to create a small demo application based on the Java SDK demonstrating that we can successfully link and call functions from the generated object file

...

1. cbindgen(git@github.com:mozilla/cbindgen.git),
2. iroha2(git@github.com:hyperledger/iroha.git) branch: `iroha2iroha2-stable`stable
3. iroha2-java(git@github.com:hyperledger/iroha-java.git)

...

  •  Add the functionality to parse function signatures with associated types out of MIR to cbindgen (either by itself or in addition to Rust source code)
  •  Write tests that will cover the functionality of parsing associated types in cbindgen
  •  Open a PR to merge this code into cbindgen, progress with further tasks as we wait for this to be approved

Eval 2:

  •  Use `iroha iroha_ffi to generate extern functions out of existing Rust code, make
  •  Make corrections to the iroha_ffi library in this process
  •  Use cbindgen
  • if needed or write manual implementations of extern functions

Eval 3:

  •  Refactor the code, check what high-priority tickets can be implemented in a reasonable time
  •  Update the codebase with selected tickets
  •  Use cbindgen to generate C .h header files out of extern functions in the Rust source code
  •  Conduct manual testing
  •  Address the code bugs

...

  •  Document the mentorship results
  •  Present final Create a small app demonstrating that you have successfully linked the shared object with the C header files
  •  Present your results


Timeline

Dates

Tasks/Plan

Status

June 1 - June 14

revisit knowledge of Rust
run iroha nodes and connect to it via both `iroha_client_cli` and client app
run cbindgen on a small example: - export a function from Rust - generate C bindings with cbindgen - link this C lib from C and Java


June 15 - June 28

fork the cbindgen repository
add the functionality to parse function signatures from MIR


June 29 - July 12



July 13 - July 26

July 27 - Aug 9

Aug 10 - Aug 23

Aug 24 - Sept 6

Sept 7 - Sept 20

Sept 21 - Oct 4

Oct 5 - Oct 18

Oct 19 - Nov 1

Nov 2 - Nov 12

...