StructuredMap maps from keywords to various Binding instances (which can also be StructuredMaps).
Those keywords can come from the database, or they can be aliases provided by the user inside a query string.
For efficiency, the keys to the map are actually ValueRc<Keyword>, where all maps generated during a run share keys. That means lookup into the map requires creating an Arc!
More ergonomic ways to do this must exist.
We could have the keys to the map be references, or indices, or be in some way comparable to strings. Doing so would probably need some help from Rental.
We could push refcounting down into Keyword — after all, that's now just a more sophisticated box around a string.
We could explicitly intern keywords into some kind of enclosing result set 'context'. Doing so would impose a burden on the eventual consumer of results — it would no longer be meaningful to grab a map out of a result and pass it around without the context — but perhaps we could invert the relationship and have the dictionary itself be refcounted inside StructuredMap!
StructuredMap
maps from keywords to variousBinding
instances (which can also beStructuredMap
s).Those keywords can come from the database, or they can be aliases provided by the user inside a query string.
For efficiency, the keys to the map are actually
ValueRc<Keyword>
, where all maps generated during a run share keys. That means lookup into the map requires creating anArc
!More ergonomic ways to do this must exist.
We could have the keys to the map be references, or indices, or be in some way comparable to strings. Doing so would probably need some help from Rental.
We could push refcounting down into
Keyword
— after all, that's now just a more sophisticated box around a string.We could explicitly intern keywords into some kind of enclosing result set 'context'. Doing so would impose a burden on the eventual consumer of results — it would no longer be meaningful to grab a map out of a result and pass it around without the context — but perhaps we could invert the relationship and have the dictionary itself be refcounted inside
StructuredMap
!Lots of options, and a little thought needed.