I’ve been learning the Roc language recently, it’s a pretty amazing pure functional language inspired from Elm, aiming to be super fast, with great features such as full type inference, tag unions (awesome for many things in particular granular error handling), a separation between apps and platforms, and much more.
I wish the Roc language was supported here on Exercism. I’m happy to help make that happen in any way I can, and some of the main devs of the language also said they’d love to see this happen, so I’m sure I would get some help. What do you think?
Thanks, that looks good :)
Perhaps for “Run the test suite and make sure that it succeeds.” we should make it “Run the test with roc test hello-world-test.roc and make sure that it succeeds.”?
The docs in exercises/practice/.../.docs/instructions.md are exactly the same for every track (programming language). The canonical version is in problem-specifications and for each track we can check that we have the latest version using
bin/fetch-configlet
bin/configlet sync
Instead of editing the instructions, each track can add to the instructions by creating a instructions.append.md file.
I have updated the example repo. Note that the purpose is simply to show how an example exercise would work. The official repos like github.com/exercism/roc and github.com/exercism/roc-test-runner would be created by Erik.
Instead of editing the instructions, each track can add to the instructions by creating a instructions.append.md file.
Thanks, sounds good!
Converting json to test case source code is an ideal task for automation. How this should be done is one of the next questions to consider.
Where feasible, generators should be written in the track’s own language, but that isn’t required.
We have a json package for Roc so we should be able to make that work :)
I’ve submitted PR #2 on the prototype-roc-track repo, with the minimal files needed to make configlet lint and configlet sync happy. I understand that it’s just a prototype repo, but hopefully this will make it easier to get the final track repo up and running.
Also, I’m happy to help with the generator. Is there a simple one I can draw inspiration from?
FYI, I just created this prototype-roc-test-runner repo, mostly copied from the c-test-runner, with some tweaks for Roc. The main difference is the Dockerfile. I’m discussing with the Roc team to see how we can implement the test runner and product the JSON output that Exercism expects.
Here’s a very simple generator that was sufficient for the first exercises it generated, and has only needed minor changes so far:
With each new exercise, we add a short source file with the exercise’s name.
We use Python’s ability to load another source file (module) by name, and call into it from the generator main.
In other languages, I could imagine each exercise providing a trivial main() entry-point that calls into the generator, and passes a callback that generates a test case, given property/input/expected.
I could imagine the callback being optional, and the generator being expected to “do the obvious thing”
You may want to consider using the locally cached problem spec data vs requesting the file from GitHub every time. The configlet tool users a local clone and you can piggyback off the same data.
Hi @keiraville,
I added docs, added hello-world and leap, including example code, and I implemented verify-exercises. However, I didn’t receive the invite to join the team (or perhaps it timed out?). Could you please send me another invite, so I can push my changes?
Thanks!
Going by emails I received, was there something like
from: GitHub <noreply@github.com>
subject: [GitHub] @ErikSchierboom has invited you to join the @exercism organization
...
This invitation will expire in 7 days.