Live data from Hacker News

Show HN: Cronexpr, a Rust library to parse and iter crontab expression

docs.rs

1–10 of 36 posts

Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression

#4
post #2

Looks well done. I like how the docs describe every syntax feature, and every non-standard feature in detail. Hat tip to implementing Vixie's "*,10" quirk, and to handling DST.

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.com/tisonkun/cronexpr/pull/4

[2] https://github.com/tisonkun/cronexpr/pull/5

[3] https://github.com/tisonkun/cronexpr/pull/6

Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression

#6

Main drawback is the need for timestamps. Most crontab files or expressions I've seen didn't have them.

Could you elaborate a bit on the issue? I'm not sure you are commenting on cronexpr or other libraries.

In cronexpr, there is no requirement for a timestamp until you'd like to find the next scheduled time, and thus you need to provide a related point.

To decouple with certain datetime lib, I made a `MakeTimestamp` struct which provides multiple constructors. Later, I found it somehow like a function overload :D

Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression

#8

Main drawback is the need for timestamps. Most crontab files or expressions I've seen didn't have them.

If you mean timezone, I wrote an FAQ [1]: "Why does the crate require the timezone to be specified in the crontab expression?"

[1] https://docs.rs/cronexpr/latest/cronexpr/#why-does-the-crate...

Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression

#9
post #8

Main drawback is the need for timestamps. Most crontab files or expressions I've seen didn't have them.

If you mean timezone, I wrote an FAQ [1]: "Why does the crate require the timezone to be specified in the crontab expression?" [1] https://docs.rs/cronexpr/latest/cronexpr/#why-does-the-crate...

So many of these restrictions feels arbitrary. Not supporting comments? Why?

Assuming UTC for tz is not weird and cron users expect it,

I guess why even support this specific syntax if the crons need to be edited to fit how this code expects them? There may have been better options if you were going full green field.

Good work though!

Post reply on HN