{"id":13645738,"url":"https://github.com/arximboldi/lager","last_synced_at":"2025-05-15T04:03:08.584Z","repository":{"id":37396835,"uuid":"107474738","full_name":"arximboldi/lager","owner":"arximboldi","description":" C++ library for value-oriented design using the unidirectional data-flow architecture — Redux for C++","archived":false,"fork":false,"pushed_at":"2025-03-28T10:29:55.000Z","size":2186,"stargazers_count":721,"open_issues_count":33,"forks_count":71,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-06T23:11:36.489Z","etag":null,"topics":["cpp17","functional-programming","interactive","library","redux","value-semantics"],"latest_commit_sha":null,"homepage":"https://sinusoid.es/lager/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arximboldi.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"arximboldi","patreon":"sinusoidal","custom":["paypal.me/sinusoidal","sinusoid.al"]}},"created_at":"2017-10-18T23:35:30.000Z","updated_at":"2025-03-31T18:46:25.000Z","dependencies_parsed_at":"2023-11-21T14:04:09.176Z","dependency_job_id":"b9064dac-c255-472d-980c-f8b387c9fcf5","html_url":"https://github.com/arximboldi/lager","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Flager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Flager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Flager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Flager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arximboldi","download_url":"https://codeload.github.com/arximboldi/lager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819379,"owners_count":21166477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp17","functional-programming","interactive","library","redux","value-semantics"],"created_at":"2024-08-02T01:02:40.815Z","updated_at":"2025-04-14T03:58:40.816Z","avatar_url":"https://github.com/arximboldi.png","language":"C++","funding_links":["https://github.com/sponsors/arximboldi","https://patreon.com/sinusoidal","paypal.me/sinusoidal","sinusoid.al","https://www.patreon.com/sinusoidal"],"categories":["C++","Functional Programming"],"sub_categories":[],"readme":".. image:: https://github.com/arximboldi/lager/workflows/test/badge.svg\n   :target: https://github.com/arximboldi/lager/actions?query=workflow%3Atest+branch%3Amaster\n   :alt: Github Actions Badge\n\n.. image:: https://codecov.io/gh/arximboldi/lager/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/arximboldi/lager\n   :alt: CodeCov Badge\n\n.. image:: https://cdn.jsdelivr.net/gh/arximboldi/lager/doc/_static/sinusoidal-badge.svg\n   :target: https://sinusoid.al\n   :alt: Sinusoidal Engineering badge\n   :align: right\n\n.. raw:: html\n\n  \u003cimg width=\"100%\"\n       src=\"https://cdn.rawgit.com/arximboldi/lager/ccb5a1c8/resources/logo-front.svg\"\n       alt=\"Logotype\"\u003e\n\n.. include:introduction/start\n\n**lager** is a C++ library to assist `value-oriented design`_ by\nimplementing the `unidirectional data-flow architecture`_.  It is\nheavily inspired by Elm_ and Redux_, and enables composable designs by\npromoting the use of simple value types and testable application logic\nvia pure functions.  And you get time-travel for free!\n\n.. _unidirectional data-flow architecture: https://www.exclamationlabs.com/blog/the-case-for-unidirectional-data-flow\n.. _Elm: https://guide.elm-lang.org/architecture\n.. _Redux: https://redux.js.org/introduction/getting-started\n.. _value-oriented design: https://www.youtube.com/watch?v=_oBx_NbLghY\n\n* **Documentation** (Contents_)\n* **Code** (GitHub_)\n* **CppRussia-Piter 2019 Talk**: *Squaring the circle* (`YouTube\n  \u003chttps://www.youtube.com/watch?v=e2-FRFEx8CA\u003e`_, `Slides\n  \u003chttps://sinusoid.es/talks/cpprussia19-piter\u003e`_)\n* **CppCon 2018 Talk**: *The most valuable values* (`YouTube\n  \u003chttps://www.youtube.com/watch?v=_oBx_NbLghY\u003e`_, `Slides\n  \u003chttps://sinusoid.es/talks/cppcon18\u003e`_)\n* **C++ on Sea 2019 Talk**: *Postmodern immutable data-structures*\n  (`YouTube \u003chttps://www.youtube.com/watch?v=y_m0ce1rzRI\u003e`_, `Slides\n  \u003chttps://sinusoid.es/talks/cpponsea19\u003e`_)\n\n.. _contents: https://sinusoid.es/lager/#contents\n.. _github: https://github.com/arximboldi/lager\n\n  .. raw:: html\n\n     \u003ca href=\"https://www.patreon.com/sinusoidal\"\u003e\n         \u003cimg align=\"right\" src=\"https://cdn.rawgit.com/arximboldi/immer/master/doc/_static/patreon.svg\"\u003e\n     \u003c/a\u003e\n\n  This project is part of a long-term vision helping interactive and\n  concurrent C++ programs become easier to write. **Help this project's\n  long term sustainability by becoming a patron or buying a\n  sponsorship package:** juanpe@sinusoid.al\n\n.. include:index/end\n\nExamples\n--------\n\nFor a guided introductory tour with **code samples**, please read the\n`architecture overview`_ section. Other examples:\n\n.. _architecture overview: https://sinusoid.es/lager/architecture.html\n\n* **Counter**, a minimalistic example with multiple UIs (`link\n  \u003chttps://github.com/arximboldi/lager/tree/master/example/counter\u003e`_).\n* **Autopong**, a basic game using SDL2 (`link\n  \u003chttps://github.com/arximboldi/lager/blob/master/example/autopong\u003e`_).\n* **Ewig**, a terminal text editor with undo, asynchronous loading,\n  and more (`link \u003chttps://github.com/arximboldi/ewig\u003e`_).\n\nWhy?\n----\n\nMost interactive software of the last few decades has been written\nusing an object-oriented interpretation of the `Model View\nController`_ design.  This architecture provides nice separation of\nconcerns, allowing the core application logic to be separate from the\nUI, and a good sense of modularity.  However, its reliance on stateful\nobject graphs makes the software hard to test or parallelize.  It's\nreliance on fine-grained callbacks makes composition hard, resulting\nin subtle problems that are hard to debug.\n\n*Value-based unidirectional data-flow* tackles a few of these\nproblems:\n\n* Thanks to immutability_ and value-types, it is very easy to add\n  **concurrency** as threads can operate on their local copies of the\n  data without mutexes or other flaky synchronization mechanisms.\n  Instead, worker threads communicate their results back by *dispatching*\n  actions to the main thread.\n\n* The application logic is made of `pure functions`_ that can be easily\n  **tested** and are fully reproducible.  They interact with the world\n  via special side-effects procedures loosely coupled to the services\n  they need via  `dependency injection`_.\n\n* This also means that data and call-graphs are always trees or\n  `DAGs`_ (instead of cyclical graphs), with *explicit composition*\n  that is to trace and **debug**.  You can also always\n  *snapshot* the state, making undo and time-travel easy peasy!\n\n.. _immutability: https://github.com/arximboldi/immer\n.. _pure functions: https://en.wikipedia.org/wiki/Pure_function\n.. _model view controller:\n   https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller\n.. _dependency injection:\n   https://en.wikipedia.org/wiki/Dependency_injection\n.. _DAGs: https://en.wikipedia.org/wiki/Directed_acyclic_graph\n\nDependencies\n------------\n\nThis library is written in **C++17** and a compliant compiler and\nstandard library necessary.  It is `continuously tested`_ with GCC 7,\nbut it might work with other compilers and versions.\n\nIt also depends on `Zug`_ and `Boost Hana`_. Some optional extensions and modules\nmay have other dependencies documented in their respective sections.\n\n.. _Zug: https://github.com/arximboldi/zug/\n.. _Boost Hana: https://boostorg.github.io/hana\n.. _continuously tested: https://travis-ci.org/arximboldi/immer\n\nUsage\n-----\n\nThis is a **header only** you can just copy the ``lager`` subfolder\nsomewhere in your *include path*.\n\nSome components, like the time-travelling debugger, also require the\ninstallation of extra files.\n\nYou can use `CMake`_ to install the library in your system once you\nhave manually cloned the repository::\n\n    mkdir -p build \u0026\u0026 cd build\n    cmake .. \u0026\u0026 sudo make install\n\n.. _nix package manager: https://nixos.org/nix\n.. _cmake: https://cmake.org/\n\nDevelopment\n-----------\n\nIn order to develop the library, you will need to compile and run the\nexamples, tests and benchmarks.  These require some additional tools.\nThe easiest way to install them is by using the `Nix package\nmanager`_.  At the root of the repository just type::\n\n    nix-shell\n\nThis will download all required dependencies and create an isolated\nenvironment in which you can use these dependencies, without polluting\nyour system.\n\nThen you can proceed to generate a development project using `CMake`_::\n\n    mkdir build \u0026\u0026 cd build\n    cmake ..\n\nFrom then on, one may build and run all tests by doing::\n\n    make check\n\nLicense\n-------\n\n.. image:: https://raw.githubusercontent.com/arximboldi/lager/docs/doc/_static/mit.png\n   :alt: Boost logo\n   :target: https://opensource.org/licenses/MIT\n   :align: right\n   :width: 140 px\n\n**This software is licensed under the MIT license**.\n\nThe full text of the license is can be accessed `via this link\n\u003chttps://opensource.org/licenses/MIT\u003e`_ and is also included in the\n``LICENSE`` file of this software package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farximboldi%2Flager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farximboldi%2Flager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farximboldi%2Flager/lists"}