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

refactor - move from macro to shapeless #5

Open
kailuowang opened this issue Dec 15, 2015 · 22 comments
Open

refactor - move from macro to shapeless #5

kailuowang opened this issue Dec 15, 2015 · 22 comments

Comments

@kailuowang
Copy link
Member

The incentive is rather philosophical
1, macro should remain low-level and exists at the lower level libraries such as shapeless.
2, we should use each other's libraries more.

@fommil
Copy link

fommil commented Dec 18, 2015

happy to help you write this! My talk at Scala eXchange last week should make this real easy. I predict you could do the whole thing in about 50 lines of code, and also support sealed traits.

@kailuowang
Copy link
Member Author

That will be fantastic! I bet you can write it much better than us.

@fommil
Copy link

fommil commented Dec 18, 2015

well I didn't say I'd write it, but I'd be happy to show you how 😄 When my shapeless talk is out, I'll link you and then give you guidance on the example, then you can graduate to rewriting ficus. Ping me in a few weeks if I don't come back.

@kailuowang
Copy link
Member Author

That's still very nice of you. Looking forward to your talk!

@fommil
Copy link

fommil commented Dec 19, 2015

@kailuowang
Copy link
Member Author

Thank you @fommil , I enjoyed your talk. The explanation of that several weird things shapeless has to do to overcome Scala compiler's defects can be immensely helpful for new comers to typelevel projects. I suggest shapeless have a section on these issues in documentation.

@kailuowang
Copy link
Member Author

A note from ceedubs,
Travis Brown has done some recent work to support different cases in Circe. Since it uses Shapeless for derivation, it might be a good reference.

@fommil
Copy link

fommil commented Jan 14, 2016

yup, but the shapeless for mortals talk is still probably a better learning experience. Travis was in the front row, btw 😉

@fommil
Copy link

fommil commented Jan 27, 2016

any movement on this?

@kailuowang
Copy link
Member Author

@fommil I made some progress but not there yet. I am trying to build a library that can "read" any runtime structured data (Map[String, Any], Typesafe Config, Json AST, etc) into any case classes. I am still couple of days away from knowing if I can pull that one out yet.

@fommil
Copy link

fommil commented Jan 27, 2016

@kailuowang I hope you've watched the talk ? Please don't make this library do any more than typesafe's config. There are already libraries to do the others.

@kailuowang
Copy link
Member Author

Sam, I watched the talk. I am don't plan to make this library doing any
more than typesafe config. The thing I was talking about is a different
project.

On Wed, Jan 27, 2016 at 10:18 AM Sam Halliday notifications@github.com
wrote:

@kailuowang https://github.com/kailuowang I hope you've watched the
talk ? Please don't make this library do any more than typesafe's config.
There are already libraries to do the others.


Reply to this email directly or view it on GitHub
#5 (comment).

@fommil
Copy link

fommil commented Jan 27, 2016

cool! Hope it helped 😄

@andr83
Copy link

andr83 commented Sep 28, 2016

May be if it is interesting I did simple implementation on shapeless: https://github.com/andr83/scalaconfig

@joprice
Copy link

joprice commented Sep 28, 2016

This library has a slightly wider scope than product/coproduct hierarchies. Trait, class, and enumeration support may have to be dropped or remain as is. Also, if compilation speed is affected, I don't see any immediate benefit for users.

@andr83
Copy link

andr83 commented Sep 28, 2016

I thought this issue discuss refactoring to shapeless and decide to share my implementation. Regarding this do not see any compilation speed trouble before start use case classes with hundreds of fields. Yes my solution do not support traits with apply factories and enumeration but classes and custom readers are supporting. If missing features important for someone I will implement it.

@joprice
Copy link

joprice commented Sep 29, 2016

I didn't meant to target your comment. It simply brought the issue to my attention again, and I was voicing my opinion on the general topic.

@fommil
Copy link

fommil commented Sep 29, 2016

@andr83 great! What license are you going to use?

@andr83
Copy link

andr83 commented Sep 29, 2016

@joprice sorry for my confusion - our comments were close by time after a big delay in this topic )
@fommil it's publishing by MIT license. You can see it on project github page. Any suggestions are welcome )

@fommil
Copy link

fommil commented Sep 29, 2016

Apache 2.0 is better than MIT because it covers a lot of things MIT never considered but you almost certainly want if you want to go the permissive route. If you want the software to always be libre, then I recommend MPL or LGPL. I did a talk about this somewhere that you could find by googling my name and scalasphere

@andr83
Copy link

andr83 commented Sep 29, 2016

@fommil I'm agree with you on 100%. But exactly about this library I have no worries for any usage so MIT fit it well. Of course for other projects which I want to protect I will use more suitable license.

@fommil
Copy link

fommil commented Sep 29, 2016

Still, Apache 2.0 is an upgrade on MIT and is the license preferred by shapeless :-)

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

4 participants