Skip to content

Releases: jawkio/jawk

v7.1.01

Choose a tag to compare

@github-actions github-actions released this 25 Aug 18:39

What's Changed

  • FIX: Convert numbers with the AWK rule when comparing against a string by @NassimBtk in #604
  • Document the members the Javadoc report flags, and doclint for them in verify by @bertysentry in #597
  • Report the running Jawk version to JSR 223 hosts by @bertysentry in #600

Full Changelog: v7.1.00...v7.1.01

v7.1.00

Choose a tag to compare

@github-actions github-actions released this 20 Aug 13:27

Jawk 7.1 makes Jawk easy to installcurl -fsSL https://jawk.io/get | sh and you have a
jawk command — and takes a deep pass over the numeric core: printf/sprintf are now
implemented natively with POSIX AWK / gawk semantics, integral arithmetic is computed exactly in
64 bits, and getline follows gawk down to which variables each form sets. Along the way, scripts
run measurably faster.

📦 One-command installation

  • Install the jawk executable with one commandcurl -fsSL https://jawk.io/get | sh on
    Linux/macOS, irm https://jawk.io/get.ps1 | iex on Windows. No sudo: the launcher goes into
    ~/.local/bin (or %LOCALAPPDATA%\Jawk), and it locates a Java runtime (Java 8 or later) at
    run time, so upgrading Java never requires a reinstall. JAWK_VERSION pins a release,
    JAWK_INSTALL_DIR changes where the launcher lands. Every release now also publishes a
    version-less jawk-standalone.jar alias with .sha256 checksums, so
    releases/latest/download/jawk-standalone.jar is a stable download URL
    by @bertysentry in #584
  • JAWK_CLASSPATH in the launchers — set it and the launcher runs the CLI with the standalone
    jar plus your entries on the JVM class path, so custom
    extension jars load with -l <fully.qualified.ClassName>.
    Previously the launcher always used java -jar, which ignores every class path setting
    by @bertysentry in #588
  • CI smoke tests for both installers — the real scripts are exercised end to end on every
    change, so a broken jawk.io/get cannot reach the site
    by @bertysentry in #587

🖨️ Native printf with AWK semantics

printf/sprintf no longer delegate to the Printf4J library, which emulated glibc's printf();
they are implemented in the new io.jawk.jrt.AwkPrintf with the semantics POSIX specifies and gawk
implements, verified against gawk 5.0/5.1
by @bertysentry in #543

  • %s uses AWK's number-to-string rules — integral values print without a fractional part
    (printf "%s", i after i++ prints 1, not 1.0), non-integral values honor the script's
    current CONVFMT.
  • %c prints the character for a numeric code point — numbers, numeric strings, and fields
    alike — or the first character of a string value.
  • Dynamic precision %.*f joins dynamic width %*d, negative values included; gawk
    positional specifiers
    (%2$s) and the ' grouping flag (%'d) are supported.
  • Out-of-range integers follow gawk — negative values wrap to unsigned 64-bit for
    %u/%o/%x/%X, and values beyond 64 bits print their full decimal expansion for %d/%i.
  • NaN and infinities print as nan, inf, -inf instead of Java's NaN/Infinity — in
    print, printf, and number-to-string conversions.
  • Correct rounding%e/%f/%g round the exact binary value of the double, halfway cases
    to even, like the C library gawk uses (printf "%.0f", 2.5 prints 2), and the same rounding
    applies through CONVFMT and OFMT (#548).
  • Too few arguments is a fatal error, as in gawk; unknown conversions — including %n, which
    Printf4J turned into a newline — print verbatim without consuming an argument.
  • New JavaStringFormatAwkSink for Java embedders: a sink whose printf/sprintf use
    String.format(...), giving scripts Java-only conversions such as %,d and %tY.

🔢 Exact numbers

  • Integral arithmetic is computed exactly in 64 bits+, -, *, an evenly-dividing /,
    %, unary ±, ++/-- and the compound assignments, on variables, array elements, and fields
    alike, keep all their digits beyond 2^53: print 9007199254740992 + 1 prints 9007199254740993,
    where gawk computes in doubles and prints 9007199254740992 unless run with -M. Overflow falls
    back to floating point, and comparisons between two exact integers are exact as well. Values
    beyond the 64-bit range are no longer saturated either: print 2^100 prints the full
    1267650600228229401496703205376
    by @bertysentry in #552
  • Fields keep their numeric value through += and ++, like = always did, and rebuilding
    $0 converts numeric fields with CONVFMT, as POSIX requires and gawk does:
    { $1 = 0.1 + 0.2; print } prints 0.3 ... instead of the raw 0.30000000000000004 ...
    by @bertysentry in #552
  • Exponent literals are lexed as one numberprint 2e3 prints 2000; previously the lexer
    stopped before the exponent, so 2e3 parsed as 2 concatenated with an uninitialized variable
    e3. Long numeric strings now keep all their digits instead of stopping after 26 characters, an
    integer literal too large for 64 bits is a floating-point constant instead of a
    NumberFormatException, and substr()'s length argument accepts every AWK number form
    by @bertysentry in #544
  • Array subscripts convert with the CONVFMT in effect when the subscript is used, as POSIX
    requires and gawk does, so a later CONVFMT change no longer retroactively rewrites existing
    keys — and integral subscripts beyond the 64-bit range key as their exact digits
    by @bertysentry in #551
  • Blank-padded numeric strings are recognized as strnums — the record " 12 " compares
    numerically ($0 == 12 is true), as in gawk; string constants such as x = " 12 " still compare
    as strings (#550)
    by @bertysentry in #573

📥 getline, redirections, and special filenames

  • Redirected getline sets exactly the variables gawk documentsgetline < file and
    cmd | getline set $0 and NF only; getline var < file and cmd | getline var set var
    only. Previously every redirected form also advanced NR, so a side read shifted the record
    numbers of the whole main input, and took over FILENAME
    by @bertysentry in #572
  • A getline that cannot open its file returns -1 with ERRNO carrying the gawk-style
    description, so the idiomatic while ((getline line < f) > 0) guard and probing for optional
    files work; previously the underlying Java IOException aborted the whole script
    by @bertysentry in #572
  • A getline that reads nothing leaves its target untouched, as POSIX requires — no more
    clearing $0/NF or assigning the empty string at end of input or on error
    by @bertysentry in #572
  • getline into a fieldgetline $n < file, cmd | getline $n, and plain getline $n
    stores the record into that field and rebuilds $0; previously any of these forms corrupted the
    interpreter's operand stack and crashed the script on the first record
    by @bertysentry in #572
  • The gawk special filenames /dev/stdout, /dev/stderr, /dev/stdin and their /dev/fd/N
    spellings route to the streams the process already holds open, instead of being opened — and
    truncated — as regular files. close() flushes the redirection and reports success without ever
    closing the underlying stream
    by @bertysentry in #564
  • /dev/null designates the null device on Windows (NUL) in redirections, in getline, and
    as an input operand, as gawk's Windows port does. Previously it was opened as a relative path,
    creating and truncating dev\null — and keeping the output that was meant to be discarded
    by @bertysentry in #568

🖥️ CLI and process integration

  • POSIX attached option-arguments-fprog.awk, -vx=1, -F: and the Jawk-specific -L,
    -K, -l now work like their spaced forms, as in gawk, mawk, BWK awk, and goawk; previously the
    glued form was rejected with Unknown parameter
    by @bertysentry in #576
  • -V / --version prints the Jawk version and the Java runtime that executes it, and the
    usage printed by -h now names the command you actually typed — the installed launchers pass it
    through the new JAWK_PROGRAM_NAME variable — instead of always describing a java -jar
    invocation the user never made
    by @bertysentry in #593
  • system() and command-pipe children inherit the standard input, as POSIX requires and gawk,
    mawk, and BWK awk do: echo hi | jawk 'BEGIN { "sort" | getline l; print l }' prints hi, and
    terminal-aware commands such as "stty size" | getline can reach the controlling terminal.
    Previously the child's standard input was always closed, so stdin filters read nothing
    by @bertysentry in #577

🧩 Language and correctness

  • next is accepted inside user-defined functions, as in gawk, mawk, and BWK awk: called from
    an input rule it abandons the current record and unwinds the active calls; called from BEGIN,
    END, BEGINFILE, or ENDFILE it is a runtime fatal error, matching gawk. Previously any next
    inside a function was rejected at compile time
    by @bertysentry in #582
  • Conditional expressions feeding a further operation now optimize correctly — shapes like
    (v ? v : 24) * 2, -(v ? 5 : 24), or $(v ? 1 : 2). The peephole literal fold used to merge
    the false branch's literal with the operation at the branches' join point, so (60 ? 60 : 24) * 2
    yielded 48 and leaked a value onto the operand stack that displaced later...
Read more

v7.0.01

Choose a tag to compare

@github-actions github-actions released this 31 Jul 16:17

What's Changed

Full Changelog: v7.0.00...v7.0.01

v7.0.00 - Full GNU Awk (gawk) extension support 🎉

Choose a tag to compare

@github-actions github-actions released this 30 Jul 21:43

Jawk 7 is a major milestone: beyond POSIX AWK, Jawk now supports the full set of gawk
language extensions and built-in functions — enabled by default, with a strict --posix
mode when you want the standard and nothing else. Scripts written for gawk now run on
Jawk, on the JVM, unchanged.

🚀 gawk language extensions

  • BEGINFILE / ENDFILE special rules, together with the nextfile statement and the
    ERRNO and ARGIND special variables, with gawk-compatible semantics for unreadable
    files, FILENAME/FNR handling, and hook restrictions
    by @bertysentry in #515
  • @include, @namespace, typed regexp literals (@/re/), and indirect function calls
    (@f())
    — including namespaced indirect calls dispatching user-defined, built-in, or
    extension functions
    by @bertysentry in #533
  • gawk-compatible array and scalar typing — untyped function arguments stay untyped
    until used, with gawk's runtime diagnostics for invalid array/scalar contexts
    by @bertysentry in #534

🧰 gawk built-in functions (now all implemented)

  • Array sorting and type introspection: asort(), asorti() (with all
    PROCINFO["sorted_in"] comparison modes, also honored by for (i in a)), typeof(),
    isarray(), mkbool(), and gensub()
    by @bertysentry in #504
  • The remaining gawk builtins: systime(), mktime(), strftime(), strtonum(),
    patsplit(), and the i18n interface (bindtextdomain(), dcgettext(),
    dcngettext()) — plus honest SYMTAB and FUNCTAB
    by @bertysentry in #527

🖥️ CLI and POSIX conformance

  • Handle -- and - per POSIX, and pass unknown options through to ARGV like gawk
    by @bertysentry in #526

⚡ Performance and internals

🏗️ Build

  • Standalone POM: no more dependency on org.metricshub:oss-parent
    by @bertysentry in #513

Full Changelog: v6.1.00...v7.0.00

Dependabot

  • build(deps): bump com.github.spotbugs:spotbugs-annotations from 4.9.8 to 4.10.3 by @dependabot[bot] in #510
  • build(deps): bump devops-infra/action-pull-request from 1.2.1 to 1.4.0 by @dependabot[bot] in #508
  • build(deps): bump org.metricshub:oss-parent from 4 to 5 by @dependabot[bot] in #507
  • build(deps): bump actions/checkout from 6 to 7 by @dependabot[bot] in #503
  • build(deps-dev): bump com.github.spotbugs:spotbugs-maven-plugin from 4.9.8.3 to 4.10.3.0 by @dependabot[bot] in #509
  • build(deps): bump org.apache.maven.plugins:maven-release-plugin from 3.1.1 to 3.3.1 by @dependabot[bot] in #520
  • build(deps): bump org.apache.maven.plugins:maven-compiler-plugin from 3.14.0 to 3.15.0 by @dependabot[bot] in #519
  • build(deps-dev): bump org.apache.maven.plugins:maven-artifact-plugin from 3.6.0 to 3.6.1 by @dependabot[bot] in #518
  • build(deps-dev): bump org.apache.maven.plugins:maven-source-plugin from 3.3.1 to 3.4.0 by @dependabot[bot] in #517
  • build(deps-dev): bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.3 to 3.5.6 by @dependabot[bot] in #516
  • build(deps): bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.2 to 3.12.0 by @dependabot[bot] in #525
  • build(deps-dev): bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.7 to 3.2.8 by @dependabot[bot] in #524
  • build(deps-dev): bump org.apache.maven.plugins:maven-failsafe-plugin from 3.5.3 to 3.5.6 by @dependabot[bot] in #523
  • build(deps-dev): bump org.apache.maven.plugins:maven-jar-plugin from 3.4.2 to 3.5.0 by @dependabot[bot] in #522
  • build(deps-dev): bump org.apache.maven.plugins:maven-resources-plugin from 3.3.1 to 3.5.0 by @dependabot[bot] in #521
  • build(deps): bump org.sentrysoftware.maven:maven-skin-tools from 1.8.00 to 1.8.01 by @dependabot[bot] in #531
  • build(deps-dev): bump org.apache.maven.plugins:maven-jar-plugin from 3.5.0 to 3.5.1 by @dependabot[bot] in #532

Full Changelog: v6.4.01...v7.0.00

v6.4.01

Choose a tag to compare

@github-actions github-actions released this 03 Jun 10:35

What's Changed

  • Integrate benchmark publishing into the release workflow by @bertysentry in #481
  • Expand JMH coverage for JRT and AVM hot paths by @bertysentry in #483
  • Implement AWK strnum semantics for input-derived numeric strings by @bertysentry in #486
  • Add ASSIGN_NOPUSH to eliminate redundant assignment pushes by @bertysentry in #494
  • Optimize chained string concatenation with counted CONCAT by @bertysentry in #495

Dependabot

  • build(deps): bump actions/upload-pages-artifact from 4 to 5 by @dependabot[bot] in #480
  • build(deps-dev): bump org.apache.maven.plugins:maven-surefire-report-plugin from 3.5.5 to 3.5.6 by @dependabot[bot] in #493
  • build(deps): bump devops-infra/action-pull-request from 0.6.1 to 1.2.1 by @dependabot[bot] in #492
  • build(deps): bump metricshub/workflows/.github/workflows/maven-central-deploy.yml from 4 to 6 by @dependabot[bot] in #491
  • build(deps-dev): bump org.apache.maven.plugins:maven-changelog-plugin from 3.0.0-M1 to 3.0.0-M2 by @dependabot[bot] in #489
  • build(deps): bump softprops/action-gh-release from 2 to 3 by @dependabot[bot] in #485

Full Changelog: v6.4.00...v6.4.01

v6.4.00

Choose a tag to compare

@github-actions github-actions released this 13 May 19:34

What's Changed

  • Release v6.3.00 and prepare v6.4.00-SNAPSHOT by @github-actions[bot] in #472
  • Refactor tuples into typed opcode subclasses by @bertysentry in #473
  • Optimize JRT.compare2 hot paths and publish benchmark reports by @bertysentry in #477

Full Changelog: v6.3.00...v6.4.00

v6.3.00

Choose a tag to compare

@github-actions github-actions released this 07 May 07:57

New Features

  • You can now pass List objects to AWK scripts, which will be accessible like regular maps/arrays: @bertysentry in #469
  • Add profiling report file support by @bertysentry in #471

Full Changelog: v6.2.01...v6.3.00

v6.2.01

Choose a tag to compare

@github-actions github-actions released this 05 May 09:15

What's Changed

  • Release v6.2.00 and prepare v6.3.00-SNAPSHOT by @github-actions[bot] in #465
  • Fixed compatibility dashboards generation in documentation site by @bertysentry in #467

Full Changelog: v6.2.00...v6.2.01

v6.2.00

Choose a tag to compare

@github-actions github-actions released this 04 May 15:02

New Features

  • Add full support for Persistent Memory in Java, Cli and gawk-style memory file by @bertysentry in #464

What's Changed

Dependabot

  • build(deps-dev): bump org.codehaus.mojo:exec-maven-plugin from 3.6.1 to 3.6.3 by @dependabot[bot] in #463
  • build(deps-dev): bump org.codehaus.mojo:build-helper-maven-plugin from 3.6.0 to 3.6.1 by @dependabot[bot] in #460

Full Changelog: v6.1.00...v6.2.00

v6.1.00

Choose a tag to compare

@github-actions github-actions released this 19 Apr 19:43

What's Changed

Full Changelog: v6.0.00...v6.1.00