Summary
git Use ID
Reowolf 2.0 implementation
Download as zip
Christopher Esterhuyse 3e63b3973c47
5 years ago
Christopher Esterhuyse ce6bcc0a0c26
5 years ago
Christopher Esterhuyse 0fb83f27a238
5 years ago
Christopher Esterhuyse cc23d3cb40d3
5 years ago
Hans-Dieter Hiep 3af8b6eaec1b
5 years ago
Christopher Esterhuyse 81a2e2e2be13
5 years ago
Christopher Esterhuyse 5137b1060291
5 years ago
Hans-Dieter Hiep ef3354517473
5 years ago
Hans-Dieter Hiep 935120e93ef1
5 years ago
Christopher Esterhuyse 1410a137843e
5 years ago

Reowolf 1.2 Implementation

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 had 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.

The current Reowolf 1.2 implementation focused on replacing the centralized algorithm for consensus with a distributed one. No longer are synchronous regions fixed, but they are discovered during each round at runtime. Furthermore, the consensus algorithm was adapted to allow multiple firings of a port within a single synchronous round. The components that constitute a protocol now run on a user-specified number of threads, scheduled as needed to complete the protocol's behaviour.

Compilation instructions

  1. Install the latest stable Rust toolchain (rustup install stable) using the rustup CLI tool, available for most platforms.
  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.

Library Overview

The library is subdivided into the following modules:

  • 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 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. One may also refer to the Reowolf 1.0 project's companion documentation for a higher level overview of the goals and design of the implementation.