Skip to content

noyesno/awka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5732da8 · Jul 19, 2021

History

86 Commits
Dec 20, 2020
Jul 17, 2021
Jul 18, 2021
Jul 18, 2021
Dec 16, 2015
Oct 23, 2015
Jul 18, 2021
Jul 18, 2021
Jul 19, 2021
Mar 29, 2021
Oct 23, 2015
Oct 23, 2015
Oct 23, 2015
Oct 23, 2015
Oct 23, 2015
Jul 18, 2021
Oct 23, 2015
Dec 21, 2020
Oct 23, 2015
Jan 28, 2016
Oct 23, 2015
Oct 23, 2015
Oct 23, 2015
Oct 23, 2015
Jun 23, 2021
Jun 23, 2021
Jul 4, 2021
Jul 18, 2021
Jun 30, 2021

Repository files navigation

Awka

C/C++ CI

This is a fork and enhanced version of Awka.

Awka - Open Source, AWK to C Conversion

Awka is not an interpreter like Gawk, Mawk or Nawk, but instead it converts the program to ANSI-C, then compiles this using gcc or a native C compiler to create a binary executable.

-- http://awka.sourceforge.net/index.html

  • Awka has two main parts: a translator and a library.
  • awka translate a Awk script into C code
  • libawka is used as link library to compile the generated C code.

Why compile Awk script into C program?

  • C program probably run faster.
  • "AWK programs are limited to what the interpreter provides".
  • "C code can be compiled with other code into a larger application."
  • "migrate stable functions from AWK to C" to impove performance.
  • Reuse existing C functions in Awk script.
  • A way of protect your Awk script.

Actually, the mixing use of Awk and C provide provide an interesting way of writing programs.

Revive Awka

Awka is an "old" project. Its last change 0.7.5 was on June 20 2001.

And to fill my usage requirement, some of my update to the code go much furhter than traditional "Awk".

What's new in "Revive Awka"?

  • Fix bugs in awka-0.7.5
  • Add libawka builtin function fseek and ftell to increase performance.
  • Add glob style matching, which shold be faster than regular expression in many case.
  • Lazy calling of line split function to increase performance.
  • Use nstring other than NULL terminated C string to avoid string copy.

What to do next?

  • Continue bug fixing.
  • Continue libawka performance improvement.
  • Support flexibl synax in the "Awk" script.
    • For example, add direct Tcl language support.
  • Make it thread safe to support processing multiple files in parallel.