Earlier quoted context omitted.
This sounds great, if i could trust it to get it right 100% of the time.
With the right harness around it you could trust it. Set it up so that it takes your input, generates the cron expression, then uses a deterministic cron library to spit out a summary of what that expression does plus a list of next upcoming instances. That should give you all the information you need to determine if it got the right expression.
Show HN: Cronexpr, a Rust library to parse and iter crontab expression
31–36 of 36 posts
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#32Earlier quoted context omitted.
With the right harness around it you could trust it. Set it up so that it takes your input, generates the cron expression, then uses a deterministic cron library to spit out a summary of what that expression does plus a list of next upcoming instances. That should give you all the information you need to determine if it got the right expression.
You think it would work to just pipe that description and next occurrences and ask an llm if it matches the intended prompt?
In this case I think it's better to run known, deterministic code that can turn a crontab into a clear explanation.
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#33Earlier quoted context omitted.
This sounds great, if i could trust it to get it right 100% of the time.
With the right harness around it you could trust it. Set it up so that it takes your input, generates the cron expression, then uses a deterministic cron library to spit out a summary of what that expression does plus a list of next upcoming instances. That should give you all the information you need to determine if it got the right expression.
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#34Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#35Earlier quoted context omitted.
You're welcome! As described in the "Why do you create this crate?" section, I actually started this domain only a few weeks ago. So I experienced how those tribal rules can be confusing and hard to search over the Internet the understand their semantic. And when I sorted out the parse structure [1] and finished the extensions [2][3], I believe I should write it down for others (and future me) :D [1] https://github.c…
Is there a comparison to other cron parsing libraries like Saffron? https://github.com/cloudflare/saffron
[1] https://github.com/hexagon/croner-rust?tab=readme-ov-file#wh...
As supported in [2],
> There are several good candidates like croner and saffron, but they are not suitable for my use case. Both of them do not support defining timezone in the expression which is essential to my use case. Although croner support specific timezone later when matching, the user experience is quite different. Also, the syntax that croner or saffron supports is subtly different from my demand. > > Other libraries are unmaintained or immature to use. > > Last, most candidates using chrono to processing datetime, while I’d prefer to extend the jiff ecosystem.
[2] https://docs.rs/cronexpr/latest/cronexpr/#why-do-you-create-...
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#36There is also a cron parser library from Cloudflare which is used for their cron jobs: https://github.com/cloudflare/saffron
... and this PR [1][2]
[1] https://github.com/tisonkun/cronexpr/pull/12
[2] https://docs.rs/cronexpr/latest/cronexpr/struct.Crontab.html...