Crates.io | frawk |
lib.rs | frawk |
version | 0.4.8 |
source | src |
created_at | 2020-08-22 18:20:15.326784 |
updated_at | 2023-03-21 05:06:09.490518 |
description | an efficient Awk-like language |
homepage | https://github.com/ezrosent/frawk |
repository | https://github.com/ezrosent/frawk |
max_upload_size | |
id | 279586 |
size | 1,469,396 |
frawk is a small programming language for writing short programs processing textual data. To a first approximation, it is an implementation of the AWK language; many common Awk programs produce equivalent output when passed to frawk. You might be interested in frawk if you want your scripts to handle escaped CSV/TSV like standard Awk fields, or if you want your scripts to execute faster.
The info subdirectory has more in-depth information on frawk:
frawk is dual-licensed under MIT or Apache 2.0.
Note: frawk uses some nightly-only Rust features by default.
Build without the unstable
feature to build on stable.
You will need to install Rust. If you have not updated rust in a while,
run rustup update nightly
(or rustup update
if building using stable). If you would like
to use the LLVM backend, you will need an installation of LLVM 12 on your machine:
pacman -Sy llvm llvm-libs
and a C compiler (e.g. clang
) are sufficient as of September 2020.brew install llvm@12
or similar seem to work on Mac OS.Depending on where your package manager puts these libraries, you may need to
point LLVM_SYS_120_PREFIX
at the llvm library installation (e.g.
/usr/lib/llvm-12
on Linux or /usr/local/opt/llvm@12
on Mac OS when installing llvm@12 via Homebrew).
While the LLVM backend is recommended, it is possible to build frawk only with
support for the Cranelift-based JIT and its bytecode interpreter. To do this,
build without the llvm_backend
feature. The Cranelift backend provides
comparable performance to LLVM for smaller scripts, but LLVM's optimizations
can sometimes deliver a substantial performance boost over Cranelift (see the
benchmarks
document for some examples of this).
frawk currently requires a nightly compiler by default. To compile frawk using stable,
compile without the unstable
feature. Using rustup default nightly
, or some other
method to run a nightly compiler release is otherwise required to build frawk.
With those prerequisites, cloning this repository and a cargo build --release
or cargo [+nightly] install --path <frawk repo path>
will produce a binary that you can
add to your PATH
if you so choose:
$ cd <frawk repo path>
# With LLVM
$ cargo +nightly install --path .
# Without LLVM, but with other recommended defaults
$ cargo +nightly install --path . --no-default-features --features use_jemalloc,allow_avx2,unstable
frawk is now on crates.io, so running
cargo +nightly install frawk
with the desired features should also work.
While there are no deliberate unix-isms in frawk, I have not tested it on Windows. frawk does appear to build on Windows with default features disabled; see comments on this issue for more information.
frawk has bugs, and many rough edges. If you notice a bug in frawk, filing an issue with an explanation of how to reproduce the error would be very helpful. There are no guarantees on response time or latency for a fix. No one works on frawk full-time. The same policy holds for feature requests.