c icon indicating copy to clipboard operation
c copied to clipboard

Add learn track for C

Open dawnandrew100 opened this issue 1 year ago • 5 comments

Currently, the C track links out to some resources to learn outside of Exercism. However, I don't believe that https://www.learn-c.org/ is actively maintained and other languages attached to this site are extremely outdated (such as using the old formatting style for strings in python instead of f-strings). And while I'm sure CS50X is a fantastic resource, it appears that it focuses on a lot more than just the C language. This isn't good news for people who are interested in learning specifically about C and not interested in spending 12 weeks learning about all of computer science.

It would be fantastic to have a learn track on Exercism for C instead of having to rely on the good graces of outside individuals.

dawnandrew100 avatar Jul 15 '24 14:07 dawnandrew100

Hi @dawnandrew100 You are correct that we don't have any concepts exercises for the C track.

I feel that this is because of the level of work needed to get up to speed with implementing concept exercises and related tooling.

If you are volunteering to implement any of these, it would be very welcome!

As an alternative, updates to the links that you have mentioned, as well as any other relevant links, would also be a welcome commit.

Let us know if you need any support for either of these!

Or did you have something else in mind by "learning track"?

wolf99 avatar Jul 16 '24 14:07 wolf99

I'll definitely look to see if there's an up to date version of a free resource available so that the links can be updated sooner rather than later. And I would love to participate in adding concept exercises similar to what Gleam has!

Is there a specific template that is available? Or should I just copy the layout of a track like Gleam?

dawnandrew100 avatar Jul 16 '24 16:07 dawnandrew100

Great!

To change referenced websites you only need to make changes to the markdown files in this repositories /docs directory.

For concept exercises...

What is shown on the website as the Learn track for a language is actually the concept exercises and related syllabus. The starting point for the documentation on these is here: https://exercism.org/docs/building/tracks#h-concepts

Additionaly, see the concepts already described in the /concepts directory.

I suggest starting by proposing a first concept exercise for a syllabus, based on one of the documented concepts, then implement that, see specifically: https://exercism.org/docs/building/tracks/syllabus and https://exercism.org/docs/building/tracks/concept-exercises

Once the first one is in place then new ones can be added one by one and the syllabus can be adjusted as needed.

I think we can leave any additional tooling until later as I even have forgotten what is needed for that 😅.

Not sure if this is enough to help you get started, please ask here if you need more.

(FYI, as far as I know the maintainers on this track, including me, are not very active on the forums or other contact channels. Issues or PRs on this repo are probably the best place for discussion currently)

wolf99 avatar Jul 17 '24 08:07 wolf99

@wolf99 I would simply like to clarify. From what I understand, I assume everything needed for the concepts are already setup. Things like actually setting up the exercises and making few changes in other places, as per : https://exercism.org/docs/building/tracks#h-concepts is all that is necessary?

I know some things in the .meta directory and the exercises itself are missing. I assume I can simply use what you have so far, for the public facing directories in order to start?

sinmi-hub avatar Aug 13 '24 20:08 sinmi-hub

Hi @sinmi-hub No need to do the whole shebang, have a look at #586 to do just the first concept exercise! Let us know if you need help

wolf99 avatar Aug 16 '24 19:08 wolf99

I wonder if C's learn track could use some of those from C++'s? https://GitHub.com/exercism/cpp/tree/main/exercises/concept https://GitHub.com/exercism/cpp/tree/main/concepts https://GitHub.com/exercism/c/tree/main/concepts

Just noticed there are hidden concepts for C: https://Exercism.org/tracks/c/concepts/basics

Although no related exercises like in C++: https://Exercism.org/tracks/cpp/concepts/basics

GoToLoop avatar Apr 24 '25 01:04 GoToLoop

I'm a bit puzzled by the status of this. There are a whole lot of concepts merged, but exercises/concept doesn't exist. PR #765 was about adding the Lasagna exercise, but it was closed without explanation 3 years ago.

This all has the feel of what rock bands refer to as "creative differences", around the time they break up acrimoniously and launch a bunch of lawsuits. It would be unhelpful to discuss now, that in a public forum...

I've been deep in the Julia syllabus for 11 months now, with maybe another couple of months work needed to get it to a decent state. I might have some free time later this year. What would it need to get past the talk and make progress on this syllabus? I know C isn't seen by youngsters* as the latest, greatest thing, but it underpins everything (Python, for a start!), and I suspect it will remain dominant on embedded systems.

I'm a bit rusty on C, but I used it a lot in the early 1990's and a bit since!

* I define "youngsters" as anyone under 60.

colinleach avatar Aug 10 '25 19:08 colinleach

There's no shadowy conspiracy to prevent the release of a learning track. @wolf99 and I are the top two contributors and are active maintainers of this track -- I have no objection to a learning track and @wolf99 has done a lot of the work to get us where we're at. As far as I know, the only missing piece is someone who's motivated to do the legwork required to set things up. I'm personally much more interested in the practice exercises than learning exercises so I haven't pushed to get the work done nor have I done the work myself (and if I'm being honest, I don't even have a good grasp on what's required), but that's lack of interest, not opposition.

Looking back through this issue, we've had a few folks express interest and then lose interest or otherwise not follow through (which is fine! we're all volunteers and I'm not expecting anybody to do any work they're not interested in doing). If you're interested in doing the work, I'm happy to review pull requests.

ryanplusplus avatar Aug 10 '25 20:08 ryanplusplus

Sounds like there might be a role for me. As I said, I'm no C expert (apparently, I only did 16 practice exercises so far - I'll improve that!), but I learned at the sharp end about learning tracks:

  • I started an R track, but ran out of active maintainers for review.
  • I worked with Bethany on the Python track, and she taught me a lot.
  • The Julia track is at 28 concepts live, with 6 more in various states of progress. Feedback has been more positive than I expected (from my grumpy old man perspective...)

I'll see what I can do in the next few weeks, with the intention to try and accelerate later this year.

colinleach avatar Aug 10 '25 20:08 colinleach

In past questions from potential contributors on this topic I understood, that because there are no other concept exercises already existing in the track it seems like there may be a bit more to grok to get started than just creating a single exercise. With your experience, perhaps it's not such a large challenge though, and the track is ripe for expansion in this regard thanks to previous work on concepts by @bopahop a few years ago. I have not had time to dedicate to implementing new content for some time. But I'm happy to review any contributions, all of which are welcome @colinleach !

wolf99 avatar Aug 10 '25 21:08 wolf99

there may be a bit more to grok to get started

Yes, there are a lot of moving parts - certainly compared to the scripting languages I usually work on!

A few quick questions:

  • The tests now seem to be in test_{exercise}.c at the top level, with some test-framework/unity*.* files that seem fairly standard. This conflicts with the Exercise anatomy section of CONTRIBUTING.md (probably true of many tracks!).
    • Do I just copy the unity stuff from another exercise, or does it need exercise-specific customization?
  • Are there existing plans for preferred exercises, and a flowchart of how it all fits together? I'm happy to invent all this myself, but if you have plans I'll try to follow them. At least initially - I never met a plan that survived unchanged to syllabus launch!

colinleach avatar Aug 10 '25 21:08 colinleach

Looking more closely at #765, I see this was authored by @wolf99 (so presumably professionally written). Is this something you might want to reopen? If so, I could go straight to a Booleans exercise: either the classic annalyns-infiltration, or a port of cpp/pacman-rules.

colinleach avatar Aug 10 '25 22:08 colinleach

  • The tests now seem to be in test_{exercise}.c at the top level, with some test-framework/unity*.* files that seem fairly standard. This conflicts with the Exercise anatomy section of CONTRIBUTING.md (probably true of many tracks!).

Good catch. We need to update CONTRIBUTING.md as the exercise structure changed during the transition from v1 to v2 (or was it v2 to v3?).

Do I just copy the unity stuff from another exercise, or does it need exercise-specific customization?

They should all be the same so you can just copy from another exercise.

ryanplusplus avatar Aug 10 '25 23:08 ryanplusplus

Hey all! Life's been busy but all the emails I've gotten recently about this issue reminded me of its existence and I'd still like to contribute! Just to understand what exactly still needs to be done, is it building the concept exercises like in the Python track or the CPP track? Because, as mentioned by @GoToLoop , it looks like the concepts themselves are already pretty fleshed out.

dawnandrew100 avatar Aug 11 '25 18:08 dawnandrew100

Looking more closely at #765, I see this was authored by @wolf99 (so presumably professionally written). Is this something you might want to reopen? If so, I could go straight to a Booleans exercise: either the classic annalyns-infiltration, or a port of cpp/pacman-rules.

Honestly I can't remember a thing about why that was needed nor how it was put together. The requirements may have changed since then even, that was ~3yrs ago, and iirc bobahop made changes after that but I forget what they were or if they necessitated changes in that PR. You may need to do some investigation on what is required (should be documented on the exercisim website). But feel free to copy-paste my content - where relevant, or let me know if that PR content is still mostly relevant and we sure can reopen it.

wolf99 avatar Aug 11 '25 19:08 wolf99

Hey all! Life's been busy but all the emails I've gotten recently about this issue reminded me of its existence and I'd still like to contribute! Just to understand what exactly still needs to be done, is it building the concept exercises like in the Python track or the CPP track? Because, as mentioned by @GoToLoop , it looks like the concepts themselves are already pretty fleshed out.

Pretty much as my answer above to @colinleach , there's some investigation to be done to get the infrastructure in place (I forget details, but probably just a few scripts) and the first exercise together. Then further exercises are just those exercises per the concepts. Technically a single exercise could be written without the infra in place first, but the infra then needs to be created before anything happens with that exercise.

wolf99 avatar Aug 11 '25 19:08 wolf99

I can't speak for the maintainers (who always get the last word!), but my personal view is:

  1. Sort out the Lasagna exercise, as in @wolf99's comments.
  2. I'm porting cpp/pacman-rules to C, so that I can get my head round file structures. This goes with the Booleans concept.
  3. If we don't already have a (draft!) plan, we need to create one: typically a Mermaid diagram, that then gets changed repeatedly...
  4. We might want to revisit the existing concept docs. The introduction.md files are probably about right, but the about.md files are too short for my taste, and probably need a lot of links added. Compare the C versions with C++ or Python and you'll see what I mean.

Experience shows that I can write halfway decent concept docs, and I've had a lot of practice at finding exercises on other tracks to ~~plagiarize~~ fork. Unfortunately, I'm mostly useless at thinking up new exercises. Anybody with that skill will be extremely valuable!

colinleach avatar Aug 11 '25 19:08 colinleach

Is there no equivalent to canonical data for concept exercises? Do they just get copied between tracks or created from scratch for each track?

ryanplusplus avatar Aug 11 '25 19:08 ryanplusplus

I'm no Mermaid expert, but this is what I did for Julia. I seem to remember that the Crystal track used a very different style, so it's a matter of both taste and expertise. It may be overkill, but I also use Sheets to track whether I have all the right files. I just started this for C. The "Other track exercises" tab may be interesting: though not fully up-to-date, it's helpful in searching for relevant exercises to port.

colinleach avatar Aug 11 '25 19:08 colinleach

Is there no equivalent to canonical data for concept exercises?

Definitely no. The track authors are on their own, and can do what they like. Exercises can often be ported from other tracks, but usually need significant editing (C++ may be our friend here, given the similar syntax).

colinleach avatar Aug 11 '25 19:08 colinleach

there's some investigation to be done to get the infrastructure in place

Pretty simple. Somebody needs to create an exercises/concept directory to contain the exercises (as part of the first PR to be merged).

At the top of config.json we have:

  "status": {
    "concept_exercises": false,

Leave that alone for now, or all hell breaks loose (says the maintainer who once broke the R track, needing Jeremy to do emergency repairs...). At syllabus launch, it is changed to true and all students get a "Learn" tab.

At this stage, the concept exercises should be "status": "wip" in the top-level config.json, so only maintainers can see them (a slight pain if the author isn't a C maintainer, but it stops them showing on every student's Practice tab). At syllabus launch it is changed to "beta".

There are guidelines for much of this. I don't know how many concept/exercise pairs you need to launch a syllabus, but I think it's at least 10.

colinleach avatar Aug 11 '25 19:08 colinleach

You may need to do some investigation on what is required (should be documented on the exercism website). But feel free to copy-paste my content - where relevant, or let me know if that PR content is still mostly relevant and we sure can reopen it.

#765 looks good, as far as it goes:

  • .docs/introduction.md is empty, but can be copied from concepts/basics.
  • docs/instruction.md is empty, and writing this will be probably the biggest thing needed.
  • docs/hints.md is empty, and will be extremely important for a first concept exercise.
  • docs/design.md is empty. This can be brief, but it is useful to push back against future feature creep.
  • top-level config.json has a duplicated "status". I've added a comment.
  • I've no idea if the unity files are the current version.

Your choice (obviously), but I would recommend reopening the PR and seeing what CI thinks of it. Then we can add the documents, and update unity if necessary.

colinleach avatar Aug 11 '25 21:08 colinleach

as mentioned by @GoToLoop , it looks like the concepts themselves are already pretty fleshed out

When you look closer, there is a lot of quite basic stuff missing: numbers, includes and header files, arrays, "strings" (or their C equivalent), enums...

We can start fleshing this out on a planning diagram, but I predict that it will keep growing as we get deeper into implementation.

colinleach avatar Aug 12 '25 00:08 colinleach

I'll follow your lead!

dawnandrew100 avatar Aug 12 '25 00:08 dawnandrew100

TBH, I'm mostly copying other tracks: plagiarism is the sincerest form of flattery!

colinleach avatar Aug 12 '25 00:08 colinleach

Another detail I just spotted:

Concept exercises do not use TDD. In fact, the online editor hides the test file from the student.

This means that TEST_IGNORE(); lines should not be used for Concept exercises (but are encouraged for Practice exercises).

colinleach avatar Aug 12 '25 18:08 colinleach

I would recommend reopening the PR and seeing what CI thinks of it

Yes, I said that, but I'm changing my mind. There are a bunch of missing files, and we need to address the comments from @siebenschlaefer. I'll draft a new version and try to PR it later today (though I'm on MST, UTC-7:00, so pretty far west).

Update: PR #1079, though CI is problematic.

colinleach avatar Aug 12 '25 18:08 colinleach

I had a tentative first stab at finding exercises that might be useful to port to C. This issue is long and general, so I started a more focused one: #1080

colinleach avatar Aug 13 '25 17:08 colinleach