exercism

pez 2021-09-12T11:01:48.035100Z

Does anyone know of any exercise that bring in dependencies beyond Clojure core?

jaihindhreddy 2021-09-12T14:33:43.035200Z

AFAIK the tests themselves don't, but users are free to add deps. That being said, several new exercises have been added in Exercism v3, so I'm not sure.

šŸ™ 1
Bobbi Towers 2021-09-12T18:42:51.039700Z

The test runner on the site uses babashka and doesn't load any deps, so all code there is constrained to what will run with SCI. I chose this mostly for the startup speed, but I also think it's appropriate for encouraging folks to write more portable code. Those who solve the exercises locally are free to use Leiningen or deps.edn however.

šŸ¤” 1
jaihindhreddy 2021-09-13T04:15:10.049700Z

Is there text somewhere on the site that clarifies this to users? It would be confusing to have the tests pass locally but not on the site, preventing submission.

pez 2021-09-13T06:04:26.049900Z

Is babashka used as the test runner for submitted solutions as well?

pez 2021-09-13T06:06:45.050100Z

I think I lean towards that real Clojure should be used for the online test runner, regardless. It risks being similar to with old 4Clojure. Where an outdated Clojure version was used and contemporary documentation led users to create solutions that made the test runner throw errors and not accept the solutions.

Bobbi Towers 2021-09-13T18:11:27.050500Z

The trade-off is having the run finish in an average of 1 second with bb vs 4 seconds with Leiningen. I consider the better user experience to outweigh the compatibility issues, but it's a community project so I'm open to be swayed

roelof 2021-09-12T15:56:22.036100Z

@porkostomus also car-assembly has a problem with submit with this code :

(ns cars-assemble)

  (defn success-rate
  "Gives back the succes rate at a certain speed"
  [speed]
  (cond 
    (== speed 0) 0
    (< speed 5) 1
    (< speed 9) 0.9
    (== speed 9) 0.8
    (== speed 10) 0.77))

(defn production-rate
  "Returns the assembly line's production rate per hour,
   taking into account its success rate"
  [speed]
  (float(* 221 (success-rate speed))))

(defn working-items
  "Calculates how many working cars are produced per minute"
  [speed]
  (int(/ (production-rate speed) 60)))

roelof 2021-09-12T15:56:36.036500Z

2 tests are green but I cannot submit

āž• 1
roelof 2021-09-12T17:04:34.037100Z

Why a + @jaihindhreddy?

jaihindhreddy 2021-09-13T04:13:19.049200Z

I faced the exact same problem a few days ago.

roelof 2021-09-14T11:17:39.052600Z

oke

Bobbi Towers 2021-09-12T18:29:13.038500Z

Got a fix in the works, I've been tracking it in this issue (which is beginning to read like a blog post): https://github.com/exercism/clojure-test-runner/issues/22

roelof 2021-09-12T18:32:13.039200Z

I know @porkostomus I did this so you can maybe better see how to solve it

roelof 2021-09-12T18:32:32.039600Z

I will not try another challenge till this one is solved

roelof 2021-09-12T18:43:57.040500Z

I know how difficult it is to make such a complex problem and solve it right

Bobbi Towers 2021-09-12T18:56:49.043Z

It all started falling into place once I finally figured out how to use zippers! I could maybe even write a Concept exercise where the student is asked to do something with them.

roelof 2021-09-12T18:57:47.043500Z

O O, I hope it do not be a very diffcult one

Bobbi Towers 2021-09-12T19:01:07.045900Z

It wouldn't be, because the whole point is to teach just enough of the concept to get the basic idea. But then it could unlock a practice exercise that could use them to parse source code or something.

roelof 2021-09-12T19:15:42.046200Z

we see

roelof 2021-09-12T19:16:04.046800Z

I think you want the test runner problem to be solved

roelof 2021-09-12T19:55:42.047400Z

@porkostomus so take time to find a good solution

pez 2021-09-12T22:11:41.048900Z

Here’s the start of a project template for running the Clojure track in the browser without loosing Interactive Programming capabilities. Very much WIP, but please give it a spin and give me feedback. ā¤ļø https://github.com/PEZ/clojure-exercism-template

3
pez 2021-09-15T10:22:10.053900Z

Thanks!

pez 2021-09-15T10:22:41.054100Z

You mean you don’t see this green button?

pez 2021-09-15T10:25:23.054500Z

You can of course launch your workspace directly from the template project. But then you will have to fiddle some with forking or copying the repo when you want to push your progress to Github.

pez 2021-09-15T10:26:11.054700Z

Strange thing there with Brave. I’ll have a check.

2021-09-15T17:15:35.054900Z

@pez 🤦 I totally didn’t see the large, obvious green button on the template page. Doh! I guess I just assumed it was the github ā€œcloneā€ button and ignored it. Sorry for the false report!

pez 2021-09-15T17:22:18.056200Z

It is not a false report! It means I should refer more clearly to the button. Thanks for reporting!

2021-09-14T14:57:16.053100Z

Hey @pez! Great work on Calva - it’s so inspiring to see all the new features you’ve been working on! I’m interested in trying your new clojure-exercism-template but I don’t see the ā€œuse this templateā€ button displayed on the github repo page at: https://github.com/PEZ/clojure-exercism-template. I’ve tried in Chrome and Brave but both browsers are not showing the button. Maybe I’m looking in the wrong place? Thanks!

2021-09-14T20:16:41.053400Z

I’m answering my own question here in case others are having similar issues. Clicking the link ā€œhttps://gitpod.io/from-referrer/ā€ from the page https://github.com/PEZ/clojure-exercism-template appears to work and opens gitpod with the clojure exercism template. Gitpod appears to download the required linux image and I get a VS Code-like editor. However, when trying to start the repl with ā€˜Jack-in’ I get the following error notification: ā€œNo supported project types detected. Maybe try starting your project manually and use the Connect command?ā€

2021-09-14T20:35:39.053700Z

Ok, I got the REPL working in Chrome. This issue appears to be due to Brave browser blocking something when you do Calva REPL Jack in.. Great work @pez!