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

Exercise dependencies #186

Open
emiel opened this issue May 9, 2021 · 5 comments
Open

Exercise dependencies #186

emiel opened this issue May 9, 2021 · 5 comments

Comments

@emiel
Copy link
Contributor

emiel commented May 9, 2021

I've put in some work into the switch over to Spago. One thing that has me thinking is how to deal with exercise dependencies (spago.dhall).

  • We have the example solution which make use of certain dependencies. These are not necessarily the dependencies the student needs to use to solve the exercise. I'm thinking we could decouple these by having a spago.dhall file, i.e. solution.dhall to use for building and testing under CI.
  • Do we give the student a common set of dependencies so they do not need to worry about installing anything. Or do we give them the absolute basics and make them install anything they use? PureScript 0.14.x will start warning about unused dependencies and this can be a bit annoying.

Your thoughts?

@SleeplessByte
Copy link
Member

If this is expected behaviour when writing PureScript, having the student install would be an okay approach, but don't forget that we can't facilitate that (currently) when using the Web interface. Having a common set of dependencies, or the "correct" set per exercise might be the way to go.

@emiel
Copy link
Contributor Author

emiel commented May 10, 2021

Thanks for the feedback @SleeplessByte. I had not considered the new web interface. I'll poke around and see how https://try.purescript.org handles this situation.

@ErikSchierboom
Copy link
Member

As @SleeplessByte alluded to, the PureScript test runner runs without networking, which means that it can't install any additional dependencies when trying to run the tests. Tracks workaround this by pre-installing dependencies within the Dockerfile (which does have access to networking), which means that they won't have to be retrieved from the internet once the tests run. Applying this to your question, you can either:

  1. Install a huge number of libraries in the Dockerfile
  2. Pre-define the libraries to use in the exercises

I think 2 is the more safer approach.

@icyrockcom
Copy link
Contributor

Anything outstanding here?

@tomasurbanec
Copy link

Hi,
I bumped into the issue with dependencies while solving some of the exercises. I have done them locally to my likings but then I could not find a way how to submit my extra dependecies back to exercism (see #235 for more details).

I guess that ErikSchierboom's option 2 would be a good way to solve these problems quite easily as there are currently not that many exercises in the track (of course this might take its toll while adding new exercises later). Maybe with broader choice in case of more reasonable solutions. I am happy to help with that but my knowledge of Purescript is very limited so far. That is I am not in position to actually choose all the recommended libraries. But I guess it should be safe to include at least some more common data structures, broader string utilities and so on (eg. unordered-collections, strings-extra, parsing, ...). Maybe we can come up with some list of recommendations together?

In any case is there anything I can help with here?

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

No branches or pull requests

5 participants