# eryon

[![crates.io](https://img.shields.io/crates/v/eryon?style=for-the-badge&logo=rust)](https://crates.io/crates/eryon)
[![docs.rs](https://img.shields.io/docsrs/eryon?style=for-the-badge&logo=docs.rs)](https://docs.rs/eryon)
[![crates.io license](https://img.shields.io/crates/l/eryon?style=for-the-badge&logo=rust)](https://github.com/scattered-systems/eryon/blob/main/LICENSE)

***

_**Warning: this project is currently in the early stages of development and is not yet ready for production use.**_

`eryon` is designed to be a high-performance distributed computing library for Rust. The framework is derived from the Neo-Riemannian theory of music, using the tonnetz to describe the configurations of individual instances as well as the global structure. The library is designed to be highly modular, allowing for the easy addition of new features and the ability to swap out components as needed.

For more information please refer to the [documentation](https://docs.rs/eryon/latest/eryon/).

## Design

- `Plant`: isolated topological units of compute
- `VNode`: representations of individual partitions, each with its own `plant`
- `Runtime`: a headless system that manages allocated partitions to benefit the cluster
- `Cluster`: a user-owned collection of devices capable of supporting the `runtime`

## Features

- Knowledge coordination
  - Cross-node knowledge transfer and adaptation
  - Near-linear scaling performance
- Topological memory system with pattern recognition
- Runtime orchestration with automatic resource allocation
- Self-organizing surface networks for adaptive learning

## Roadmap

- [ ] `actors`

  - [ ] `plant` - the fundamental units of compute within the system a single instance of an actor, capable of running on a single device
  - [ ] `vnode` - a virtual node that represents a partition of the system, capable of running on multiple devices

- [ ] `blockchain` - introduce a hybrid multi-chain for monitizating computational resources
  - [ ] `consensus` - a suitable consensus algorithm for the system
  - [ ] `net` - develop a dynamic p2p networking stack
    - [ ] `cluster` - allow users to create clusters from registered devices
    - [ ] `mainnet` - a virtual network built ontop of the clusters

### _Long-term vision_

Our long-term goal is to manifest the unique capabilities of the framework in a multi-platform portal enabling users to confidently explore the next generation of internet-based experiences. Outside of the features listed above, the only remaining technical challenge for the framework is developing a psuedo-dsl that enables developers to develop context-aware, temporal frames for the edges of their "experiences". The generative visual framework (`gvf`) dynamically resolves various visual components of the UI according to the specifications needed to operate the experience while automatically injecting user-defined preferences where appropriate. As the user progress through the experience, the framework continously adapts the visual environment to fit the task at hand. The best way to imagine this process would be like the relationship between the skiier and the couse master w.r.t. slalom skiing. The course master doesn't setup a complete path for the participant, rather they setup checkpoints or goals for them to pass through. Each time they miss a frame, they lose points, but still have a chance to recover. Here, each time the experience starts going off track (missing frames), it will try and coach the user back on track before saving state and exiting the experience. This is a very high-level overview of the framework, but it should give you an idea of the direction we are heading. 

- [ ] `gvf` - a generative visual framework

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies.eryon]
features = []
version = "0.0.x"
```

### Examples

#### _Initialization: locally initialize a full layer of the system_

```rust
    extern crate eryon;

    use eryon::prelude::{NeuralPlant, Runtime};

    fn main() -> anyhow::Result<()> {
        tracing_subscriber::fmt()
          .with_max_level(tracing::Level::TRACE)
          .init();
        tracing::info!("Welcome to {name}", name = "eryon");
        
         // Create and initialize the runtime
        let mut runtime = Runtime::<NeuralPlant>::new();
        runtime.init_complete_layer()?;

        Ok(())
    }
```

## Getting Started

For more detailed instructions on how to get started with `eryon`, please refer to the [Quickstart Guide](https://github.com/scattered-systems/eryon/blob/main/QUICKSTART.md).

## Contributing

Pull requests are welcome. For major changes, please open up an issue first so that we can discuss what you would like to change. Additionally, make sure that any additions or modifications are thoroughly documented and tested.

## License

This project is licensed under the [Apache License 2.0](https://github.com/scattered-systems/.github/blob/main/LICENSE).
