iheartradio / ficus

Scala-friendly companion to Typesafe config
MIT License
327 stars 55 forks source link

refactor - move from macro to shapeless #5

Open kailuowang opened 8 years ago

kailuowang commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

fommil commented 8 years ago

well I didn't say I'd write it, but I'd be happy to show you how :smile: 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 commented 8 years ago

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

fommil commented 8 years ago

enjoy! https://twitter.com/fommil/status/678195060429705216

kailuowang commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

fommil commented 8 years ago

any movement on this?

kailuowang commented 8 years ago

@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 commented 8 years ago

@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 commented 8 years ago

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 https://github.com/iheartradio/ficus/issues/5#issuecomment-175683885.

fommil commented 8 years ago

cool! Hope it helped :smile:

andr83 commented 7 years ago

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

joprice commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

andr83 commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

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