-
Notifications
You must be signed in to change notification settings - Fork 697
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
Restructure Quickstart docs to get from zero to hacking faster. #6157
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work on improving docs!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice improvements to the docs! Thanks, @m-renaud 👍
Note that audience have changed, from ”I cloned a Haskell repository and want to make a change” to ”I want to write a Haskell package”.
IMHO former is more common, and latter is not something every user may even need. Given`cabal run`, and `cabal repl` there are simpler ways to start own experiments than creating own package. And creating own package is described (or should be) in ”development package”.
TL;DR don’t forget about the people, ”I cloned a package, what and how I can do next?”
…
|
Hey @phadej, thanks for the feedback!
I don't think this is true, the audience was never for those cloning a Haskell repo. The previous wording said things like "Lets assume we have created a project directory and already have a Haskell module or two.", if you're at the point where you've found a Haskell repo you want to hack on you almost certainly know about
I'm going to challenge this assumption, I wouldn't call myself a Haskell newbie by any means, and I've can
For sure, this is the other common way to "get started" and doesn't really have any docs for it currently afaik. I still think the "Hey, I just learned about Haskell, I want to run through some tutorials, how do I create a file and set up some dependencies that I need?" should be the primary focus if we ever want to grow the Haskell community. In general I think the overall docs need to be restructured to put these two "I'm just getting started"/quickstart sections much closer to the beginning. I have a bunch of ideas for improving the docs, wasn't sure the best way to solicit feedback before making a bunch of changes though, maybe open an RFC issue? |
I respectfully don't understand the purpose of telling newcomers to
It would make most sense to me for the quickstart guide to either be the "what do I do with this cloned repo" that @phadej suggests, or to give the user hand-holding with |
Hey @tom-audm and @phadej, reviving this PR due to forced free time :P There are several changes in this PR and I'd like to get as many of them merged in as possible. I'm going to start by attempting to answer the questions you've raised:
Neither using
If you're a library author who's planning on uploading things to hackage than I think you're beyond the newcomer level and thus are already familiar with the tools. On the other hand, if you're a newcomer to Haskell all you want to know is "How do I get an environment up and running as soon as possible?" In general Haskell's docs throughout the ecosystem aren't the most newcomer friendly. If you look at other languages, for example the Rust - Getting started page, it lays out going from zero to a functioning project with dependencies in a very concise way. Reading through your comments again it sounds like these are the concerns you have:
I think the major source of misalignment comes from me viewing the "Quickstart" as a "Haskell newcomer quickstart", and (my understanding of) your view as the "Quckstart" to "I want to develop a Haskell package to put on Hackage". The solution to this may be to create a separate "Getting Started" page in the Cabal docs (Proposal: "Section 0. Quickstart" or "Section 0. Getting started with Haskell and Cabal") which mirrors the "Rust - Getting started" page. If this sounds like a reasonable path forward I can put together a PR for comments. Let me know what you think! @23Skidoo for thoughts/comments as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine. Some nitpicking inline.
Cabal/doc/developing-packages.rst
Outdated
|
||
Every project needs a name, we'll call this example "proglet". | ||
**TL;DR;** ``mkdir proglet && cd proglet && cabal init --non-interactive && cabal run`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't --non-interactive
default now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, updated, and also explicitly added proglet
as the argument to cabal run
.
Cabal/doc/developing-packages.rst
Outdated
Using "cabal init" | ||
------------------ | ||
The ``cabal init`` command creates the necessary files for a Cabal package, | ||
it has both an ``--interactive`` (default) and ``--non-interactive`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haven't these reversed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I wrote this, yes. Move the (default) to after non-interactive.
Cabal/doc/developing-packages.rst
Outdated
... | ||
Linking /path/to/proglet ... | ||
|
||
$ cabal run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add the executable name. It's nice that cabal run
works without it, but that is rare special case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Cabal/doc/developing-packages.rst
Outdated
Linking /path/to/proglet ... | ||
|
||
$ cabal run | ||
<Stuff about resolving dependencies, build profile, compliling, linking> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Cabal/doc/developing-packages.rst
Outdated
|
||
It is assumed that all the files that make up a package live under a common | ||
project root directory (apart from external dependencies). This simple | ||
example will have all the project files in one directory, but most packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Cabal/doc/developing-packages.rst
Outdated
example will have all the project files in one directory, but most packages | ||
will use one or more subdirectories. | ||
|
||
Cabal needs two extra files in the project's root directory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package's
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I'll change non-interactive The side-effect of above would be that these test projects won't be as such uploadable to Hackage.
From my experience, that is not true. People want to upload their stuff to Hackage almost as soon as they get something working, sometimes even a bit before that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think my most recent commit addresses your comments, lmk if I missed anything!
Cabal/doc/developing-packages.rst
Outdated
|
||
Every project needs a name, we'll call this example "proglet". | ||
**TL;DR;** ``mkdir proglet && cd proglet && cabal init --non-interactive && cabal run`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, updated, and also explicitly added proglet
as the argument to cabal run
.
Cabal/doc/developing-packages.rst
Outdated
Using "cabal init" | ||
------------------ | ||
The ``cabal init`` command creates the necessary files for a Cabal package, | ||
it has both an ``--interactive`` (default) and ``--non-interactive`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I wrote this, yes. Move the (default) to after non-interactive.
Cabal/doc/developing-packages.rst
Outdated
... | ||
Linking /path/to/proglet ... | ||
|
||
$ cabal run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Cabal/doc/developing-packages.rst
Outdated
Linking /path/to/proglet ... | ||
|
||
$ cabal run | ||
<Stuff about resolving dependencies, build profile, compliling, linking> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Cabal/doc/developing-packages.rst
Outdated
|
||
It is assumed that all the files that make up a package live under a common | ||
project root directory (apart from external dependencies). This simple | ||
example will have all the project files in one directory, but most packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Cabal/doc/developing-packages.rst
Outdated
example will have all the project files in one directory, but most packages | ||
will use one or more subdirectories. | ||
|
||
Cabal needs two extra files in the project's root directory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
SG. Alternatively I can submit this and you can make the doc change at the same time you change the behaviour (my preference to keep doc updates with code changes).
Fair enough. I guess I was referring to folks who are just discovering haskell, it's unlikely they'll be uploading to hackage right away, but your point still stands. lmk if you have suggestions for wording tweaks around this. |
Alright, I think I've addressed all of your comments. Let me know if there's anything else, otherwise can you merge this into master? |
Why did this stall? Is it still up to date? |
- Combine interactive and non-interactive sections together, and mention which is the default. - Add output from 'ls' command. - Add note about Setup.hs being optional - Small formatting changes. [ci skip]
[ci skip]
febd930
to
99b74ce
Compare
Just rebased but looks like files have changed locations since this was started. |
Alright, fixed. The rebase blew away the comment anchors though unfortunately. |
@phadej PTAL when you have a chance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed rather shallowly, but apart of a few nitpicks it LGTM and based on the in-depth discussion by the other esteemed reviewers I'd love to see this merged ASAP (sorry for the prolonged process --- the kind souls helping with cabal are smeared rather thin).
@m-renaud: do my nitpicks make sense? Let's get this merged. |
Hey @Mikolaj! Yes, thank you for the review, sorry for the slow reply here; I'll try to get the changes out this week. It could definitely use some active voice rewording (read: more direct) throughout, but I can do that in a follow up. |
Hey @Mikolaj! I'm on vacation until next Monday but can resolve any merge conflicts next week, if that's an acceptable timeframe :) Edit: next Monday |
@m-renaud: in that case, please don't think about it and enjoy your vacation. :) I will resolve conflicts and if we happen to merge this PR (perhaps even to 3.6) before your return, we can always adjust with your feedback for a point release, after you return. |
The rebased PR is at #7551. Whomever feels like it, please kindly review. |
I've made a few changes to the structure of the "Quickstart" section of the user guide so that someone new to Cabal can get to a Haskell package they can build and run sooner. Additionally, changes are made given the new Executable default for
cabal init
when non-interactive is used.Changes include:
This partially addresses #6194.
[ci skip]
Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!