Does anyone know of any exercise that bring in dependencies beyond Clojure core?
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.
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.
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.
Is babashka used as the test runner for submitted solutions as well?
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.
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
@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)))
2 tests are green but I cannot submit
Why a + @jaihindhreddy?
I faced the exact same problem a few days ago.
oke
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
I know @porkostomus I did this so you can maybe better see how to solve it
I will not try another challenge till this one is solved
I know how difficult it is to make such a complex problem and solve it right
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.
O O, I hope it do not be a very diffcult one
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.
we see
I think you want the test runner problem to be solved
@porkostomus so take time to find a good solution
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
Thanks!
You mean you donāt see this green button?
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.
Strange thing there with Brave. Iāll have a check.
@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!
It is not a false report! It means I should refer more clearly to the button. Thanks for reporting!
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!
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?ā
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!