Live data from Hacker News

Show HN: Convert English to Cron Expressions

cronprompt.com

41–50 of 61 posts

Re: Show HN: Convert English to Cron Expressions

#41
I feel like AI is a poor fit for this domain, because the whole point of using a tool like this would be to check/ensure correctness. Perhaps it should at least also offer a precise translation back the other way?

Scheduled tasks are hard enough to debug as it is. The last thing I want to do is add more indeterminism!

Re: Show HN: Convert English to Cron Expressions

#43

I feel like AI is a poor fit for this domain, because the whole point of using a tool like this would be to check/ensure correctness. Perhaps it should at least also offer a precise translation back the other way? Scheduled tasks are hard enough to debug as it is. The last thing I want to do is add more indeterminism!

This reminds me of the "English to regular expressions" that was on here a few weeks back, and got it right about 10% of the time.

We have created structured, unambiguous domain languages for a reason. Converting from English is ambiguous at best, impossible at worst.

Re: Show HN: Convert English to Cron Expressions

#44

I feel like AI is a poor fit for this domain, because the whole point of using a tool like this would be to check/ensure correctness. Perhaps it should at least also offer a precise translation back the other way? Scheduled tasks are hard enough to debug as it is. The last thing I want to do is add more indeterminism!

Yes - the Cron schema is probably not the best schema.

It was designed to be easy to fit most things into one line.

It can express pretty much everything imaginable. But it's not designed to do that easily.

Maybe it'd be better to come up with a schema that's better suited for expressing non-trivial crons - and converting that to & from crontab format.

English is also not the best language for expressing this type of thing...

Re: Show HN: Convert English to Cron Expressions

#45
post #43

I feel like AI is a poor fit for this domain, because the whole point of using a tool like this would be to check/ensure correctness. Perhaps it should at least also offer a precise translation back the other way? Scheduled tasks are hard enough to debug as it is. The last thing I want to do is add more indeterminism!

This reminds me of the "English to regular expressions" that was on here a few weeks back, and got it right about 10% of the time. We have created structured, unambiguous domain languages for a reason. Converting from English is ambiguous at best, impossible at worst.

But isn't translating from English (or some other natural language) is what a programmer does when constructing a regular expression or a cron job? So it is possible, although humans make mistakes, too. Maybe fewer, or different mistakes than "AI", but still, fundamentally it's the same.

Maybe an alternative to natural language processing could be pattern recognition from a number of user supplied examples, and its expression in an unambiguous domain language. That's also what programmers do.

Re: Show HN: Convert English to Cron Expressions

#46

Great, using "never" as prompt results in: "At 12:00 AM, on day 31 of the month, only in February"

Always: “Every minute” Sometimes: “Every hour” Once in a blue moon: “At 12:00 AM, on day 18 of the month, only in February” On my birthday: “At 12:00 AM” On Christ's birthday: “At 12:00 AM, on day 25 of the month, only in December”

"spaghetti": “At 12:00 AM, between day 8 and 14 of the month, only in January through April and June through December”

Re: Show HN: Convert English to Cron Expressions

#47

Earlier quoted context omitted.

Always: “Every minute” Sometimes: “Every hour” Once in a blue moon: “At 12:00 AM, on day 18 of the month, only in February” On my birthday: “At 12:00 AM” On Christ's birthday: “At 12:00 AM, on day 25 of the month, only in December”

"spaghetti": “At 12:00 AM, between day 8 and 14 of the month, only in January through April and June through December”

That's a good one.

BTW, it's case sensitive:

"on independence day": “At 12:00 AM, only on Thursday, only in July” (0 0 * 7 4)

"On Independence Day": “At 12:00 AM, on day 4 of the month, only in July” (0 0 4 7 *)

Re: Show HN: Convert English to Cron Expressions

#48
post #31

So nice! For prior art (not GPT-3 based) in debian/ubuntu based distributions: /usr/share/doc/cron/examples/crontab2english.pl I use to use it like: perl /usr/share/doc/cron/examples/crontab2english.pl /etc/cron.d/myfile Also prior to crontab.guru: $ head -2 /usr/share/doc/cron/examples/crontab2english.pl #!/usr/bin/perl #Time-stamp: "2001-07-29 16:07:28 MDT" 21 years ago, more people did prefer english to cron :)

I've yet to be shown by someone on the internet there isn't a built-in *nix tool for everything.

Sometimes I am astonished what has been sitting in my directories all these years.

The biggest one probably being the 15 minutes it took to learn how to write systemd service files, versus using .

Post reply on HN