Changeset - 924de832fc60
[Not reviewed]
MH - 4 years ago 2021-06-01 11:54:12
contact@maxhenger.nl
Modify readme
1 file changed with 20 insertions and 21 deletions:
README.md
20
21
0 comments (0 inline, 0 general)
README.md
Show inline comments
 
# Reowolf 1.0 Implementation
 
# Reowolf 1.1 Implementation
 

	
 
This library provides connectors as a generalization of sockets for use in communication over the internet. This repository is one of the deliverables of the [Reowolf project](https://nlnet.nl/project/Reowolf/) funded by the NLNet foundation.
 
This library builds upon the previous Reowolf 1.0 implementation, with the intention of incrementally moving towards Reowolf 2.0. The goals of Reowolf 2.0 are to provide a generalization of sockets for communication over the internet, to simplify the implementation of algorithms that require distributed consensus, and to have a clear delineation between protocol and data whenever information is transmitted over the internet.
 

	
 
The Reowolf 1.1 implementation has the main goal of extending the Protocol Description Language (PDL) to be more pragmatic. The language now supports `struct`, `enum` and `union` types, has support for basic ad-hoc polymorphism, supports basic pattern matching, and makes channels of communication specify the types of values they're transmitting.
 

	
 
Reowolf 1.2 will focus on replacing the centralized algorithm for consensus with a distributed one. The distributed implementation should reduce the overhead of synchronization and consensus, especially in the case where the communicating parties are governed by simple protocols.
 

	
 
## Compilation instructions
 

	
 
1. Install the latest stable Rust toolchain (`rustup install stable`) using the [rustup](https://rustup.rs/) CLI tool, available for most platforms.
 
1. Have `cargo` (the Rust language package manager) download source dependencies, and compile the library with release-level optimizations with `cargo build --release`: 
 
	- The resulting dylib can be found in `./target/release/`, to be used with the header file: `./reowolf.h`.
 
	- *Note*: A list of immediate ancestor dependencies is visible in `./Cargo.toml`.
 
	- *Note*: Run `cargo test --release` to run unit tests with release-level optimizations.
 
1. By default, will compile with logging turned ON and session optimization turned OFF. Control this by passing the desired set of feature flags in {"no_logging", "session_optimization"} to the compiler. For example, `cargo build --release --features no_logging`.
 
2. Have `cargo` (the Rust language package manager) download source dependencies, and compile the library with release-level optimizations with `cargo build --release`. Run `cargo test --release` to run the available tests with release-level optimization.
 

	
 
## Using the library
 
- The library may be used as a Rust dependency by adding it as a git dependency, i.e., by adding line `reowolf_rs = { git = "https://scm.cwi.nl/FM/reowolf" }` to downstream crate's manifest file, `Cargo.toml`.
 
- The library may be used as a dynamically-linked library using its C ABI as the cdylib written to `./target/release` when compiled with release optimizations, in combination to the header file `./reowolf.h`.
 
- When compiled on Linux, the compiled library will include definitions of pseudo-socket procedures declared in `./pseudo-socket.h` when compiled with `cargo build --release --features ffi_pseudo_socket_api`. The added functionality is only needed when requiring that connectors expose a socket-like API.
 

	
 
## Examples
 
The `examples` directory contains example usages of connectors for message passing over the internet. The programs within require that the library is compiled as a dylib (see above).
 
The library may be used as a Rust dependency by adding it as a git dependency, i.e., by adding line `reowolf_rs = { git = "https://scm.cwi.nl/FM/reowolf" }` to downstream crate's manifest file, `Cargo.toml`.
 

	
 
## Notes
 
3. Running `cbindgen > reowolf.h` from the root will overwrite the header file. This is only necessary to update it.  
 
## Library Overview
 

	
 
## Short User Overview
 
The bulk of the library's functionality is exposed to the user in two types: 
 
1. `protocol::ProtocolDescription` 
 
1. `runtime::Connector` 
 
The library is subdivided into the following modules:
 

	
 
The former is created using `parse`. For the most part, the user is not expected to interact much with the structure, only passing it to the connector as a communication session is being set up.
 
- `collections`: Utility datastructures used throughout the compiler.
 
- `protocol`: PDL parser, compiler and runner. It is itself subdivided into:
 
	- `eval`: The evaluator of the compiled language. Currently an AST walker with cell-like memory management.
 
	- `parser`: The compiler itself, responsible for lexing, parsing and validating the incoming source.
 
	- `tests`: Language tests.
 
- `runtime`: The PDL runtime.
 

	
 
The latter is created with `new`, configured with methods such as `new_net_port` and `add_component`, and connected via `connect`, whereafter it can be used for multi-party communication through methods `put`, `get`, `next_batch`, and `sync`.
 
The code's entry point for the compiler can be found in `src/protocol/parser/mod.rs`. It accepts several input source files which will then all be compiled at once. Compilation is achieved through several helpers found in `src/protocol/parser/pass_*.rs`.
 

	
 
## Contributor Overview
 
The details of the implementation are best understood by reading the doc comments, starting from the procedures listed in the section above. It is suggested to first/also refer to the Reowolf project's companion [documentation](https://doi.org/10.5281/zenodo.3559822) for a higher level overview of the goals and design of the implementation.
 
\ No newline at end of file
 

	
 
The details of the implementation are best understood by reading the doc comments, starting from the procedures listed in the section above. One may also refer to the Reowolf 1.0 project's companion [documentation](https://doi.org/10.5281/zenodo.3559822) for a higher level overview of the goals and design of the implementation.
 
\ No newline at end of file
0 comments (0 inline, 0 general)