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

add concept exercise tracking-turntable #873

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

depial
Copy link
Contributor

@depial depial commented Apr 7, 2025

Here's another go at a potential concept exercise for complex-numbers which is quite simple, and which I hope doesn't sound quite as contrived. I ended up sticking with the idea of rotations in 2D since I couldn't think of how to simplify other "real-world" applications. A couple of points:

  • This is fairly simple mathematically speaking, with no messy, convention-specific stuff.
  • The first function teaches how to do rotations.
  • The second function teaches how to do radial displacements.
  • The last function is simply a composition of the first two.
  • I'm not sure if instructions.md need more or less detail (in either backstory or math) and I intentionally left a few things somewhat vague (e.g. I don't talk about working with vectors to avoid confusion with the data structure).

Overall, I feel better about this one due to its simplicity and relatively low levels of abstractness. I'm not sure if there are other tests with different functionality that I could include to make it more expansive, but we could brainstorm if so desired.

@depial
Copy link
Contributor Author

depial commented Apr 7, 2025

I've tentatively included an introduction.md based on this about.md. There are a few standard deletions for conciseness, but I've also added a couple of items I feel are relevant to the exercise.

@colinleach
Copy link
Contributor

First impressions are that I like this a lot better. I'll need to go through it in more detail later, and also update the complex-numbers concept to match (cispi, etc).

@BethanyG is this getting closer to what you would want for Python?

@depial
Copy link
Contributor Author

depial commented Apr 7, 2025

First impressions are that I like this a lot better

I feel much better about it. I think the first one was me trying to fit a concept into an exercise, and this time it was the other way round.

[I'll] also update the complex-numbers concept to match (cispi, etc).

Give that a sec before updating. I might still throw a phrase or two in while I'm trying to better sync introduction.md with instructions.md (I feel the former is basically good to go, but the latter still needs polishing)

@depial
Copy link
Contributor Author

depial commented Apr 7, 2025

and also update the complex-numbers concept to match (cispi, etc).

You're good to go! I don't think there's anything else I'll want to change in introduction.md at this point. Beyond the cispi section, also note that I changed to the first sentence under Arithmetic to be more in line with the docs. However, I think everything else should be a subset of the about.md

One further thing to consider, since this is a pretty light exercise, is that we could add extra tasks. For example, as beginning tasks:

  • Take (x, y) and produce a complex number. Rather trivial but maybe good for completeness.
  • Take (r, θ) and produce a complex number. This seems relevant, and only moderately trivial, in regards to the following tasks.

More complicated tasks for the end are feeling a bit more contrived, so I would likely avoid them, but I haven't thought too deeply about them either.

@colinleach
Copy link
Contributor

since this is a pretty light exercise, is that we could add extra tasks

Yes, I'd be in favor of things that give the gentlest possible introduction to the exercise. In the Julia world, alot of people may already be highly familiar with complex numbers. Exercism aims for a broader audience, where possible.

@colinleach
Copy link
Contributor

You're good to go!

I'll add this to the TODO list. Currently I'm working on locomotive-engineer but having to change the tasks in several places: partly to make it more about functions, less about dictionaries, partly because because it highlights a clash of idioms between Julia and Python.

Also, this exercise depends heavily on tuples, so I need to move tisbury-treasure-hunt up the priorities to satisfy the prereq.

@depial
Copy link
Contributor Author

depial commented Apr 7, 2025

I'll add this to the TODO list.

Sounds good!

we could add extra tasks

I've added the two tasks I outlined previously. They are actually kinda helpful in simplifying the code a bit in exemplar.jl. I resisted making a task about finding the magnitude and argument of a complex number because the exercise is currently convention agnostic, and a task of that sort would need one to be chosen.

I feel fairly content with the setup as is, but if you have any other thoughts on further tasks, let me know.

@BethanyG
Copy link
Member

BethanyG commented Apr 7, 2025

First impressions are that I like this a lot better. I'll need to go through it in more detail later, and also update the complex-numbers concept to match (cispi, etc).

@BethanyG is this getting closer to what you would want for Python?

I'm sorry -- No - I don't think it is getting closer. It feels like we are rushing to get something - anything done for this, and I sorta feel like we could do other concepts and exercises both better and easier, while we think about this one more. If this is a priority for Julia, then maybe we let Python lag. This currently feels like I could use trig functions - and the fact that complex numbers are "fun" just wouldn't push me. I know that's a personal bias, but I'm craving a problem that would be simplified or clarified by complex_numbers.

I did some research yesterday, and I think I am (personally) moving toward one of these:

  1. A complex-number based formula for Great Circle navigation/segmentation (find the distance and waypoints between two points on the globe). This would exercise the polar coordinate forms, as well as demonstrating how complex-numbers simplify the system of equations needed for a solution. I've got some code samples, and some really great resources for this...just not yet a clear outline.

  2. A (very) lite Fourier Transform. I really like this article from Tom Rocks Maths, about Air Traffic Control and RADAR. I think it really shows how complex numbers can simplify things. It might be too much -- but it also feels very "real world" and very motivating to me.

  3. A series of image rotations/translations. So a variation on something like/similar to the WIP exercism-matrix Padding would take care of the crop and fill issues there ... but we could also make it so that rotations were a multiple of 90, or only check the portion of the image that contained the data we wanted, or make the image margin an approximate circle, so that rotation and translation didn't have corners. This would likely exercise/motivate addition/subtraction etc. Again, not yet a clear outline, but there are really good resources out there.

  4. A very small Gimbal Lock problem, using quaternions. I haven't thought this one through entirely, but it feels like it might really motivate at least the gaming-minded. It gives a clear reason why you can't use traditional formulas and numbers when rotating in 3D.

  5. Robot Simulator goes global (navigate on a sphere) or airborne (navigate in 3D)). This one is quite vague in my mind right now, but it might be fun - it would be a variant on either the Gimbal Lock above, or Great Circle navigation.

@colinleach
Copy link
Contributor

Bethany, thanks for your comments. Kind of disappointing, but useful.

While we're throwing these ideas around, I'll repeat my earlier comment that exercises unsuitable for introducing the concept might instead be useful as a practice exercise. Only for a few tracks, but I would argue that's enough.

@BethanyG
Copy link
Member

BethanyG commented Apr 7, 2025

I am sorry to disappoint you. I am just really fussy about this one, which is why I don't want Python considerations to be in any way a blocker on the good work you two are doing for Julia. I do not want to get in anyones way, and I certainly don't want to stifle creativity -- so please don't let me be a roadblock. If you two feel that this works for you and your goals for the track -- then it works.

I just feel like (for Python) if this concept lays an egg, no one will bother even attempting the exercise. And since everything takes so much effort, that would be a big bummer. I know I am super-duper slow ... but I need more time to think on this.

Part of the issue here is that I am still working on things like Walrus and other concepts in the queue for Python. I am also trying to upgrade Python versions and tooling, as well as investigate moving to using WASM as opposed to Docker. So I am ... not exactly in the right mindset. I apologize.

@colinleach
Copy link
Contributor

I am still working on things like Walrus

Nice response! I know who has been pressuring you to merge this...

@BethanyG
Copy link
Member

BethanyG commented Apr 7, 2025

I also keep falling down rabbit holes like this and this - which are excellent, but doesn't get the WASM compiling done, nor the Walrus examples updated. :-|

@depial
Copy link
Contributor Author

depial commented Apr 7, 2025

After thinking about everything, since I'm more inclined toward theory, I believe I would be happier with this exercise as a starting point, since the math and concepts are relatively simple. Afterwards we could use one of the topics mentioned by BethanyG as a practice exercise.

I understand better now that for practically minded people, the other way around is likely more appropriate.

@colinleach BethanyG mentioned that practicality is an important undercurrent in the Pythonista community (if I understood correctly!), but perhaps not so much in the Julian one. If you think we can focus on theory first (i.e. Here's the machinery. This is how you use it.) and temporarily forego practicality aspect (i.e. This is where you use it.). I think we could split these up rather than trying to combine them.

Any thoughts?

@depial
Copy link
Contributor Author

depial commented Apr 7, 2025

I also keep falling down rabbit holes like this and this

@BethanyG In case you would like another rabbit hole ;)

This series has a lot of gems in it if topics like quaternions are interesting to you. Like this one on double covers

@colinleach
Copy link
Contributor

@depial, I'll support your decision. It would have been nice to have something more broadly applicable, but trying to smoosh together 2 tracks with different user bases and different priorities isn't working out well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants