Hello,

My interest in this group is to gather ideas and hopefully cooperate together to build peer-to-peer applications

Arthur prefers to have a working application before submitting a SRFI.

I want to demonstrate that something like Mastodon is possible to do.

# User interface

Toward that goal, I started a survey to learn more about the habits and preferences of schemers on what is related to user interfaces. See https://framadate.org/ZSErX5mekw1vpHQi

It seems like command line interface (CLI) will be the best choice, things like git, sed et al. The second choice being a terminal user interface (TUI) in the spirit of weechat, vim, nano et al. I am in favor of a TUI because I would like the application to be a single processus (in the sense of POSIX). A CLI, will require to have a service running in the background to allow the peer-to-peer (p2p) network to actually happen. p2p work with resource sharing, which means that user must keep a processus running so that other users can actually store and fetch data. A background service or daemon will lead to more ceremony. Also, I think a CLI will limit the possible interactions that are possible and in the end the kind of applications one can build. I did not find a compelling CLI for mastodon or twitter.

So, I will settle on a TUI. There is three main TUI libraries:

- http://www.leonerd.org.uk/code/libtickit/
- https://www.gnu.org/software/ncurses/
- https://github.com/nsf/termbox/

There is also John's pre-SRFI called cell-terminal, that I am working on at https://github.com/amirouche/cell-terminal

On top of cell-terminal, it will be nice to have some layout algorithm inspired from CSS flexbox. There is an existing implementation by facebook but it is not free. There is also a rust implementation at https://github.com/vislyhq/stretch.

# Networking

The actual communication happens over the Internet (using UDP in the prototype). One thing I did not implement is NAT traversal.

Here is the list of things I can think of that are required to implement the network protocol:

- Scheme expression serialization (ASN, Gambit, SRFI-167 pack)
- Non-blocking network sockets (guile-fibers, Gambit, arew's untangle)
- cryptographic primitives, see industria: https://github.com/weinholt/industria

Another approach, would be to rely on https://libwebsockets.org/ instead of raw sockets.

# Summary

Required libraries:

- cell-terminal
- css flexbox
- non blocking udp sockets
- scheme serialization into bytes
- cryptographic primitives

The early draft is available at: https://github.com/scheme-live/peer-to-peer