Fork me on GitHub
#exercism
<
2021-09-12
>
pez11:09:48

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

jaihindhreddy14:09:43

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.

🙏 2
Bobbi Towers18:09:51

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.

2
jaihindhreddy04:09:10

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.

pez06:09:26

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

pez06:09:45

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 Towers18:09:27

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

roelof15:09:22

@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)))

roelof15:09:36

2 tests are green but I cannot submit

2
jaihindhreddy04:09:19

I faced the exact same problem a few days ago.

Bobbi Towers18:09:13

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

roelof18:09:13

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

roelof18:09:32

I will not try another challenge till this one is solved

roelof18:09:57

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

Bobbi Towers18:09:49

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.

roelof18:09:47

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

Bobbi Towers19:09:07

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.

roelof19:09:04

I think you want the test runner problem to be solved

roelof19:09:42

@porkostomus so take time to find a good solution

pez22:09:41

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

metal 6
alex-eberts14:09:16

Hey @U0ETXRFEW! 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!

alex-eberts20:09:41

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?”

alex-eberts20:09:39

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 @U0ETXRFEW!

pez10:09:41

You mean you don’t see this green button?

pez10:09:23

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.

pez10:09:11

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

alex-eberts17:09:35

@U0ETXRFEW :face_palm: 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!

pez17:09:18

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