Explanation
Welcome to the Explanation section of the vcs documentation. This section covers how vcs works, its design principles, and our future plans.
Design principles
Vcs is designed to be backend-agnostic and concurrency-runtime independent. It's compatible with both Eio and OCaml Stdlib runtimes. We plan to explore the feasibility of supporting luv and miou runtimes as separate future work.
The concurrency runtime must be compatible with programs written in a direct style. Runtime based on monadic concurrent models such as Async and Lwt are purposely left outside of the scope of this project.
How It Works
Vcs is an interface composed of Traits, each providing different functionalities associated with Git operations. The dynamic dispatch implementation of Vcs is powered by the use of OCaml Objects under the hood, with some design guidelines aimed at making it so that users do not need to make much direct use of objects in their code.
Architecture
The vcs repository contains several components:
- vcs: The main entry point of the library. Marked with a * to indicate no runtime dependencies.
- user-lib: A placeholder in the diagram for any library that uses
Vcs. Also marked with a * to indicate no runtime dependencies. - executable: A placeholder for a runtime component based on
user-libthat commits to a specific backend and concurrency model. - volgo-git-backend: A IO-free library that parses the output of a
gitcli process. - volgo-git-eio: An instantiation of
Volgo_git_backendbased on anEioruntime. - volgo-git-unix: An instantiation of
Volgo_git_backendbased on the OCamlStdlib.
Relation to ocaml-git
ocaml-git is a pure OCaml implementation of the Git format and protocol. In the Vcs framework, a direct-style compatible ocaml-git is a potential backend for the interface (for example, let's call it ocaml_git_eio). We plan to create a Vcs backend based on ocaml-git in the future (depicted by the name volgo-git-mirage below).