HuwCampbell / grenade

Deep Learning in Haskell
BSD 2-Clause "Simplified" License
1.44k stars 84 forks source link

Use Stack for Grenade #36

Closed cpennington closed 6 years ago

cpennington commented 6 years ago

I rebased #29 onto the latest version of grenade, and updated the version of hedgehog in stack.yaml. I use stack (like @varosi), and have validated that the setup works (on Linux, in my case).

HuwCampbell commented 6 years ago

Happy for people to use stack. I would prefer to keep autogenerated cruft to a minimum if that's ok though.

I think the only thing which isn't possible with a stack init is the hedgehog dependency. But, that should be solved by bumping it to 0.5 (which is on stackage) I believe.

I'll do that first and we can revisit.

cpennington commented 6 years ago

I'm not sure which parts you mean are 'autogenerated cruft'? stack.yaml was autogenerated, but it's intended to be checked in and evolved over time as needed. Would you feel better about it if I pruned out all of the documentation and stripped it down to just actual specific configuration?

eschnett commented 6 years ago

I'd like to weigh in in @cpennington's favour. stack.yaml is not a file that's auto-generated from other repository content -- it is only auto-generated when a package is created (or converted to using stack). stack.yaml describes how dependencies should be resolved, and one of its main features is that the same stack.yaml file will continue to work (and help correctly resolve dependencies) for the years to come, even if other packages on Hackage get updated.

Put differently: The main point of a stack.yaml file is that is isn't auto-generated whenever someone downloads the repository, but that it stays fixed at a known-to-work version.

Yes, I'd remove the instructions and comments from the stack.yaml file.

HuwCampbell commented 6 years ago

The issue I have is that while I see that stack can be useful for building applications and managing dependencies which are not on Hackage, I believe it and its curated snapshots can paper over real problems when building libraries, which can potentially hurt cabal users, or those wishing to use packages beyond the snapshot.

I don't think there is an ideal solution, dependency management is not a solved problem. Stack has definitely helped a lot of people come to Haskell without having to worry about it as much; but it's a big hammer.

I would like grenade to be in a place where it can build out of the box with cabal, and be one stack init away from building with stack as well.

eschnett commented 6 years ago

@HuwCampbell Okay (and I won't argue for including a stack.yaml in grenade any more).

Out of personal interest (and maybe you want to reply in private): What problems can occur when building libraries?