The tragedy of the value based architecture











a presentation
brought to you by

Juanpe Bolivar
https://sinusoid.es



mutability ( pass by value copying )

root cause cause problem

const auto v0 = vector<int>{};
const auto v1 = v0.push_back(15);
const auto v2 = v1.push_back(16);
const auto v3 = v2.set(0, 42);


assert(
    v2.size() == v0.size() + 2
 && v3[0] - v1[0] == 27);
            
immutable data structure

one with all methods
marked const

persistent data structure

old values are preserved

structural sharing
  • no copying
  • compact history
  • fast comparison
immer
modern and efficient immutable data structures