Refactor internals to NOT rely on RuntimeDataStore #539
Labels
enhancement
low hanging fruit
Task that should be easy to implement - perfect for people that want to start contributing.
Currently in a lot of of places we use
ctx.runtimeDataStore(idx)
directly, whileTransformerConfiguration
's overrides store onlyidx
.We could move this extraction to
TransformerOverride
s, so that the code would NOT hardcode how we are storing/parsing runtime information.TransformerOverride
s would storeoverrideExpr: Expr[Any]
instead ofindex: Int
overrideExpr
could be computed inTransformerConfiguration.readTransformerConfiguration
ctx.runtimeDataStore(idx)
could be replaced withoverrideExpr
This way, in the future we could:
provide an alternative API without any runtime overhead:
(By alternative I am thinking a separate module or even a separate library - to avoid confusion from one-in-one API -
import dsl.*
- and API split into components -auto.*
+inlined.*
+syntax.*
- and then yet another API for inlined expressions without fluent API overhead like Ducktape's.)open up possibilities to reuse macros to provide e.g. lens-like functionality
(If we'd compare to e.g. Quicklens, and if we only consider
.setTo
, Chimney would only be missingfoo.modify(_.list.at(idx)).setTo(item)
. If we could chain updates without any overhead, then we could get better performance thanfoo.modify(...).setTo(...).modify(...).setTo(...)
),make it easier to reuse Chimney derivation engine in other libraries (from what we can see Teleproto already attempts such thing in Try turning teleproto into a wrapper around chimney moia-oss/teleproto#321)
The text was updated successfully, but these errors were encountered: