{"id":13418052,"url":"https://github.com/arximboldi/immer","last_synced_at":"2025-05-14T22:09:28.459Z","repository":{"id":37444413,"uuid":"65983699","full_name":"arximboldi/immer","owner":"arximboldi","description":"Postmodern immutable and persistent data structures for C++ — value semantics at scale","archived":false,"fork":false,"pushed_at":"2024-09-18T18:40:38.000Z","size":3004,"stargazers_count":2545,"open_issues_count":47,"forks_count":185,"subscribers_count":65,"default_branch":"master","last_synced_at":"2025-04-11T10:01:34.672Z","etag":null,"topics":["cpp14","data-structures","hamt","immutable","modern-cpp","persistent","postmodernism","rrb-tree","value-semantics"],"latest_commit_sha":null,"homepage":"https://sinusoid.es/immer","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","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":"2016-08-18T09:21:22.000Z","updated_at":"2025-04-09T10:26:49.000Z","dependencies_parsed_at":"2024-05-01T13:16:26.726Z","dependency_job_id":"a6038768-a0bd-4053-9dd6-1a12a5f5149b","html_url":"https://github.com/arximboldi/immer","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Fimmer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Fimmer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Fimmer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Fimmer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arximboldi","download_url":"https://codeload.github.com/arximboldi/immer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235701,"owners_count":22036964,"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":["cpp14","data-structures","hamt","immutable","modern-cpp","persistent","postmodernism","rrb-tree","value-semantics"],"created_at":"2024-07-30T22:00:57.956Z","updated_at":"2025-05-14T22:09:23.449Z","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":["TODO scan for Android support in followings","C++","Data Structures and Algorithms","C/C++程序设计"],"sub_categories":["资源传输下载"],"readme":".. image:: https://github.com/arximboldi/immer/workflows/test/badge.svg\n   :target: https://github.com/arximboldi/immer/actions?query=workflow%3Atest+branch%3Amaster\n   :alt: GitHub Actions Badge\n\n.. image:: https://codecov.io/gh/arximboldi/immer/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/arximboldi/immer\n   :alt: CodeCov Badge\n\n.. image:: https://cdn.rawgit.com/arximboldi/immer/355a113782aedc2ea22463444014809269c2376d/doc/_static/sinusoidal-badge.svg\n   :target: https://sinusoid.al\n   :alt: Sinusoidal Engineering badge\n   :align: right\n\n.. raw:: html\n\n   \u003cpicture\u003e\n     \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.rawgit.com/arximboldi/immer/3888170d247359cc0905eed548cd46897caef0f4/doc/_static/logo-black.svg\"\u003e\n     \u003cimg width=\"100%\" src=\"https://cdn.rawgit.com/arximboldi/immer/3888170d247359cc0905eed548cd46897caef0f4/doc/_static/logo-front.svg\" alt=\"Logotype\"\u003e\n   \u003c/picture\u003e\n\n.. include:introduction/start\n\n**immer** is a library of persistent_ and immutable_ data structures\nwritten in C++.  These enable whole new kinds of architectures for\ninteractive and concurrent programs of striking simplicity,\ncorrectness, and performance.\n\n.. _persistent: https://en.wikipedia.org/wiki/Persistent_data_structure\n.. _immutable:  https://en.wikipedia.org/wiki/Immutable_object\n\n* **Documentation** (Contents_)\n* **Code** (GitHub_)\n* **CppCon'17 Talk**: *Postmodern Immutable Data Structures* (YouTube_, Slides_)\n* **ICFP'17 Paper**: *Persistence for the masses* (Preprint_)\n\n.. _contents: https://sinusoid.es/immer/#contents\n.. _github: https://github.com/arximboldi/immer\n.. _youtube: https://www.youtube.com/watch?v=sPhpelUfu8Q\n.. _slides: https://sinusoid.es/talks/immer-cppcon17\n.. _preprint: https://public.sinusoid.es/misc/immer/immer-icfp17.pdf\n\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 library has full months of *pro bono* research and development\n  invested in it.  This is just the first step in a long-term vision\n  of making interactive and concurrent C++ programs easier to\n  write. **Put your logo here and help this project's long term\n  sustainability by buying a sponsorship package:** immer@sinusoid.al\n\n.. include:index/end\n\nExample\n-------\n\n.. github does not support the ``literalinclude`` directive.  This\n   example is copy pasted from ``example/vector/intro.cpp``\n\n.. code-block:: c++\n\n   #include \u003cimmer/vector.hpp\u003e\n   int main()\n   {\n       const auto v0 = immer::vector\u003cint\u003e{};\n       const auto v1 = v0.push_back(13);\n       assert(v0.size() == 0 \u0026\u0026 v1.size() == 1 \u0026\u0026 v1[0] == 13);\n\n       const auto v2 = v1.set(0, 42);\n       assert(v1[0] == 13 \u0026\u0026 v2[0] == 42);\n   }\n..\n\n  For a **complete example** check `Ewig, a simple didactic\n  text-editor \u003chttps://github.com/arximboldi/ewig\u003e`_ built with this\n  library.  You may also wanna check `Lager, a Redux-like library\n  \u003chttps://github.com/arximboldi/lager\u003e`_ for writing interactive\n  software in C++ using a value-oriented design.\n\n\nWhy?\n----\n\nIn the last few years, there has been a growing interest in immutable\ndata structures, motivated by the horizontal scaling of our processing\npower and the ubiquity of highly interactive systems.  Languages like\nClojure_ and Scala_ provide them by default, and implementations\nfor JavaScript like Mori_ and Immutable.js_ are widely used,\nspecially in combination with modern UI frameworks like React_.\n\nInteractivity\n    Thanks to *persistence* and *structural sharing*, new values can\n    be efficiently compared with old ones.  This enables simpler ways of\n    *reasoning about change* that sit at the core of modern\n    interactive systems programming paradigms like `reactive\n    programming`_.\n\nConcurrency\n    Passing immutable data structures by value does not need to copy\n    any data. In the absence of mutation, data can be safely read\n    from multiple concurrent processes, and enable concurrency\n    patterns like `share by communicating`_ efficiently.\n\nParallelism\n   Some recent immutable data structures have interesting properties\n   like :math:`O(log(n))` concatenation, which enable new kinds of\n   `parallelization algorithms`_.\n\n.. _clojure: http://clojure.org/reference/data_structures\n.. _scala: http://docs.scala-lang.org/overviews/collections/overview.html\n\n.. _mori: https://swannodette.github.io/mori/\n.. _immutable.js: https://github.com/facebook/immutable-js\n.. _react: https://facebook.github.io/react/\n\n.. _reactive programming: https://en.wikipedia.org/wiki/Reactive_programming\n.. _share by communicating: https://blog.golang.org/share-memory-by-communicating\n.. _parallelization algorithms: http://docs.scala-lang.org/overviews/parallel-collections/overview.html\n\nFeatures\n--------\n\nIdiomatic\n    This library doesn't pretend that it is written in Haskell.  It\n    leverages features from recent standards to provide an API that is\n    both efficient and natural for a C++ developer.\n\nPerformant\n    You use C++ because you need this.  *Immer* implements state of\n    the art data structures with efficient cache utilization and have\n    been proven production ready in other languages.  It also includes\n    our own improvements over that are only possible because of the\n    C++'s ability to abstract over memory layout.  We monitor the\n    performance impact of every change by collecting `benchmark\n    results`_ directly from CI.\n\n.. _benchmark results: https://public.sinusoid.es/misc/immer/reports/\n\nCustomizable\n    We leverage templates and `policy-based design`_ to build\n    data-structures that can be adapted to work efficiently for\n    various purposes and architectures, for example, by choosing among\n    various `memory management strategies`.  This turns\n    *immer* into a good foundation to provide immutable data\n    structures to higher level languages with a C runtime, like\n    Python_ or Guile_.\n\n.. _python: https://www.python.org/\n.. _guile: https://www.gnu.org/software/guile/\n.. _policy-based design: https://en.wikipedia.org/wiki/Policy-based_design\n.. _memory management strategies: https://sinusoid.es/immer/memory.html\n\nDependencies\n------------\n\nThis library is written in **C++14** and a compliant compiler is\nnecessary.  It is `continuously tested`_ with Clang 3.8 and GCC 6, but\nit might work with other compilers and versions.\n\nNo external library is necessary and there are no other requirements.\n\n.. _continuously tested: https://travis-ci.org/arximboldi/immer\n\nUsage\n-----\n\nThis is a **header only** library.  You can just copy the ``immer``\nsubfolder somewhere in your *include path*.\n\nIf you are using the `Nix package manager`_ (we strongly recommend it)\nyou can just::\n\n    nix-env -if https://github.com/arximboldi/immer/archive/master.tar.gz\n\nAlternatively, you can use `CMake`_ to install the library in your\nsystem once you have 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\nInstalling immer using vcpkg\n-----------------------------\n\nYou can download and install immer using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager::\n\n    git clone https://github.com/Microsoft/vcpkg.git\n    cd vcpkg\n    ./bootstrap-vcpkg.sh\n    ./vcpkg integrate install\n    ./vcpkg install immer\n\nThe immer port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.\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\nIn order to build and run all benchmarks when running ``make check``,\nrun ``cmake`` again with the option ``-DCHECK_BENCHMARKS=1``.  The\nresults of running the benchmarks will be saved to a folder\n``reports/`` in the project root.\n\nLicense\n-------\n\n**This software is licensed under the Boost Software License 1.0**.\n\n.. image:: https://upload.wikimedia.org/wikipedia/commons/c/cd/Boost.png\n   :alt: Boost logo\n   :target: http://boost.org/LICENSE_1_0.txt\n   :align: right\n\nThe full text of the license is can be accessed `via this link\n\u003chttp://boost.org/LICENSE_1_0.txt\u003e`_ and is also included\nin the ``LICENSE`` file of this software package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farximboldi%2Fimmer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farximboldi%2Fimmer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farximboldi%2Fimmer/lists"}