Given an entity (say a file or a library/package) that can evolve its versions and branches over time, looking for a optimized data structure that lets me navigate through the versions to a specific instance of the entity.
For example (a bit contrived example) given entries such as:
MySIMDIntristicsLib.v1~archMIPS.v1~fbsd.v1
MySIMDIntristicsLib.v1~archMIPS.v2~fbsd.v1
MySIMDIntristicsLib.v1~archX86.v1~win.v1
MySIMDIntristicsLib.v1~archX86.v2~win.v1
MySIMDIntristicsLib.v1~archX86.v2~win.v2
MySIMDIntristicsLib.v2~archX86.v1~win.v1
// get latest across all branches
get( Entity="MySIMDIntristicsLib", branch[(latest) "~"] )
returns: "MySIMDIntristicsLib.v2~archX86.v1~win.v1"
// get latest across archMips/fbsd branch
get( Entity="MySIMDIntristicsLib", branch[(latest) "archMIPS~fbsd"] )
returns: "MySIMDIntristicsLib.v1~archMIPS.v2~fbsd.v1"
// get earliest for archX86 v2 branch
get( Entity="MySIMDIntristicsLib", branch[(earliest) "archX86.v2~"] )
returns "MySIMDIntristicsLib.v1~archX86.v2~win.v1"
I suspect something like that already exists (since package management or source code management leverages similar to the above access semantics).
I was looking for in-memory data structures for the above with good Latest/Earliest access time, but also descent insert/remove speed.
In a brutal force approach, I think the above can be implemented using Min Max heap for every branch that can have versions.
However, there may be something better already out there. I also checked my usual source of these types of things, Redisson -- but did not see if there is an explicit implementation of the data structure for the above
The DSL above is of my own construction, probably has some holes too, so if there are better DSLs/APIs for this kind of data access -- would like to learn as well.