[Toybox] awk (was: strlower() bug)

Ray Gardner raygard at gmail.com
Tue Jun 11 14:56:14 PDT 2024


Elliot, thanks for the positive feedback on the docs, but I really
wish you and Rob would try the program. I waited a while to see what
Rob would have to say. He doesn't seem the sort to be at a loss for
words, but ... nothing. Any idea why he's had nothing to say about an
awk for toybox?

BTW that mandelbrot.awk generates identical results on all awks
including mine, except busybox awk, when the frame rate display is
removed.

On Wed, May 22, 2024 at 7:51 AM enh <enh at google.com> wrote:
>
> interesting docs, thanks!
>
> i see you're already running the one-true-awk test suite, which was
> the only suggestion i would have had, and you're running it against
> "all the awks", which is even better than what i had in mind :-)
>
> On Tue, May 14, 2024 at 10:37 PM Ray Gardner <raygard at gmail.com> wrote:
> >
> > On Fri, May 10, 2024 at 1:38 PM Rob Landley <rob at landley.net> wrote:
> > >
> > > On 5/8/24 16:27, Ray Gardner wrote:
> > >> BTW I was a bit surprised that mentioning my awk for toybox got no reaction.
> > >
> > > Oh I'm interested, but somebody (probably you) mentioned they were looking into
> > > it before, and I'll wait to see some code first. :)
> > >
> > > (The problem with asking to see code early is pending/git.c isn't useful and
> > > that's as far as the original developer had time/energy for, and I haven't
> > > personally opened that can of worms yet. The problem with waiting until it's
> > > done is pending/bc.c was several times larger than I expected and I'm uncertain
> > > if I even want to personally open that can of worms.)
> > >
> > > That said, if you're actively working on it and wanted to do a brief design
> > > infodump here, consider it solicited. :)
> >
> > I've worked on it a lot. See
> >
> >     https://www.raygard.net/awkdoc/
> >
> >     https://github.com/raygard/wak/blob/main/toybox/awk.c
> >
> >     https://github.com/raygard/wak/blob/main/toybox_awk_test/awk.test
> >
> > Yes, it's larger than busybox awk. I believe it's also got fewer bugs
> > and performs better.
> >
> > It works. Drop it in toys/pending or (if you're feeling rad) in
> > toys/posix. Let me know if anything does not work.
> >
> > See the comments in https://github.com/raygard/wak/issues/7 -- it's in
> > use by at least a couple people in its "standalone" version outside of
> > toybox. Also see https://github.com/raygard/wak/issues/2 -- this guy
> > did the Advent of Code in awk, and my awk works on it.
> >
> > For more fun, get
> > https://github.com/patsie75/awk-mandelbrot/raw/master/mandelbrot.awk
> >
> > and run: toybox awk -v profile=2 -f mandelbrot.awk
> >
> > It may take a while but it will finish at frame 400. Try other profile
> > values (1 through 8). busybox awk doesn't work at all. All other awks
> > (gawk, Kernighan's awk, mawk, goawk) give similar output but no two
> > awks make identical output.
> >
> > Regarding bc.c being several times larger than expected: bc is a
> > programming language with functions and control structures and
> > arbitrary precision math and interactive mode. Not sure it can be
> > written much smaller. But my awk is smaller than toybox bc.c in
> > (non-comment nonblank) LOC.
> >
> > Ray
> >
> > > P.S. Also, my old Austin house finally went on the market last weekend and we
> >
> > P.S. I hope the house thing is going OK for you.
> > _______________________________________________
> > Toybox mailing list
> > Toybox at lists.landley.net
> > http://lists.landley.net/listinfo.cgi/toybox-landley.net


More information about the Toybox mailing list