-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify semi- and auto- derivation for jsoniter-scala #2
base: master
Are you sure you want to change the base?
Clarify semi- and auto- derivation for jsoniter-scala #2
Conversation
I thought |
TBH what I want to show with my incoming presentation is that:
so basically something like:
which would summon
so that the code could be both optimal AND easy to use. |
wouldn't such automatic-semiautomatic approach inline a separate instance at each extension call site? |
If you have several different call sites, asking for the same type, then yes, you would derive the same instances several times anew BUT
so it would be a significant improvement over the current status quo when people are resorting to semi-auto not as a measure of correctness/coherence enforcement, but a way of optimizing around long compilation times. And, when semautomatic derivation would be actually needed, it would allow them to not-de-optimize their code by introducing a bunch of allocation for intermediate instances that aren't really needed. Also, it lowers the entry barrier, as newbies don't have to wonder why all the senior people write 50 |
Yet another drawback of |
Yeah, the argument against auto is quite clear and there's no disagreement here. It's just that what you do here in this PR @plokhotnyuk is what @MateuszKubuszok describes as |
I haven't measured compilation and runtime scores yet...
I bet that difference of results between these semi- and auto- will not be huge.