{"size": 1189, "ext": "scrbl", "max_stars_repo_path": "docs-src/guide-abstract.scrbl", "max_stars_repo_name": "iblazevic/reach-lang", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "docs-src/guide-abstract.scrbl", "max_issues_repo_name": "iblazevic/reach-lang", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "docs-src/guide-abstract.scrbl", "max_forks_repo_name": "iblazevic/reach-lang", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 74.3125, "max_line_length": 285, "alphanum_fraction": 0.8023549201}
#lang scribble/manual
@(require "lib.rkt")

@title[#:version reach-vers #:tag "guide-abstract"]{Building decentralized abstractions}

Many decentralized applications have the same struture, similar to how there are many games that can be categorized as @link["https://en.wikipedia.org/wiki/Combinatorial_game_theory"]{combinatorial games} or @link["https://en.wikipedia.org/wiki/Simultaneous_game"]{simultaneous games}.

These applications can either be programmed individually, or you can build an abstraction that captures the common structure of a game.
Reach supports typical programming language abstractions, like first-class functions (via @tech{arrow expressions}) and objects, that can be used to build these abstractions.

When building such abstractions, the most difficult part is correctly capturing @seclink["guide-loop-invs"]{loop invariants} of the user of the abstraction on the inside of the abstraction.
Often, this means the abstraction must set up a protocol to communicate with its user, such as by receiving an invariant captured by an @tech{arrow expression}.

@margin-note{See @secref["workshop-abstract-simul"] for a walthrough of building such an abstraction.}

