All Projects → arximboldi → Immer

arximboldi / Immer

Licence: bsl-1.0
Postmodern immutable and persistent data structures for C++ — value semantics at scale

Programming Languages

C++
36643 projects - #6 most used programming language
javascript
184084 projects - #8 most used programming language
CMake
9771 projects
Nix
1067 projects
scheme
763 projects
scala
5932 projects

Projects that are alternatives of or similar to Immer

finger-tree
🌵 Finger tree data structure for JavaScript
Stars: ✭ 20 (-98.97%)
Mutual labels:  immutable, persistent, data-structures
rrbit-js
No description or website provided.
Stars: ✭ 11 (-99.43%)
Mutual labels:  immutable, persistent, rrb-tree
Imtools
Fast and memory-efficient immutable collections and helper data structures
Stars: ✭ 85 (-95.61%)
Mutual labels:  data-structures, immutable, persistent
Static Frame
Immutable and grow-only Pandas-like DataFrames with a more explicit and consistent interface.
Stars: ✭ 217 (-88.79%)
Mutual labels:  data-structures, immutable
Extcore
An extended core library for F#.
Stars: ✭ 172 (-91.11%)
Mutual labels:  data-structures, immutable
Collectable
High-performance immutable data structures for modern JavaScript and TypeScript applications. Functional interfaces, deep/composite operations API, mixed mutability API, TypeScript definitions, ES2015 module exports.
Stars: ✭ 233 (-87.96%)
Mutual labels:  data-structures, immutable
rrbit
An Immutable vectors/lists/arrays library using the Relaxed Radix Balancing(RRB) technique
Stars: ✭ 12 (-99.38%)
Mutual labels:  immutable, persistent
shoki
Purely functional data structures in Java
Stars: ✭ 30 (-98.45%)
Mutual labels:  immutable, hamt
Typed Immutable
Immutable and structurally typed data
Stars: ✭ 263 (-86.41%)
Mutual labels:  immutable, persistent
Data Structures
Go datastructures.
Stars: ✭ 336 (-82.64%)
Mutual labels:  data-structures, immutable
Ewig
The eternal text editor — Didactic Ersatz Emacs to show immutable data-structures and the single-atom architecture
Stars: ✭ 422 (-78.19%)
Mutual labels:  data-structures, immutable
Immutable Tuple
Immutable finite list objects with constant-time equality testing (===) and no memory leaks.
Stars: ✭ 29 (-98.5%)
Mutual labels:  immutable, persistent
List
🐆 An immutable list with unmatched performance and a comprehensive functional API.
Stars: ✭ 1,604 (-17.11%)
Mutual labels:  data-structures, immutable
Lago
📕 Data Structures and Algorithms library in TypeScript
Stars: ✭ 1,966 (+1.6%)
Mutual labels:  data-structures
Jupyter
Stars: ✭ 145 (-92.51%)
Mutual labels:  data-structures
Interviews
A list of fancy questions I've been asked during the interviews I had. Some of them I ask when interviewing people.
Stars: ✭ 140 (-92.76%)
Mutual labels:  data-structures
Skiplist
A Go library for an efficient implementation of a skip list: https://godoc.org/github.com/MauriceGit/skiplist
Stars: ✭ 140 (-92.76%)
Mutual labels:  data-structures
React Storage Hooks
React hooks for persistent state
Stars: ✭ 146 (-92.45%)
Mutual labels:  persistent
Data Structures And Algorithms
Stars: ✭ 144 (-92.56%)
Mutual labels:  data-structures
19 udacity dsa
Data Structures & Algorithms Nanodegree Program from Udacity
Stars: ✭ 140 (-92.76%)
Mutual labels:  data-structures
Github Actions Badge CodeCov Badge Sinusoidal Engineering badge

Logotype

immer is a library of persistent and immutable data structures written in C++. These enable whole new kinds of architectures for interactive and concurrent programs of striking simplicity, correctness, and performance.

This library has full months of pro bono research and development invested in it. This is just the first step in a long-term vision of making interactive and concurrent C++ programs easier to write. Put your logo here and help this project's long term sustainability by buying a sponsorship package: [email protected]

Example

#include <immer/vector.hpp>
int main()
{
    const auto v0 = immer::vector<int>{};
    const auto v1 = v0.push_back(13);
    assert(v0.size() == 0 && v1.size() == 1 && v1[0] == 13);

    const auto v2 = v1.set(0, 42);
    assert(v1[0] == 13 && v2[0] == 42);
}
For a complete example check Ewig, a simple didactic text-editor built with this library. You may also wanna check Lager, a Redux-like library for writting interactive software in C++ using a value-oriented design.

Why?

In the last few years, there has been a growing interest in immutable data structures, motivated by the horizontal scaling of our processing power and the ubiquity of highly interactive systems. Languages like Clojure and Scala provide them by default, and implementations for JavaScript like Mori and Immutable.js are widely used, specially in combination with modern UI frameworks like React.

Interactivity
Thanks to persistence and structural sharing, new values can be efficiently compared with old ones. This enables simpler ways of reasoning about change that sit at the core of modern interactive systems programming paradigms like reactive programming.
Concurrency
Passing immutable data structures by value does not need to copy any data. In the absence of mutation, data can be safely read from multiple concurrent processes, and enable concurrency patterns like share by communicating efficiently.
Parallelism
Some recent immutable data structures have interesting properties like O(log(n)) concatenation, which enable new kinds of parallelization algorithms.

Features

Idiomatic
This library doesn't pretend that it is written in Haskell. It leverages features from recent standards to provide an API that is both efficient and natural for a C++ developer.
Performant
You use C++ because you need this. Immer implements state of the art data structures with efficient cache utilization and have been proven production ready in other languages. It also includes our own improvements over that are only possible because of the C++'s ability to abstract over memory layout. We monitor the performance impact of every change by collecting benchmark results directly from CI.
Customizable
We leverage templates and policy-based design to build data-structures that can be adapted to work efficiently for various purposes and architectures, for example, by choosing among various memory management strategies. This turns immer into a good foundation to provide immutable data structures to higher level languages with a C runtime, like Python or Guile.

Dependencies

This library is written in C++14 and a compliant compiler is necessary. It is continuously tested with Clang 3.8 and GCC 6, but it might work with other compilers and versions.

No external library is necessary and there are no other requirements.

Usage

This is a header only library. You can just copy the immer subfolder somewhere in your include path.

If you are using the Nix package manager (we strongly recommend it) you can just:

nix-env -if https://github.com/arximboldi/immer/archive/master.tar.gz

Alternatively, you can use CMake to install the library in your system once you have manually cloned the repository:

mkdir -p build && cd build
cmake .. && sudo make install

Development

In order to develop the library, you will need to compile and run the examples, tests and benchmarks. These require some additional tools. The easiest way to install them is by using the Nix package manager. At the root of the repository just type:

nix-shell

This will download all required dependencies and create an isolated environment in which you can use these dependencies, without polluting your system.

Then you can proceed to generate a development project using CMake:

mkdir build && cd build
cmake ..

From then on, one may build and run all tests by doing:

make check

In order to build and run all benchmarks when running make check, run cmake again with the option -DCHECK_BENCHMARKS=1. The results of running the benchmarks will be saved to a folder reports/ in the project root.

License

This software is licensed under the Boost Software License 1.0.

Boost logo

The full text of the license is can be accessed via this link and is also included in the LICENSE file of this software package.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].