[Toybox] awk seen in the wild

Rob Landley rob at landley.net
Sun Jul 10 10:28:06 PDT 2016


On 07/08/2016 08:26 PM, Andy Chu wrote:
> On Fri, Jul 8, 2016 at 6:01 PM, Ed Maste <emaste at freebsd.org> wrote:
>> https://svnweb.freebsd.org/base/head/sys/tools/sound/feeder_rate_mkfilter.awk?view=markup
> 
> WOW.  OK that's a creative use of awk.  It's still a C code generator,
> but it's doing lots of floating point math to create audio filters.
> 899 lines.
> 
> Where exactly is this used?  Is it just a random user space tool or
> actually fundamental to BSD in some way?

Awk's better than bc.

A few years back Peter Anvin added perl as a build dependency to every
package he maintained (linux, syslinux, klibc, etc), at the same time.
I'm not sure exactly what agenda he was pushing, but there was a
definite theme. When I complained about the damage to the kernel and
submitted perl removal patches rewriting them in shell and C, he called
my objection to builds growing gratuitous new dependencies "academic":

http://lkml.iu.edu/hypermail/linux/kernel/0802.1/4400.html

Years later when I got serious about pushing the perl removal patches
upstream, I.E. not just periodically posting updated versions (which I
did for something like 5 years) but actually responding to people
explaining WHY they should go upstream:

http://lkml.iu.edu/hypermail/linux/kernel/1302.3/01520.html
http://lkml.iu.edu/hypermail/linux/kernel/1302.3/02061.html

Peter replaced timeconst.pl with timeconst.bc, which blocked my C
rewrite by porting it to a language that busybox didn't support and
which _correctly_ implementing would require an arbitrary precision math
library. (Which is why I started looking at the public domain libtommath
fork in dropbear, which I found utterly unintelligible.) And of course
Peter didn't post it to the list, but instead checked it straight in and
sent it to Linus in a pull request.

His bc version did successfully block my C rewrite of the same code and
keep my "academic" simple "build the kernel with busybox" from going up
into the mainstream, so I still have to maintain a patch out of tree to
do that:

https://github.com/landley/aboriginal/blob/master/sources/patches/linux-noperl-timeconst.patch

If he'd ported it to awk, busybox could have handled it. Which as far as
I can tell is why he _didn't_.

Rob


More information about the Toybox mailing list