Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concept: bitwise operations #698

Open
jiegillet opened this issue May 31, 2024 · 7 comments
Open

Concept: bitwise operations #698

jiegillet opened this issue May 31, 2024 · 7 comments
Assignees
Labels
x:action/create Work on something from scratch x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/concept Work on Concepts x:module/concept-exercise Work on Concept Exercises x:priority/high Has a higher priority than other issues x:size/large Large amount of work

Comments

@jiegillet
Copy link
Contributor

Design

Goal

The Goal is to learn to use the Bitwise module

Learning objectives

Students should be able to

  • understand the basics of binary encoding for integers
  • know that Elm integers are 32 bits and the implications of that
  • use basic operations (and, or, xor, complement)
  • use bit shifts operations (shiftLeftBy, shiftRightBy, shiftRightZfBy)

Out of scope

Nothing

Concepts

The concept this exercise unlocks is:

  • bitwise

Prerequisites

  • basics-1
  • basics-2

Analyzer

  • TBD depending on the exercise

Comments

  • Keep the exercise simple, we want to keep the prerequisites low
  • There are probably many equivalent concepts in other tracks, forking an exercise is a strong option
  • There are some practice exercises that use Bitwise already, pick the most relevant ones (if not all) to practice the concept, and make the concept a prerequisite for the rest
@jiegillet jiegillet added x:action/create Work on something from scratch x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/concept Work on Concepts x:module/concept-exercise Work on Concept Exercises x:size/large Large amount of work x:priority/high Has a higher priority than other issues labels May 31, 2024
@stewartmurrie
Copy link

I'd like to work on this ✋

@ceddlyburge
Copy link
Contributor

Awesome!

Do you want any help / pointers to the docs or similar?

I usually start by copy posting an existing concept and concept exercise, and replace things as I go, but I think some of the other maintainers have a different process ...

@stewartmurrie
Copy link

If you know of tracks that have good examples of this concept I'm happy to borrow from them. Also, this will be my first Exercism contribution so I might need some help making sure it's good :D

@ceddlyburge
Copy link
Contributor

Hi Stewart, we are certainly here for code review and advice and things like that.

This place shows all the concept exercises that currently exist, across all languages, so I can look for things there.
https://exercism.org/docs/building/tracks/stories

And these are the docs for creating a concept
https://exercism.org/docs/building/tracks/concept-exercises

Cheers , cedd

@jiegillet
Copy link
Contributor Author

I usually recommend looking at the Elixir track, but in this case the concept exercise is linked to another, and not very helpful. I'm not sure if other tracks have what we need.

Anyway in this case, we can keep the intro it really simple: Elm uses the Bitwise module, here is or, and, etc, a couple of examples and we are done.

The exercise should be simple too, hopefully it would have no other dependencies than the basic ones. I just thought of something (no need to pick this, you can probably do better): creating helper tools for the Linux permission system read/write/exec encoded in numbers up to 7, like canOnlyRead canReadOrWrite, things like that? And then maybe some other OS "SlidingDoor" is encoding the same information, but on higher bits (101000 instead of 101) so we need to convert to and from. Or maybe there are three sets of permissions user/group/all in one integer (uuugggaaa) and we need to copy a permission from user to group?

@stewartmurrie
Copy link

I looked at Elixir and didn't think what they had was all that useful here. But the Java one seems helpful, so I based the Elm concept and exercise on that.

So, I think I have the concept ready for review. I've checked that the exemplar passes the tests, and configlet lint is more-or-less happy. Is there anything else I should do before I create the PR?

@ceddlyburge
Copy link
Contributor

I think put in in review. We can always review it twice if needs be ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/create Work on something from scratch x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/concept Work on Concepts x:module/concept-exercise Work on Concept Exercises x:priority/high Has a higher priority than other issues x:size/large Large amount of work
Projects
None yet
Development

No branches or pull requests

3 participants