Skip to content

Add new concept time and concept exercise kurokos-clock #748

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

Merged
merged 10 commits into from
May 15, 2025
Merged

Conversation

jiegillet
Copy link
Contributor

@jiegillet jiegillet commented May 10, 2025

Solves #735.

New concept, I tried to keep it simple :)

Full disclosure, I have been using Cursor for a while (AI-integrated editor), and I used it to generate some things (initial implementations, tests, hints) but of course I reviewed everything in detail and changed a lot of stuff. I wrote the intro and instructions myself, although I asked the AI to review them.
It was quite nice actually, it pointed out some issues, and even found a mistake in one instruction example. It also generated all the links in the hints correctly, which was cool because I hate writing those :)

As usual, I left the introduction as TODO, which will fail the CI.

@mpizenberg
Copy link
Member

I have been using Cursor for a while

Just randomly adding my input re this (sorry for the actual PR content ^^). I’ve had very mixed interactions with LLMs. Claude 3.5 and 3.7 while being clearly guided have been very useful. However, as soon as I’m a bit vague, not precise enough, it’s not good. And I’ve just tried the new gemini 2.5 pro exp because it’s still free and many people talking about how great it is. But for me it only produced overly verbose and wrong garbage. Especially in agents where it is kinda loose.

So quite disappointed for now. But I feel like with the nature of Elm (simple and pure functions) there is probably a path to generate inputs and context in a way that enable an agent to have a great overview of a big project. Say with just the type signatures for example, in addition to the body of some relevant functions and the agent could discover on its own the relevant context to add to continue to work.

Aaaanywaaay, </rant>

@jiegillet
Copy link
Contributor Author

So far I'm only using whatever default agent Cursor picks for me, because I can't be bothered to compare models. In general, I find the "autocomplete" functions really useful, especially in Elm, you add a new message, and then tab-tab-tab, it adds the right things in the right places.
I've found that with the right context (like "add a button that does a thing similar to another button") it gets it right. Creating tests works quite well too.
But I keep my expectations low, I generally ask the AI to do small tasks at a time. It's good to learn how to use those tools, because they are not going away :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add https://package.elm-lang.org/packages/CoderDennis/elm-time-format/latest?

I'm not sure how much it is used, but formatting your own time is something I wouldn't be keen to bother with if I was writing an app


The `Time` module is used to display human-readable times.
While it's technically possibly to manipulate times with `Time`, there are Elm community packages that are far more suited to the task.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention https://package.elm-lang.org/packages/justinmimbs/date/latest, https://package.elm-lang.org/packages/CoderDennis/elm-time-format/latest here?

Formatting dates and times seems like a solved problem, so probably best not to scare people off using Elm ...


Define a function `showLocalDate : Locale -> Int -> Month -> Int -> String` which will display a (valid) local date.

In the `US` locale, the format will be `M/D/Y`, while in the `JP` locale it will be `Y年M月D日`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe expand this a bit, like you do for the time example? I found that my eyes didn't see the Y, M and D very easily in the string

Students should be able to

- understand what POSIX time means
- transform `Posix` into millisecond `Int` back and forth (`posixToMillis`, `millisToPosix`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all these things are in the exercise, but I think thats ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's only mentioned in the intro.
I though that since one of the goals of the concept was to make it clear that Time shouldn't really be used for manipulating time, we were better off just skipping it.
I am still a bit on the fence on that, but since you are saying it's OK, let's keep it that way.

@jiegillet
Copy link
Contributor Author

Thanks for the review!

@jiegillet jiegillet merged commit 6170a4f into main May 15, 2025
6 checks passed
@jiegillet jiegillet deleted the jie-time branch May 15, 2025 06:33
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