[Toybox] [PATCH] awk -- more patches
enh
enh at google.com
Mon Nov 4 13:09:36 PST 2024
On Thu, Oct 31, 2024 at 7:35 PM Ray Gardner <raygard at gmail.com> wrote:
>
> 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?
i'm "not not" interested, but there hasn't been the demand for gawk
extensions that there is for, say, bash extensions.
(i'm not sure anyone who wasn't already using Unix in the 1990s has
even heard of awk, and even then they're more likely to be recovering
perl abusers, which itself is now mostly consigned to history! i may
have hated perl, but even i gave up on awk in the 1990s because the
commercial unix implementations tended to have lots of fixed-length
buffers that perl at least avoided...)
but when it's out of pending, i'll probably build it anyway. it'll
then at least be easy to flip the symlink to test.
off-topic, but did you try https://github.com/TheMozg/awk-raycaster ? :-)
> > 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