9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: arnold@skeeve.com
To: 9fans@9fans.net
Subject: Re: [9fans] Gawk in 9front-ports
Date: Tue,  7 Jul 2015 06:27:55 -0600	[thread overview]
Message-ID: <201507071227.t67CRtlQ005463@freefriends.org> (raw)
In-Reply-To: <CAK8RtFpZpKyBtzNLc5p1KxyiENuAPw_F63Opkg7v4u-yCnGMYg@mail.gmail.com>

Hi.

Jens Staal <staal1978@gmail.com> wrote:

> There was a recent discussion about that it would be nice to have gawk on
> Plan9.
>
> The latest upstream version of gawk can now be built via 9front-ports. I
> think/hope I built/ported it correctly, but it would be nice with
> critique/feedback/testing.

Majorly cool! The first thing to check is that 'make check' passes.
Some tests depend on locales; those are OK if they fail, assuming you
don't have locale data for them. Others are only run if gawk was built
with the MPFR library, so those should be OK too if they're not run. If
there are failures in other tests, they should be investigated.

I assume you built from the released tarball? Version 4.1.3?

> I noticed in the Arch linux package that gawk comes with a couple of
> dynamic libraries and a header. Are those also interesting to include in
> the Plan9 package (then as static libraries ofcourse)?

Supplyinig them as static libraries would serve no purpose. Those
dynamic libraries are extensions (or plug-ins, if you will). Gawk
loads them vial dlopen() if requested to via an @load directive in
the source or the via the -l command line option.

I hope that dlopen works on Plan 9; if so it's necessary to build
the libraries in whatever way will work to support dlopen.

The extension facility is something we (the gawk developers) put a
lot of work into for the 4.1 release. I can supply pointers to doc
for anyone who is interested. Here's a simple example:

	$ gawk -lreaddir '{ print }' .
	2814749767529876/./d
	281474977052502/../d
	2814749767530561/.bashrc/f
	281474976885114/.bash_history/f
	14355223812503808/.bash_profile/f
	1407374884183439/.bzr.log/f
	281474976885116/.ex-sgml-rc/f
	281474976885117/.exrc/f
	...

The readdir extension returns directory entries as records in an
easily-parsed format: '/' is the field separator and the fields are
the inode, the name, and an optional single-letter file type indicator.

The doc has more examples.

I hope this helps. Please feel to contact me off-list if you need
more info / help.

Thanks!

Arnold



  reply	other threads:[~2015-07-07 12:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07  2:37 Jens Staal
2015-07-07 12:27 ` arnold [this message]
2015-07-07 15:25   ` Jens Staal
2015-07-07 15:45     ` Charles Forsyth
2015-07-08 12:48       ` Jens Staal
2015-07-07 21:56 ` erik quanstrom
2015-07-07 22:36   ` Kurt H Maier
2015-07-08  1:47 ` Hugo Rivera
2015-07-08  6:22   ` arnold
2015-07-08 20:05     ` Hugo Rivera
2015-07-09  8:49       ` arnold
2015-07-09  9:58         ` Jens Staal
2015-07-09 10:19           ` Steve Simon
2015-07-09 12:31             ` Jeff Sickel
2015-07-09 13:50               ` erik quanstrom
2015-07-09 15:24                 ` [9fans] origins of configure arnold
2015-07-09 15:45                   ` tlaronde
2015-07-09 18:11                     ` arnold
2015-07-09 12:57             ` [9fans] Gawk in 9front-ports Jens Staal
2015-07-09 12:33         ` Hugo Rivera

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201507071227.t67CRtlQ005463@freefriends.org \
    --to=arnold@skeeve.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).