Jacinda is a functional pattern sifting language, a smaller AWK.
There are binaries for some platforms on the releases page.
If you are on Mac, you will need to install *-librure.dylib
as well.
First, install Rust's regex library. You'll need to put librure.so
or librure.dylib
etc. in the appropriate place.
If you have cabal and GHC installed (perhaps via ghcup):
cabal install jacinda
There is a vim plugin and a VSCode extension.
Unix uses record separators in many places; we can display one entry in the
PATH
variable with:
echo $PATH | ja -F: "{|[x+'\n'+y]|>\`$}"
Many Unix tools output much information separated with spaces. We use regular expressions to match relevant lines and then select the field with the data itself, viz.
otool -l $(locate libpng.dylib) | ja '{`1 ~ /^name/}{`2}'
To get the value of a variable (say, PATH
) from the output of printenv
:
printenv | ja -F= '{%/^PATH/}{`2}'
Replace
NF == 1 && $1 != "}" {
haveversion[$1] = 1
}
END {
for (i in haveversion)
printf "have-%s = yes\n", i
}
with
(sprintf 'have-%s = yes')" ~.{nf=1 & `1 != '}'}{`1}
See the guide, which contains a tutorial on some of the features as well as examples.
The manpages document the builtins and provide a syntax reference.
- No nested dfns
- No list literal syntax
- Postfix
:f
and:i
are handled poorly - Streams of functions don't work
- Higher-order functions are subtly broken
Intentionally missing features:
- No loops
- Rust's regular expressions
- extensively documented with Unicode support
- Deduplicate builtin
Bug reports are welcome contributions.