Skip to content
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

Consider adopting shapeless-deriving #309

Open
mpilquist opened this issue May 21, 2021 · 2 comments
Open

Consider adopting shapeless-deriving #309

mpilquist opened this issue May 21, 2021 · 2 comments

Comments

@mpilquist
Copy link
Contributor

From @milessabin:

The built in machinery is very low level and shapeless 3 was designed alongside it to be a more accessible way to do derivation so, I'm biased obviously, but I'd say "always".
shapeless3-deriving is a pretty small dependency compared with shapeless 2.
Naive use of the built in machinery and inlining will produce huge amounts of bytecode, very similar to what implicit induction does with shapeless 2/Scala 2, so you want to avoid that if possible.

"Naive use of the built in machinery" likely describes Scodec 2 pretty well. :)

Let's investigate what shapeless-deriving provides.

@yuriy-yarosh
Copy link

I'm really missing cats instances for Codec to be able to traverse it freely, it would be nice to provide some initial support using Kittens derives for scala3. Kittens uses shapeless-derived internally already, to a fairly decent extent, and it doesn't make much sense to me why anyone should be back-porting it, except of Enterprisy reasons (hello Comcast, my old friend).

@mpilquist
Copy link
Contributor Author

The scodec-cats project defines cats type class instances for scodec types. There might be some missing but the major ones should all be covered.

Re: shapeless-derived, I tried using it a few times and didn't get very far. Would love to see a proof of concept of using it in place of the custom Codec.derived implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants