bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can we include all 3 time extension functions in one package?


From: Ed Morton
Subject: Re: Can we include all 3 time extension functions in one package?
Date: Sun, 27 Oct 2019 13:29:00 -0500
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 10/26/2019 6:45 PM, Andrew J. Schorr wrote:
On Fri, Oct 25, 2019 at 02:17:54PM -0500, Ed Morton wrote:
maybe it'd make sense to move the 2 time extension functions,
gettimeofday and sleep, into the same gawkextlib package as
strptime, name that new package "time" instead of "strptime", and
deprecate the existing non-gawkextlib time extension?
I think it would be problematic during a transition period
if we were to give it the same name as the existing core gawk extension.
At least on my system, both the core gawk extension libraries and the
gawkextlib libraries are installed into /usr/lib64/gawk, so we can't
really have them installing the same file. I suppose we could use
the alternatives mechanism to attempt to deal with that issue, but
it seems simpler to use a different name.
Some other general time-related name for the gawkextlib package would be fine.
Pros:

1. There's then simply 2 collections of time functions - core and extension
2. You can get rid of a non-gawkextlib package
3. The gawkextlib time package would be named such that you can add any
    new time functions to it in future (as opposed to if it was named
    "strptime")

Cons:

1. The people using the existing time extension would need to 1-time
    change how they do that
It's pretty nasty to break existing code, so I think this is a serious con
of removing the core time extension.

2. You have work to do to move those 2 functions to the new gawkextlib
That's probably not much work.

Here's another con: there have been many complaints in the past about how
difficult it is to install gawkextlib libraries, whereas the core gawk
libraries are delivered with gawk, so they're available for "free".
Several gawkextlib extensions are now packaged in Fedora rpms, but I'm
not aware of any other distros that provide them. So there would be unending
complaints on comp.lang.awk about how it's unreasonable to ask users
to download a file and type 'configure && make && make check && make install'.

Regards,
Andy

According to http://gawkextlib.sourceforge.net/README.html# that's not all there is to it and I'm definitely in the camp of not wanting to deal with any of that on the multiple machines I work on (multiple PCs running cygwin, mac, dozens of Linux lab machines, etc., some of which I'd have to persuade other people to install gawkextlib on as I don't have permission) and I don't want to ship a script from my mac to my co-workers mac (for example) for him to try to run it and then find out he doesn't gave that extension built, etc. BUT if that's what the future is going to be and there are extensions coming with a significant benefit to me (e.g. CSV and JSON parsing and now strptime()) then I'll have to bite the bullet. I will always wish gawk simply came with the extensions already present of course but I'm sure there must be an excellent reason why it doesn't.

    Ed.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]