[Toybox] awk seen in the wild

enh enh at google.com
Mon Jul 11 09:46:06 PDT 2016


On Sun, Jul 10, 2016 at 10:28 AM, Rob Landley <rob at landley.net> wrote:
> 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.)

another plug for supporting a libcrypto dependency: the *sum utilities
are orders of magnitude faster with libcrypto, the SSL support in
things like netcat/wget would be something i could actually use on
Android (there's no way i'll be able to ship an alternative SSL
implementation) and you'd get arbitrary precision integers too.

i don't think you're likely to go this route, but i do like to keep
bringing it up so the idea of being API-compatible enough that it's
possible to use toybox with either your backend or *ssl is in the back
of your mind...

(no one's complained about the slow *sum commands yet, but if you're
interested i'm happy to send a patch.)

> 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
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.



More information about the Toybox mailing list