Someone has done a nice package for awk called rawk that adds some niceties—and a reasonably large “standard library”—to awk. It’s a single
(large) awk file and is expected to work in any posix awk (it doesn’t currently work with the plan9/p9p version, but I’m working with him on that).
https://git.sr.ht/~eli_oat/rawk/
A blog post by the author introducing it:
https://eli.li/make-awk-rawk
Your post appears to me to be completely misleading! According to the examples it's NOT an Awk library at all. It's a new language with new
syntax (running with Awk just as its vehicle).
Your post appears to me to be completely misleading! According to the examples it's NOT an Awk library at all. It's a new language with new
syntax (running with Awk just as its vehicle).
"package FOR Awk", it's rather "Awk has been used FOR this language".
The bad thing with that - from an Awk users' perspective - is that to
use it it seems, to use these "library" features, you'd need to learn
a new language with an own syntax. For Awk users a library written in
the Awk language would be much more useful. YMMV.
Janis
On 07.08.2025 22:39, Anthony wrote:
Someone has done a nice package for awk called rawk that adds some
niceties—and a reasonably large “standard library”—to awk. It’s a single
(large) awk file and is expected to work in any posix awk (it doesn’t
currently work with the plan9/p9p version, but I’m working with him on
that).
https://git.sr.ht/~eli_oat/rawk/
A blog post by the author introducing it:
https://eli.li/make-awk-rawk
On 2025-08-08, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
Your post appears to me to be completely misleading! According to the
examples it's NOT an Awk library at all. It's a new language with new
syntax (running with Awk just as its vehicle).
To be fair, there are languages in which such a thing is considered
a library, like Lisps!
Rawk has a translator which is written in Awk (directly, so if you know nothing but Awk, you can understand the translator and work on it),
and
the target language is Awk. You need an Awk program to run both the translator and the resulting code.
The only thing that's missing is that you can't launch an interactive
Awk session where you load Rawk, and then write Rawk programs; it is
batch translated. But otherwise it is locked squarely into your Awk ecosystem.
Moreover, the goal of this language is to implement Awk, but with
extensions, and not an entirely different language. Awk programs are supposedly valid Rawk programs. It's kind of like Objective C to C,
... or something.
It has fewer non-Awk dependencies than that cppawk think I wrote
a few years ago, which has a shell script driver, and requires the GNU preprocessor cpp.
The point is that, as opposed to an Awk library with Awk functions, a
new syntax (for this new language) has to be used. That got not clear
from the post. But from the examples and statements on the referenced
pages it's quite obvious, e.g.
$greet = (name) -> { return ...; };
There they also write
"... provides a quick snapshot of rawk's syntax and language features."
here clearly exposing its nature!
I was not objecting to yet another new language/dialect introduced[*],
but just that I considered the post completely misleading.
[*] Although I personally dislike attitudes of "write a new X language
to make the Y language appear more like the Z language". (But mileages
likely vary.)
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
Your post appears to me to be completely misleading! According to the
examples it's NOT an Awk library at all. It's a new language with new
syntax (running with Awk just as its vehicle).
I don’t think that’s a fair description. Rawk is entirely additive; all existing awk is valid rawk.
And any new bits you’d write using the new
syntax are nicely contained in the RAWK {} block.
In article <1077fht$1a1tc$1@dont-email.me>,
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
...
The point is that, as opposed to an Awk library with Awk functions, a
new syntax (for this new language) has to be used. That got not clear
from the post. But from the examples and statements on the referenced
pages it's quite obvious, e.g.
$greet = (name) -> { return ...; };
Hmmm. Now, what language does this look like???
[...]
[...]
[*] Although I personally dislike attitudes of "write a new X language
to make the Y language appear more like the Z language". (But mileages
likely vary.)
I assume X = "rawk", Y = AWK, and Z = P***.
And yes, I get your point and agree 100%.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,064 |
Nodes: | 10 (0 / 10) |
Uptime: | 159:14:25 |
Calls: | 13,691 |
Calls today: | 1 |
Files: | 186,936 |
D/L today: |
7,069 files (2,119M bytes) |
Messages: | 2,411,313 |