[Toybox] [PATCH] awk -- more patches
Ray Gardner
raygard at gmail.com
Thu Oct 31 16:35:07 PDT 2024
On Tue, Oct 29, 2024 at 6:39 PM enh <enh at google.com> wrote:
> On Tue, Oct 29, 2024 at 3:15 PM Rob Landley <rob at landley.net> wrote:
>>
>> On 10/23/24 21:01, Ray Gardner wrote:
> i certainly had trouble when AOSP bust one of one-true-awk's
> scalability limits.
Elliott, have you tried toybox awk yet? If not, why? Still using bwk's?
> but that seems like the philosophical issue the two of you are
> struggling with, perhaps because you're at opposite ends of the
> spectrum... i think ray wants there to be [pun very much intended] a
> "one true awk" so there's never any excuse to have feature or
> performance differences, whereas you kind of want the opposite --- a
> minimal awk for toybox, and "other options are available" if you want
> something more.
Actually I really just want a fairly minimal awk for toybox. Mine is
larger than busybox awk, and it still lacks some features bbox's has. I
want to have a posix awk minus all the locale support, just utf8 (which
bbox awk still does not have). But also the features common to all or
most implementations, such as RS can be a regex.
I am guessing most bbox awk features beyond that are due to requests
from users; they are borrowed from gawk. If so, I don't know if we need
them or not.
I can probably shrink a bit without much redesign. Drop syntax recovery
and quit at first error. I added bitwise functions (and or xor lshift
rshift) (implemented by Oliver); they're in bbox awk (also from gawk).
Could remove and see if they're missed, but they're not a lot of code.
>> Sadly, sed is legitimately that large (93 lines of help output
>> implementing over two dozen commands letters). I was originally
>> expecting awk to have the ballpark complexity of sed, but apparently not?
> yeah, there's _way_ more language and functionality in awk than sed.
> i'd have guessed it would end up at least 5x larger than sed, so your
> 4x sounds pretty good to me :-)
> (O.G. one-true-awk is 8k lines, fwiw.)
Thanks for the support on that. I'd like to do better though.
Ray
More information about the Toybox
mailing list