System
This page provides some explanation for how the Coputer network works by showing how this page was generated and served to you. The network is split up into a number of separate systems, so the function of each will be outlined here.
Gateway
The process begins when your browser sends a request is sent to a gateway, the entrypoint for the Coputer network for any programs written to produce web requests. (aka all of them, since web programs are the only available program type at the moment)
The gateway, such as the one hosted at coputer.heliodex.cf, looks at the parameters of the request and determines which program to execute. Programs are identified by a name and the public key of the publisher. The gateway requests the nearest communication system for the output of the program, providing it with its name, public key, and request parameters.
Communication system
The communication system is a service responsible for key management and connecting and distributing Coputer programs and their outputs. The program's publisher will have used it to store the program and distribute it across the network.
The communication system receives the request from the gateway and asks its execution system to process the request. If it fails (can't connect, or the program is not stored, cannot be executed, returns an error etc), the communication system will send out a request to its peers for the program output. If the output is found it is sent back to the gateway, otherwise an error is returned.
Execution system
The execution system is responsible for storing, executing, and caching responses of Coputer programs. Upon receiving the request to process the program, it checks if the program is stored, returning an error if it isn't. Then it will check if the program output is already cached, returning the cached response if it is.
If we have the program and its response is not cached, it's now time to run it. The entrypoint to the program is compiled then executed by the virtual machine, the most complex part of the Coputer system. The VM dynamically compiles any dependencies and executes the program in a sandboxed, deterministic environment. Once a response is obtained, it is sent back through the communication system to the gateway, completing the request.