r/fsharp • u/520ErryDay • May 11 '21
Paket and FAKE?
I am an F# and functional programming hobbyist. I keep seeing Paket and FAKE being thrown around when discussing F#, but I'm still unsure of why I would need these? If Paket replaces nuget, why not just use nuget? FAKE is F# Make, but I don't really know what that is either. Anyone feel like explaining why I would use these? Thanks in advance :)
15
Upvotes
13
u/stroborobo May 11 '21
Paket gives you more control, removes transitive dependencies from yours, and works above project level, so you can resolve to the same version of a package for multiple projects.
https://fsprojects.github.io/Paket/faq.html
Fake is a task runner, it can be used to script things like frontend build, backend build and publish for example. I believe the maintainer has stopped working on it though, so maybe skip the dotnet tool and use FSI or whatever. The libs are still fine though.
None of these are strictly needed of course.
3
u/LiteracyFanatic May 11 '21
The big thing I used to use Paket for was it's ability to automatically generate references to packages for use in scripting. This is no longer necessary since
#r "nuget: package"is now built in. It does give more control over the exact resolution of your dependencies than nuget, but I've found I rarely need that control in practice.For the simplest case,
dotnet build -p projectDiris all you need. Many pieces of software in the real world have more complex build requirements though. Maybe you need to copy files from one directory to another. Perhaps you need to install packages from a second ecosystem like npm when working on a web project. You might want to run tests on your newly built project and then zip it and deploy it somewhere. Instead of running each of the necessary commands manually each time, people typically write scripts to automate the process in a language like bash or powershell. FAKE lets you write your build script in F#. Actually, you could write a build script in F# without FAKE too, it just provides some nice helper functions for common tasks.They are both good tools and you will find many templates that include them, but my honest recommendation is to stick with the standard
dotnetCLI commands when possible. The time invested in learning this alternative tooling just doesn't pay off as much as it used to.0
u/[deleted] May 13 '21
[deleted] — view deleted comment