Re: Attempt #3, adding a new command 'sfilter'

From: John Baldwin <jhb_at_freebsd.org>
Date: Thu, 7 Sep 2006 16:43:43 -0400
On Thursday 07 September 2006 16:12, Garance A Drosihn wrote:
> At 10:57 AM -0400 9/7/06, John Baldwin wrote:
> >On Wednesday 06 September 2006 21:15, Julian Elischer wrote:
> >  >
> >>  perl is not lightweight to install on a machine.
> >>  have you seen how much crap  gets installed when you add perl?
> >>
> >>  lightweight is adding 100 instructions or so to 'date'.
> >>  or adding the strftime instruction to awk (as it is in gawk)
> >
> >Why not install the gawk port on the machines you need this on
> >rather than perl and use gawk then?  It doesn't look to be that
> >heavyweight of a port.
> 
> It seems reasonable to me to add a strftime() (and maybe a few other
> features) to our base-system awk.  But look at what happens if we
> install gawk:
> 
> -r-xr-xr-x  2 root  wheel   115732 May 29 21:01 /usr/bin/awk*
> -r-xr-xr-x  2 root  wheel  1201108 Sep  7 15:39 /usr/local/bin/gawk*

My response was because Julian said "Perl is huge and pulls in lots of 
dependencies".  Compared to perl, gawk is small and has very few 
dependencies.  I am not advocating putting gawk in the base system.  I'm 
advocating that Julian 'pkg_add -r gawk' instead of 'pkg_add -r perl' and be 
done with it.

> Perhaps we could add a few features to `awk', but only have those
> incompatible features available when the program is invoked under
> some new name.  We already do that to provide `nawk'.  But then the
> bikeshed will be which features to add!  I (for one) don't want the
> base-OS awk to grow by 1037% in size, so I certainly don't want all
> the features from `gawk'.  Just a few key ones, and maybe a few
> more that aren't in any of the existing awk's.

As previously mentioned, our awk is contrib, so you'd need to get the upstream 
provider to adopt strftime().  However, my ultimate point is that Julian's 
complaint about having to install perl to get his date time stamping feature 
is moot: he can just install the lighter-weight gawk and use that.  I'm 
afraid that the sfilter approach will slowly add more and more filters but 
will have an interface (command line switches, etc.) that is far less 
flexible and extendible than a tool like awk or sed.

The simple fact is, there is already relatively light-weight tool that already 
does what Julian wants: gawk.

-- 
John Baldwin
Received on Thu Sep 07 2006 - 19:32:55 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:00 UTC