Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MuttsInterface.jl

The interface for Mutable Until Shared data structures. (MutTS - Mutable 'Til Shared)

CI

MuttsInterface.jl provides infrastructure for building versioned data structures that follow the mutable-until-shared discipline, providing all the benefits of purely-functional data structures (worry-free, lock-free, super fast concurrency), with the pragmatic programming and performance benefits of mutable data.

The @mutt keyword marks a struct as being mutable until shared, meaning that it starts out mutable, until it is branched-from or manually marked immutable, after which it is permanently immutable. This gurantees concurrency-friendly immutable data, while still allowing in-place construction of complex objects.

julia> @mutt struct S
           x::Int
       end

julia> MuttsInterface.make_mutable_copy(rhs::S) = S(rhs.x)

julia> s = S(2)
S(true, 2)

julia> s.x = 3
3

julia> s2 = branch!(s)
S(true, 3)

julia> s
S(false, 3)

julia> s.x = 4
ERROR: AssertionError: is_mutts_mutable(obj)

About

Mutable-until-shared data structures in Julia

Resources

Code of conduct

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages