r/awk • • 26d ago

AWKLog -- a simple Datalog interpreter in POSIX AWK

https://github.com/stass/awklog

Needs nothing besides AWK and works with most common AWK interpreters. Which makes it super easy to embed into existing projects.

12 Upvotes

4 comments sorted by

2

u/Razangriff-Raven 25d ago

Very interesting. I like how you made sure it works in GNU Awk and other variants.

2

u/stass 25d ago

This was partly driven by my own needs -- I use it as a part of build system in some of my projects to generate C code out of Datalog specifications, so need it to work across platforms and awk variants.

1

u/flpezet 23d ago

Woaw so good !
How did you come up with the idea of implementing it in AWK ?

3

u/stass 23d ago

I have a few projects where I generate C code from datalog rules during build -- so wanted something that would be able to do so without extra dependencies. AWK is available everywhere. So it was driven by my own needs, basically. Was surprised how well AWK is suited for this.