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

"Getting Started" directions don't work on OSX #396

Open
keithlayne opened this issue Nov 13, 2021 · 7 comments
Open

"Getting Started" directions don't work on OSX #396

keithlayne opened this issue Nov 13, 2021 · 7 comments

Comments

@keithlayne
Copy link

This is not a show-stopper for me but I'm a little blown away that you have two scripts that you instruct users to run after cloning this repo to follow along, and they are a little crazy, all things considered.

Here's my list of complaints:

  • Removing anchors doesn't work on Mac, because it looks like it's dependent on a gnu find feature (extended regexes)
  • The anchor script is completely overengineered. A quick grep shows that "ANCHOR" only appears in the repo in the lines that should be deleted in exercises and that script.
  • Perl? Really? I have perl installed for other reasons, but that's a pretty weird dependency for a book about another language.
  • The earlier step had you install node and some npms...that's guaranteed to be on the system now, and these tasks are trivial, so that would be better.
  • sed is still a better choice for all these tasks you could do sed -i.nuke && find ./exercises -type f -name "*.nuke" -delete or something like that.
  • Windows? I don't do windows myself, but I feel like there shouldn't be anything stopping those users from following along.

I've already spent more time complaining about this than it would take to fix it :( Sorry about that.

Forget all that, here's an actual suggestion that I might contribute:

When changes are merged into master, run a GH action that applies the instructions and pushes them to a branch that you can point users at. This is simple, would run in a controlled environment (linux, with gnu find/sed and perl installed), and would lower the bar that much more for your readers.

@keithlayne
Copy link
Author

I think it would go something like this:

  1. Create a branch, call it follow-along or something.
  2. Allow GH actions to push...I haven't done this personally, but I know it's a thing.
  3. Add an action that's something like this:
    name: Update follow-along branch
    on:
      push:
        branches: [master]
      pull_request:
    jobs:
      update:
        runs-on: ubuntu-latest
        steps:
          - Check it out 
            uses: actions/checkout@v2
          - name: Update the thing
            run: |
              ./scripts/resetSolutions.sh
              ./scripts/removeAnchors.sh
              git add --all
              git commit --message "Some really sweet message here"
              git push origin HEAD:follow-along
  4. Update the instructions in the book to instead check out the branch that's totally ready for your readers to play with!

@keithlayne
Copy link
Author

If I get motivated this weekend I will try to get all the config steps together, test on a non-fork (I guess? actions are weird), and wrap it up in a PR.

@milesfrain
Copy link
Member

Thanks for the feedback.

For some context, we swapped to perl due to mac issues with sed. See #194 and #196.
But those changes were made before it was possible to execute arbitrary .purs standalone scripts with spago, so perhaps we're due for a rewrite where we eat our own dogfood.

An action to push to a follow-along branch also sounds good. I probably won't get around to implementing that myself anytime soon, but will accept a PR.

@sorenhoyer
Copy link

sorenhoyer commented Jan 30, 2023

I think it would go something like this:

  1. Create a branch, call it follow-along or something.
  2. Allow GH actions to push...I haven't done this personally, but I know it's a thing.
  3. Add an action that's something like this:
    name: Update follow-along branch
    on:
      push:
        branches: [master]
      pull_request:
    jobs:
      update:
        runs-on: ubuntu-latest
        steps:
          - Check it out 
            uses: actions/checkout@v2
          - name: Update the thing
            run: |
              ./scripts/resetSolutions.sh
              ./scripts/removeAnchors.sh
              git add --all
              git commit --message "Some really sweet message here"
              git push origin HEAD:follow-along
  4. Update the instructions in the book to instead check out the branch that's totally ready for your readers to play with!

I can confirm that this works fine, and is a decent solution for us Windows users. :-)

There's a small typo where it says - Check it out - it should of course be - name: Check it out.

npx markdownlint kept failing, so in the generated tests.yml I commented out the last 2 lines to disable it for now:

#      - name: Run Markdown lint
#        run: npx markdownlint **/*.md

Depending on how your setup you might have to set github username and email

- name: setup git config
   run: |
     git config user.name "GitHub Actions Bot"
     git config user.email "<>"

And remember to allow "Read and write permissions" under Settings -> Actions -> General -> Workflow permissions

@JordanMartinez
Copy link

Just FYI. There's not really anyone maintaining this work anymore. So, this won't be fixed unless someone volunteers to do the above suggestion.

@sorenhoyer
Copy link

Just FYI. There's not really anyone maintaining this work anymore. So, this won't be fixed unless someone volunteers to do the above suggestion.

If the PureScript book is not up to date and actively maintained, how are people supposed to learn the language?

@JordanMartinez
Copy link

Just FYI. There's not really anyone maintaining this work anymore. So, this won't be fixed unless someone volunteers to do the above suggestion.

If the PureScript book is not up to date and actively maintained, how are people supposed to learn the language?

To clarify, just because no one is maintaining this resource doesn't mean it's still not useful. I'm not sure where and how much it's outdated. (Miles was the last one to seriously invest effort into updating and maintaining this resource. I just push "obvious" changes that benefit this, but I don't invest time into it otherwise because I'm using my time to benefit the community in other ways.) The concepts it teaches are likely still correct, but the code/syntax it uses may not be what one uses now.

I think you may be better off reading Functional Programming Made Easier (see it's announcement). It's not free, but a few people have praised it for how well it helped them get past the FP learning curve. If that work was written for an older version of PureScript, I would learn PureScript on that older version, and then read through the corresponding migration guide. That should get you up-to-speed.

Another resource is one I've written when I was learning PureScript: PureScript: Jordan's Reference. It's probably the most up-to-date resource we have, but it's learning approach may not be your cup of tea. It also doesn't have any exercises. But in general, if you're looking for documentation on X, you should likely look there first as I probably have something on it.

If you want to better understand monad transformers, I did a talk on that: https://github.com/JordanMartinez/pure-conf-talk/

Lastly, most people who need help usually ask questions and get answers from people on the core team or those who have been involved in the community for a while via the Discord chatroom or Discourse.

So, it's usually a combo of reading one of the above resources, watching a video I link to in my repo, and asking people for help on specific issues you run into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants