Skip to content

Exercises for #48in24 #940

Description

@siebenschlaefer

Dear maintainers,

Jeremy posted an overview of the exercises that will be featured in #48in24:
http://forum.exercism.org/t/which-exercises-for-48in24/8970/19

The following featured exercises have not been translated to C yet:

I'm posting them here as a reminder.
I hope I will find the time to translate a few of them, and perhaps others will help, too.
Feel free to close or remove this issue if you do not find it helpful.

Edit:
There is now a dedicated matrix with the status of all exercises in #48in24, which tracks have implemented them, and which exercises are featured on a specific track:
https://exercism.org/challenges/48in24/implementation_status

Activity

  1. ryanplusplus commented on Jan 24, 2024

    @ryanplusplus
    Member

    Thanks for the heads up. I'll pick up some as I get time. If anyone would like to grab one, please leave a note here first so that no one else starts work on the same exercise.

  2. ahans commented on Jan 25, 2024

    @ahans
    Contributor

    I will try to contribute kindergarten-garden.

  3. ryanplusplus commented on Jan 27, 2024

    @ryanplusplus
    Member

    I'm going to grab spiral-matrix

  4. ryanplusplus commented on Jan 27, 2024

    @ryanplusplus
    Member

    I'm also going to grab protein-translation

  5. siebenschlaefer commented on Jan 27, 2024

    @siebenschlaefer
    ContributorAuthor

    I'm also going to grab protein-translation

    Somebody on the forum wanted to help with that. Although they didn't reply in the last two days.

  6. ryanplusplus commented on Jan 27, 2024

    @ryanplusplus
    Member

    I'm also going to grab protein-translation

    Somebodyon the forum wanted to help with that. Although they didn't reply in the last two days.

    Thanks for the heads up. I'll give them another few days to respond.

  7. ahans commented on Jan 27, 2024

    @ahans
    Contributor

    Opened a PR for pop-count as well since it was so trivial.

  8. ryanplusplus commented on Jan 28, 2024

    @ryanplusplus
    Member

    I'm going to grab knapsack

  9. siebenschlaefer commented on Feb 25, 2024

    @siebenschlaefer
    ContributorAuthor

    I've given the zebra-puzzle a shot (#959)

  10. ahans commented on Apr 12, 2024

    @ahans
    Contributor

    Put me down for yacht. I will probably get around to implement something next week.

  11. ahans commented on Apr 13, 2024

    @ahans
    Contributor

    This was quicker than expected: #972

  12. ahans commented on Apr 15, 2024

    @ahans
    Contributor

    I also gave rotational-cipher a shot: #975

  13. ahans commented on Apr 16, 2024

    @ahans
    Contributor

    Feel free to also put me down for dnd-character and food-chain.

  14. ahans commented on Apr 16, 2024

    @ahans
    Contributor

    About parallel-letter-frequency and bank-account, I wonder what approaches we want to support there, since both are about some form of parallelism and there's nothing in the C standard (library) to support this. pthreads would probably be the most natural, but OpenMP could also be an option? The latter would also work natively on Windows with MSVC, although the instructions about working locally sound like we don't want to support this anyways. What do you think?

  15. wolf99 commented on Apr 16, 2024

    @wolf99
    Contributor

    About parallel-letter-frequency and bank-account, I wonder what approaches we want to support there, since both are about some form of parallelism and there's nothing in the C standard (library) to support this. pthreads would probably be the most natural, but OpenMP could also be an option? The latter would also work natively on Windows with MSVC, although the instructions about working locally sound like we don't want to support this anyways. What do you think?

    Threading is not really in my wheelhouse so I have more questions than answers 😄
    I will point out first that the paralllel aspect of the exercises is not mandatory (the spec for bank-account talks about this specifically), so one option is to implement them without the parallelism.
    If we do add parallelism...

    • Does the test library support this in a a native way? (Or if we code the tests using the same practices as the implementation, do we risk "giving the game away" too much)
    • Will the library chosen make the tests or example implementation platform-dependent?
    • Is there some way to ensure that the submitted implementations are using parallelism rather than just a good sequential implementations?
    • etc...
  16. ahans commented on Apr 16, 2024

    @ahans
    Contributor

    Alright, implementing bank-account without the parallel aspect is probably fine. That's what the Python track does. The C++ track expects proper locking and has a test that spawns multiple threads, so chances are without locking this will fail. That's at least somewhat easily testable. We could do the same in C, no matter how we implement this.

    parallel-letter-frequency, on the other hand, without parallel processing would be quite boring. And also IMHO be against the spirit of the exercise. After all, it has "parallel" in the name! Some tracks (e.g., Python) explicitly don't want this exercise implemented. I implemented this exercise for the C++ track. To experiment with the performance aspect of the parallelism, it's nice to provide a benchmark students can run locally. For the test runner, we settled on having that only check the correctness of the result, but doing the actual computation sequentially. However, that led to confusion about solutions passing that would actually fail with true parallel execution. So I'd say we should make sure that the experience working locally is as similar as possible to what the online test runner does.

    Does the test library support this in a a native way? (Or if we code the tests using the same practices as the implementation, do we risk "giving the game away" too much)

    I don't believe the test library has any support for this. But it also doesn't need much. For bank-account, we would manually spawn a couple of threads to call functions in parallel. The student has to implement proper locking, but not create any threads themselves. So except for the library that is used for multithreading the test wouldn't give away much. For parallel-letter-frequency, you wouldn't see anything special in the tests, because all the parallel processing needs to be implemented by the student.

    Will the library chosen make the tests or example implementation platform-dependent?

    When we go with pthreads, we would be limited to POSIX platforms. For native Windows, one would have to use native Windows threads. However, the makefiles we currently use make things somewhat platform-dependent already, since MSVC wouldn't understand the flags used in there. The documentation suggests to use WSL2 when working under Windows. So there pthreads would work just fine.

    The only option I'm aware of that works natively on Windows (with MSVC) is OpenMP. I have used OpenMP pragmas in C++ code. That's much less low level than pthreads and would be similar in spirit to what you do in C++17 with parallel algorithms. However, I think I would find manual thread management more appropriate for a C exercise. I think that's also what the Rust example does: divide the texts into a number of blocks and have a worker thread for each block.

    Is there some way to ensure that the submitted implementations are using parallelism rather than just a good sequential implementations?

    For bank-account, the parallelism would come from the test. Without proper locking, the test would fail. So that's fairly easy to ensure. For parallel-letter-frequency, on the other hand, I don't see any option (just like the other tracks, they all only test for correctness; so also a sequential implementation would pass).

  17. wolf99 commented on Apr 16, 2024

    @wolf99
    Contributor

    Sounds good @ahans !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions